mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 10:41:12 +00:00
Try CreateProcess even if SHGetFileInfo fails so that we can launch
Unix binaries.
This commit is contained in:
parent
580235504d
commit
11d606db26
1 changed files with 8 additions and 7 deletions
|
@ -395,20 +395,21 @@ char filetorun[MAX_PATH];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console = SHGetFileInfo (filetorun, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
|
console = SHGetFileInfo (filetorun, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
|
||||||
if (!console) {
|
|
||||||
WCMD_print_error ();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ZeroMemory (&st, sizeof(STARTUPINFO));
|
ZeroMemory (&st, sizeof(STARTUPINFO));
|
||||||
st.cb = sizeof(STARTUPINFO);
|
st.cb = sizeof(STARTUPINFO);
|
||||||
status = CreateProcess (NULL, command, NULL, NULL, FALSE,
|
status = CreateProcess (NULL, command, NULL, NULL, FALSE,
|
||||||
0, NULL, NULL, &st, &pe);
|
0, NULL, NULL, &st, &pe);
|
||||||
if (!status) {
|
if (!status) {
|
||||||
WCMD_print_error ();
|
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
|
Loading…
Reference in a new issue