Commit fb39a9f5 authored by Sergey Simonchik's avatar Sergey Simonchik
Browse files

runnerw: use GetLastError as exit code if CreateProcessW fails (IDEA-CR-25052)

GetLastError returns error=2 if child process executable file not found (ERROR_FILE_NOT_FOUND from https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382)
parent d9313f31
Showing with 4 additions and 2 deletions
+4 -2
No preview for this file type
......@@ -294,10 +294,12 @@ int main(int argc, char * argv[]) {
NULL,
&si,
&pi)) {
DWORD exitCode = GetLastError();
if (exitCode == 0) exitCode = 1;
ErrorMessage("CreateProcess");
CloseHandle(newstdin);
CloseHandle(write_stdin);
exit(2);
exit(exitCode);
}
if (hasConsoleWindow || childParams.createNewConsole) {
attachChildConsole(pi);
......@@ -308,7 +310,7 @@ int main(int argc, char * argv[]) {
CreateThread(NULL, 0, &scanStdinThread, &write_stdin, 0, NULL);
unsigned long exitCode = 0;
DWORD exitCode = 0;
while (true) {
int rc = WaitForSingleObject(pi.hProcess, INFINITE);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment