[PATCH] Kill a debug process to make sure we can cleanup

Paul Vriens Paul.Vriens.Wine at gmail.com
Mon Dec 8 06:04:57 CST 2008


---
 dlls/kernel32/tests/debugger.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c
index 014f390..e1a1768 100644
--- a/dlls/kernel32/tests/debugger.c
+++ b/dlls/kernel32/tests/debugger.c
@@ -239,7 +239,8 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks)
 
     /* The process exits... */
     trace("waiting for child exit...\n");
-    ok(WaitForSingleObject(info.hProcess, 60000) == WAIT_OBJECT_0, "Timed out waiting for the child to crash\n");
+    ret = WaitForSingleObject(info.hProcess, 60000);
+    ok(ret == WAIT_OBJECT_0, "Timed out waiting for the child to crash\n");
     ok(GetExitCodeProcess(info.hProcess, &exit_code), "GetExitCodeProcess failed: err=%d\n", GetLastError());
     if (strstr(dbgtasks, "code2"))
     {
@@ -255,6 +256,12 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks)
          ok(exit_code == STATUS_ACCESS_VIOLATION ||
             exit_code == WAIT_ABANDONED, /* win2k3 */
             "exit code = %08x instead of STATUS_ACCESS_VIOLATION or WAIT_ABANDONED\n", exit_code);
+    /* FIXME: Find out why Win9x, NT4 and W2K have timeouts for the "dbg,none" test */
+    if (ret == STATUS_TIMEOUT)
+    {
+        trace("Have to kill the process\n");
+        TerminateProcess(info.hProcess, ERROR_TIMEOUT);
+    }
     CloseHandle(info.hProcess);
 
     /* ...before the debugger */
-- 
1.6.0.4


--------------040704080901040502020604--



More information about the wine-patches mailing list