Hans Leidekker hans@it.vu.nl writes:
- memset(&si, 0, sizeof(si));
- si.cb = sizeof(si);
- if (!CreateProcessW(NULL, cmd_line, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
- {
HeapFree(GetProcessHeap(), 0, cmd_line);
return -1;
- }
- if (WAIT_OBJECT_0 != WaitForSingleObject(pi.hProcess, 10000))
WARN("Timed out waiting for command to start\n");
This waits for the process to end. If you really want to wait for it to start you have to use something like WaitForInputIdle.