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

Alexandre Julliard julliard at wine.codeweavers.com
Thu Aug 9 08:23:08 CDT 2007


Module: wine
Branch: master
Commit: 2bdf6c75ecc70b7fb21e1e02a81f278a27ec118d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2bdf6c75ecc70b7fb21e1e02a81f278a27ec118d

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Aug  9 10:39:34 2007 +0200

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

---

 dlls/kernel32/except.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/except.c b/dlls/kernel32/except.c
index 32305cb..0817d23 100644
--- a/dlls/kernel32/except.c
+++ b/dlls/kernel32/except.c
@@ -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());




More information about the wine-cvs mailing list