Alexandre Julliard : kernel32/tests: Restore the stderr handle after the closing test.

Alexandre Julliard julliard at winehq.org
Fri May 28 09:43:10 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri May 28 11:21:44 2010 +0200

kernel32/tests: Restore the stderr handle after the closing test.

---

 dlls/kernel32/tests/process.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index d66d9f6..065a94a 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -1742,7 +1742,7 @@ static void test_ProcessName(void)
 static void test_Handles(void)
 {
     HANDLE handle = GetCurrentProcess();
-    HANDLE h2;
+    HANDLE h2, h3;
     BOOL ret;
     DWORD code;
 
@@ -1773,12 +1773,16 @@ static void test_Handles(void)
 
     handle = GetStdHandle( STD_ERROR_HANDLE );
     ok( handle != 0, "handle %p\n", handle );
+    DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(), &h3,
+                     0, TRUE, DUPLICATE_SAME_ACCESS );
+    SetStdHandle( STD_ERROR_HANDLE, h3 );
     CloseHandle( (HANDLE)STD_ERROR_HANDLE );
     h2 = GetStdHandle( STD_ERROR_HANDLE );
     ok( h2 == 0 ||
-        broken( h2 == handle) || /* nt4, w2k */
+        broken( h2 == h3) || /* nt4, w2k */
         broken( h2 == INVALID_HANDLE_VALUE),  /* win9x */
-        "wrong handle %p/%p\n", h2, handle );
+        "wrong handle %p/%p\n", h2, h3 );
+    SetStdHandle( STD_ERROR_HANDLE, handle );
 }
 
 static void test_SystemInfo(void)




More information about the wine-cvs mailing list