kernel32: Don't get stuck if the debugger exits without signaling the event.

oldstable
Francois Gouget 2007-08-09 10:39:34 +02:00 committed by Alexandre Julliard
parent 403786bb37
commit 2bdf6c75ec
1 changed files with 10 additions and 1 deletions

View File

@ -319,7 +319,16 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
ret = CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, 0, env, NULL, &startup, &info);
FreeEnvironmentStringsA( env );
if (ret) WaitForSingleObject(hEvent, INFINITE); /* wait for debugger to come up... */
if (ret)
{
/* wait for debugger to come up... */
HANDLE handles[2];
CloseHandle(info.hThread);
handles[0]=hEvent;
handles[1]=info.hProcess;
WaitForMultipleObjects(2, handles, FALSE, INFINITE);
CloseHandle(info.hProcess);
}
else ERR("Couldn't start debugger (%s) (%d)\n"
"Read the Wine Developers Guide on how to set up winedbg or another debugger\n",
debugstr_a(cmdline), GetLastError());