wouldn't the (completly untested but) attached patch work better ?
- argv=HeapAlloc(GetProcessHeap(), 0, (argc+1)*sizeof(LPWSTR) + strlenW(lpCmdline) + 1);
hmm, it should of course be
- argv=HeapAlloc(GetProcessHeap(), 0, (argc+1)*sizeof(LPWSTR) + (strlenW(lpCmdline) + 1) * sizeof(WCHAR));
A+