From dc30ea89c3028d857a0648831a48c4ec7d212b54 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 19 Feb 2016 03:19:21 +0100 Subject: [PATCH] Rebase against d0b88e7454b72afa5c8317b46ea0d924edff9411. --- ...ption-if-invalid-handle-is-passed-to.patch | 42 +++++++++---------- ...gString-should-throw-the-exception-a.patch | 20 ++++----- patches/patchinstall.sh | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/patches/ntdll-Exception/0001-ntdll-Throw-exception-if-invalid-handle-is-passed-to.patch b/patches/ntdll-Exception/0001-ntdll-Throw-exception-if-invalid-handle-is-passed-to.patch index 08bd21a0..edd1c9e9 100644 --- a/patches/ntdll-Exception/0001-ntdll-Throw-exception-if-invalid-handle-is-passed-to.patch +++ b/patches/ntdll-Exception/0001-ntdll-Throw-exception-if-invalid-handle-is-passed-to.patch @@ -1,4 +1,4 @@ -From 24da37188127f234bfefec34ef03cf45746a8402 Mon Sep 17 00:00:00 2001 +From 6d37527a75b5526ecaaf2a1039b7d9aa9e7dd57b Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 28 Sep 2014 22:42:46 +0200 Subject: ntdll: Throw exception if invalid handle is passed to NtClose and @@ -10,7 +10,7 @@ Subject: ntdll: Throw exception if invalid handle is passed to NtClose and 2 files changed, 92 insertions(+) diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c -index 3fadba7..6527501 100644 +index 1279f2b..35c3672 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c @@ -38,6 +38,7 @@ @@ -62,7 +62,7 @@ index 3fadba7..6527501 100644 } diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c -index f355513..98d73f4 100644 +index 94ccd7a..6fffef0 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -52,6 +52,7 @@ static NTSTATUS (WINAPI *pNtTerminateProcess)(HANDLE handle, LONG exit_code); @@ -73,11 +73,11 @@ index f355513..98d73f4 100644 #if defined(__x86_64__) static BOOLEAN (CDECL *pRtlAddFunctionTable)(RUNTIME_FUNCTION*, DWORD, DWORD64); -@@ -937,6 +938,16 @@ static void test_debugger(void) - /* here we handle exception */ - } +@@ -952,6 +953,16 @@ static void test_debugger(void) + + if (stage == 8) continuestatus = DBG_EXCEPTION_NOT_HANDLED; } -+ else if (stage == 7 || stage == 8) ++ else if (stage == 9 || stage == 10) + { + ok(de.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_INVALID_HANDLE, + "unexpected exception code %08x, expected %08x\n", de.u.Exception.ExceptionRecord.ExceptionCode, @@ -85,12 +85,12 @@ index f355513..98d73f4 100644 + ok(de.u.Exception.ExceptionRecord.NumberParameters == 0, + "unexpected number of parameters %d, expected 0\n", de.u.Exception.ExceptionRecord.NumberParameters); + -+ if (stage == 8) continuestatus = DBG_EXCEPTION_NOT_HANDLED; ++ if (stage == 10) continuestatus = DBG_EXCEPTION_NOT_HANDLED; + } else ok(FALSE, "unexpected stage %x\n", stage); -@@ -1893,6 +1904,53 @@ static void test_ripevent(DWORD numexc) +@@ -2049,6 +2060,53 @@ static void test_debug_service(DWORD numexc) pRtlRemoveVectoredExceptionHandler(vectored_handler); } @@ -144,7 +144,7 @@ index f355513..98d73f4 100644 static void test_vectored_continue_handler(void) { PVOID handler1, handler2; -@@ -1945,6 +2003,7 @@ START_TEST(exception) +@@ -2101,6 +2159,7 @@ START_TEST(exception) pNtGetContextThread = (void *)GetProcAddress( hntdll, "NtGetContextThread" ); pNtSetContextThread = (void *)GetProcAddress( hntdll, "NtSetContextThread" ); pNtReadVirtualMemory = (void *)GetProcAddress( hntdll, "NtReadVirtualMemory" ); @@ -152,33 +152,33 @@ index f355513..98d73f4 100644 pRtlUnwind = (void *)GetProcAddress( hntdll, "RtlUnwind" ); pRtlRaiseException = (void *)GetProcAddress( hntdll, "RtlRaiseException" ); pNtTerminateProcess = (void *)GetProcAddress( hntdll, "NtTerminateProcess" ); -@@ -2012,6 +2071,10 @@ START_TEST(exception) - test_ripevent(0); - test_stage = 6; - test_ripevent(1); -+ test_stage = 7; +@@ -2172,6 +2231,10 @@ START_TEST(exception) + test_debug_service(0); + test_stage = 8; + test_debug_service(1); ++ test_stage = 9; + test_closehandle(0); -+ test_stage = 8; ++ test_stage = 10; + test_closehandle(1); } else skip( "RtlRaiseException not found\n" ); -@@ -2026,6 +2089,7 @@ START_TEST(exception) - test_debug_registers(); +@@ -2187,6 +2250,7 @@ START_TEST(exception) test_outputdebugstring(1, FALSE); test_ripevent(1); + test_debug_service(1); + test_closehandle(0); test_vectored_continue_handler(); test_debugger(); test_simd_exceptions(); -@@ -2046,6 +2110,7 @@ START_TEST(exception) - test_debug_registers(); +@@ -2208,6 +2272,7 @@ START_TEST(exception) test_outputdebugstring(1, FALSE); test_ripevent(1); + test_debug_service(1); + test_closehandle(0); test_vectored_continue_handler(); test_virtual_unwind(); -- -2.6.4 +2.7.1 diff --git a/patches/ntdll-Exception/0002-ntdll-OutputDebugString-should-throw-the-exception-a.patch b/patches/ntdll-Exception/0002-ntdll-OutputDebugString-should-throw-the-exception-a.patch index 49f6d8fa..a17b91da 100644 --- a/patches/ntdll-Exception/0002-ntdll-OutputDebugString-should-throw-the-exception-a.patch +++ b/patches/ntdll-Exception/0002-ntdll-OutputDebugString-should-throw-the-exception-a.patch @@ -1,4 +1,4 @@ -From 297d030a4189ce937662004426e21990e4736d25 Mon Sep 17 00:00:00 2001 +From 24afda46f52586aebc91430294ff87620606ebba Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 28 Sep 2014 23:39:51 +0200 Subject: ntdll: OutputDebugString should throw the exception a second time, if @@ -38,10 +38,10 @@ index d4d66b2..981661b 100644 if (!mutex_inited) { diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c -index fc68ea5..693859d 100644 +index 6fffef0..d92ba2a 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c -@@ -1796,7 +1796,7 @@ static LONG CALLBACK outputdebugstring_vectored_handler(EXCEPTION_POINTERS *Exce +@@ -1813,7 +1813,7 @@ static LONG CALLBACK outputdebugstring_vectored_handler(EXCEPTION_POINTERS *Exce return EXCEPTION_CONTINUE_SEARCH; } @@ -50,7 +50,7 @@ index fc68ea5..693859d 100644 { PVOID vectored_handler; -@@ -1812,7 +1812,6 @@ static void test_outputdebugstring(DWORD numexc, BOOL todo) +@@ -1829,7 +1829,6 @@ static void test_outputdebugstring(DWORD numexc, BOOL todo) outputdebugstring_exceptions = 0; OutputDebugStringA("Hello World"); @@ -58,7 +58,7 @@ index fc68ea5..693859d 100644 ok(outputdebugstring_exceptions == numexc, "OutputDebugStringA generated %d exceptions, expected %d\n", outputdebugstring_exceptions, numexc); -@@ -2028,9 +2027,9 @@ START_TEST(exception) +@@ -2220,9 +2219,9 @@ START_TEST(exception) run_rtlraiseexception_test(EXCEPTION_BREAKPOINT); run_rtlraiseexception_test(EXCEPTION_INVALID_HANDLE); test_stage = 3; @@ -70,24 +70,24 @@ index fc68ea5..693859d 100644 test_stage = 5; test_ripevent(0); test_stage = 6; -@@ -2051,7 +2050,7 @@ START_TEST(exception) +@@ -2247,7 +2246,7 @@ START_TEST(exception) test_exceptions(); test_rtlraiseexception(); test_debug_registers(); - test_outputdebugstring(1, FALSE); + test_outputdebugstring(1); test_ripevent(1); + test_debug_service(1); test_closehandle(0); - test_vectored_continue_handler(); -@@ -2072,7 +2071,7 @@ START_TEST(exception) +@@ -2269,7 +2268,7 @@ START_TEST(exception) "RtlLookupFunctionEntry" ); test_debug_registers(); - test_outputdebugstring(1, FALSE); + test_outputdebugstring(1); test_ripevent(1); + test_debug_service(1); test_closehandle(0); - test_vectored_continue_handler(); -- -2.7.0 +2.7.1 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 0d4c9c82..da999457 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "c94336f381f15a30905c0601c91df9b37934c683" + echo "d0b88e7454b72afa5c8317b46ea0d924edff9411" } # Show version information