Commit 48cffa03 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent a10e9ba0
...@@ -1742,7 +1742,7 @@ static void test_ProcessName(void) ...@@ -1742,7 +1742,7 @@ static void test_ProcessName(void)
static void test_Handles(void) static void test_Handles(void)
{ {
HANDLE handle = GetCurrentProcess(); HANDLE handle = GetCurrentProcess();
HANDLE h2; HANDLE h2, h3;
BOOL ret; BOOL ret;
DWORD code; DWORD code;
...@@ -1773,12 +1773,16 @@ static void test_Handles(void) ...@@ -1773,12 +1773,16 @@ static void test_Handles(void)
handle = GetStdHandle( STD_ERROR_HANDLE ); handle = GetStdHandle( STD_ERROR_HANDLE );
ok( handle != 0, "handle %p\n", 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 ); CloseHandle( (HANDLE)STD_ERROR_HANDLE );
h2 = GetStdHandle( STD_ERROR_HANDLE ); h2 = GetStdHandle( STD_ERROR_HANDLE );
ok( h2 == 0 || ok( h2 == 0 ||
broken( h2 == handle) || /* nt4, w2k */ broken( h2 == h3) || /* nt4, w2k */
broken( h2 == INVALID_HANDLE_VALUE), /* win9x */ 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) static void test_SystemInfo(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment