WaitForSingleObject is simpler than looping on GetExitCodeProcess and allows the process to return STILL_ACTIVE
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5364 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
183a176b32
commit
502e50c094
1 changed files with 2 additions and 5 deletions
|
@ -439,11 +439,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||
|
||||
if (Ret)
|
||||
{
|
||||
do
|
||||
{
|
||||
GetExitCodeProcess(pi.hProcess, &Ret);
|
||||
Sleep(LOOPTIMEOUT);
|
||||
} while ( Ret == STILL_ACTIVE );
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
GetExitCodeProcess(pi.hProcess, &Ret);
|
||||
CloseHandle (pi.hProcess);
|
||||
CloseHandle (pi.hThread);
|
||||
ExitProcess(Ret);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue