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:
kichik 2007-11-09 18:42:03 +00:00
parent 183a176b32
commit 502e50c094

View file

@ -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);