Commit 11d606db authored by Alexandre Julliard's avatar Alexandre Julliard

Try CreateProcess even if SHGetFileInfo fails so that we can launch

Unix binaries.
parent 58023550
......@@ -395,20 +395,21 @@ char filetorun[MAX_PATH];
return;
}
console = SHGetFileInfo (filetorun, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
if (!console) {
WCMD_print_error ();
return;
}
ZeroMemory (&st, sizeof(STARTUPINFO));
st.cb = sizeof(STARTUPINFO);
status = CreateProcess (NULL, command, NULL, NULL, FALSE,
0, NULL, NULL, &st, &pe);
if (!status) {
WCMD_print_error ();
return;
}
if (!console) errorlevel = 0;
else
{
if (!HIWORD(console)) WaitForSingleObject (pe.hProcess, INFINITE);
GetExitCodeProcess (pe.hProcess, &errorlevel);
if (errorlevel == STILL_ACTIVE) errorlevel = 0;
}
if (!HIWORD(console)) WaitForSingleObject (pe.hProcess, INFINITE);
GetExitCodeProcess (pe.hProcess, &errorlevel);
if (errorlevel == STILL_ACTIVE) errorlevel = 0;
}
/******************************************************************************
......
Markdown is supported
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