Mikolaj Zalewski : kernel32/tests: Don' t close an invalid handle if the process is being debugged as this will raise an exception .

Alexandre Julliard julliard at winehq.org
Thu Oct 18 07:59:35 CDT 2007


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

Author: Mikolaj Zalewski <mikolajz at google.com>
Date:   Wed Oct 17 11:08:51 2007 -0700

kernel32/tests: Don't close an invalid handle if the process is being debugged as this will raise an exception.

---

 dlls/kernel32/tests/actctx.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 5686089..0593909 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -16,7 +16,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include <wine/test.h>
+#include "wine/test.h"
 #include <winbase.h>
 #include <windef.h>
 #include <winnt.h>
@@ -835,9 +835,12 @@ static void test_actctx(void)
         test_detailed_info(handle, &detailed_info1);
         test_info_in_assembly(handle, 1, &manifest1_info);
 
-        b = CloseHandle(handle);
-        ok(!b, "CloseHandle succeeded\n");
-        ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() == %u\n", GetLastError());
+        if (!IsDebuggerPresent())  /* CloseHandle will generate an exception if a debugger is present */
+        {
+            b = CloseHandle(handle);
+            ok(!b, "CloseHandle succeeded\n");
+            ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() == %u\n", GetLastError());
+        }
 
         pReleaseActCtx(handle);
     }




More information about the wine-cvs mailing list