Skip to content

Instantly share code, notes, and snippets.

View PQCraft's full-sized avatar
🐧
I use Arch BTW

PQCraft PQCraft

🐧
I use Arch BTW
View GitHub Profile
@PQCraft
PQCraft / CommandLineToArgvA.c
Last active July 23, 2022 04:35
CommandLineToArgvA implementation ported from WINE CommandLineToArgvW in a reduced and easier to read format
LPSTR* WINAPI CommandLineToArgvA(LPSTR lpCmdline, int* numargs) {
DWORD argc;
LPSTR* argv;
LPSTR s;
LPSTR d;
LPSTR cmdline;
int qcount, bcount;
if (!numargs || !*lpCmdline) {
SetLastError(ERROR_INVALID_PARAMETER);
return NULL;