Eric Pouech : kernel32/tests: Adapt duplicate console handle test to non-Win7 handles.
Alexandre Julliard
julliard at winehq.org
Fri Apr 22 14:46:03 CDT 2022
Module: wine
Branch: master
Commit: 56056f39d991ea97d9ebde8c98b68f7c028c6747
URL: https://source.winehq.org/git/wine.git/?a=commit;h=56056f39d991ea97d9ebde8c98b68f7c028c6747
Author: Eric Pouech <eric.pouech at gmail.com>
Date: Thu Apr 21 17:39:17 2022 +0200
kernel32/tests: Adapt duplicate console handle test to non-Win7 handles.
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/process.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index d94cecd3462..c1312bd8916 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -1507,11 +1507,6 @@ static void test_DebuggingFlag(void)
DeleteFileA(resfile);
}
-static BOOL is_console(HANDLE h)
-{
- return h != INVALID_HANDLE_VALUE && ((ULONG_PTR)h & 3) == 3;
-}
-
static void test_Console(void)
{
char buffer[2 * MAX_PATH + 35];
@@ -2500,17 +2495,11 @@ static void test_DuplicateHandle(void)
DeleteFileA(file_name);
f = CreateFileA("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
- if (!is_console(f))
- {
- skip("DuplicateHandle on console handle\n");
- CloseHandle(f);
- return;
- }
-
+ ok(f != INVALID_HANDLE_VALUE, "Failed to open CONIN$ %lu\n", GetLastError());
r = DuplicateHandle(GetCurrentProcess(), f, GetCurrentProcess(), &out,
0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
ok(r, "DuplicateHandle error %lu\n", GetLastError());
- todo_wine ok(f != out, "f == out\n");
+ ok(f == out || broken(/* Win7 */ (((ULONG_PTR)f & 3) == 3) && (f != out)), "f != out\n");
CloseHandle(out);
}
More information about the wine-cvs
mailing list