From bbad2b3f26b7cf8822044a1a50f0650539170215 Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Mon, 14 Mar 2022 12:27:40 -0700 Subject: [PATCH 1/2] ntdll/tests: Add tests for exception from NtClose. Signed-off-by: Daniel Lehman --- dlls/ntdll/tests/exception.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 442aadfd784b..c065b2d3e4a2 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1244,6 +1244,12 @@ static void test_debugger(DWORD cont_status) ok( !ctx.SegGs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); } } + else if (stage == 17) + { + todo_wine + ok(FALSE, "should not throw exception\n"); + continuestatus = DBG_EXCEPTION_NOT_HANDLED; + } else ok(FALSE, "unexpected stage %u\n", stage); @@ -3942,6 +3948,12 @@ static void test_debugger(DWORD cont_status) todo_wine ok( ctx.SegFs != ctx.SegSs, "wrong fs %04x / %04x\n", ctx.SegFs, ctx.SegSs ); ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); } + else if (stage == 17) + { + todo_wine + ok(FALSE, "should not throw exception\n"); + continuestatus = DBG_EXCEPTION_NOT_HANDLED; + } else ok(FALSE, "unexpected stage %u\n", stage); @@ -6613,6 +6625,12 @@ static void test_debugger(DWORD cont_status) if (stage == 12|| stage == 13) continuestatus = DBG_EXCEPTION_NOT_HANDLED; } + else if (stage == 17) + { + todo_wine + ok(FALSE, "should not throw exception\n"); + continuestatus = DBG_EXCEPTION_NOT_HANDLED; + } else ok(FALSE, "unexpected stage %x\n", stage); @@ -7861,6 +7879,12 @@ static void test_debugger(DWORD cont_status) if (stage == 12|| stage == 13) continuestatus = DBG_EXCEPTION_NOT_HANDLED; } + else if (stage == 17) + { + todo_wine + ok(FALSE, "should not throw exception\n"); + continuestatus = DBG_EXCEPTION_NOT_HANDLED; + } else ok(FALSE, "unexpected stage %x\n", stage); @@ -8590,11 +8614,13 @@ static void test_closehandle(DWORD numexc, HANDLE handle) invalid_handle_exceptions = 0; CloseHandle(handle); + todo_wine_if(handle == INVALID_HANDLE_VALUE) ok(invalid_handle_exceptions == numexc, "CloseHandle generated %d exceptions, expected %d\n", invalid_handle_exceptions, numexc); invalid_handle_exceptions = 0; pNtClose(handle); + todo_wine_if(handle == INVALID_HANDLE_VALUE) ok(invalid_handle_exceptions == numexc, "NtClose generated %d exceptions, expected %d\n", invalid_handle_exceptions, numexc); @@ -10688,6 +10714,8 @@ START_TEST(exception) test_stage = 16; test_debuggee_segments(); #endif + test_stage = 17; + test_closehandle(0, INVALID_HANDLE_VALUE); /* Special case. */ /* rest of tests only run in parent */ return; -- 2.27.0