cmd.exe: Wait when launching GUI pgms in batch.

This commit is contained in:
Jason Edmeades 2007-08-09 23:56:15 +01:00 committed by Alexandre Julliard
parent c8b6b2b1d8
commit 09969e8de1
1 changed files with 2 additions and 1 deletions

View File

@ -1090,7 +1090,8 @@ void WCMD_run_program (WCHAR *command, int called) {
if (!assumeInternal && !console) errorlevel = 0;
else
{
if (assumeInternal || !HIWORD(console)) WaitForSingleObject (pe.hProcess, INFINITE);
/* Always wait when called in a batch program context */
if (assumeInternal || context || !HIWORD(console)) WaitForSingleObject (pe.hProcess, INFINITE);
GetExitCodeProcess (pe.hProcess, &errorlevel);
if (errorlevel == STILL_ACTIVE) errorlevel = 0;
}