- /* Create the process with a suspended main thread */
- if (bUnicode)
- {
- /* Call the UNICODE version */
- if (!CreateProcessW((LPCWSTR)lpApplicationName,
- (LPWSTR)lpCommandLine,
- lpProcessAttributes,
- lpThreadAttributes,
- bInheritHandles,
- dwCreationFlags | CREATE_SUSPENDED,
- lpEnvironment,
- (LPCWSTR)lpCurrentDirectory,
- (LPSTARTUPINFOW)lpStartupInfo,
- lpProcessInformation))
- {
- ERR("CreateProcessW failed, last error: %d\n", GetLastError());
- return FALSE;
- }
- }
- else
- {
- /* Call the ANSI version */
- if (!CreateProcessA((LPCSTR)lpApplicationName,
- (LPSTR)lpCommandLine,
- lpProcessAttributes,
- lpThreadAttributes,
- bInheritHandles,
- dwCreationFlags | CREATE_SUSPENDED,
- lpEnvironment,
- (LPCSTR)lpCurrentDirectory,
- (LPSTARTUPINFOA)lpStartupInfo,
- lpProcessInformation))
- {
- ERR("CreateProcessA failed, last error: %d\n", GetLastError());
- return FALSE;
- }
- }
-