Module: wine Branch: master Commit: b5cd47f54156814437783ca0b89977849e0ab037 URL: https://gitlab.winehq.org/wine/wine/-/commit/b5cd47f54156814437783ca0b899778...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Nov 30 17:20:31 2023 +0100
ntdll: Skip NtRaiseException() call on ARM64 when debugger is not present.
---
dlls/ntdll/signal_arm64.c | 6 +++++- dlls/ntdll/tests/exception.c | 1 - 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 08fde6ccf1e..0083f78412c 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -1550,7 +1550,11 @@ __ASM_GLOBAL_FUNC( RtlRaiseException, "stp x4, x5, [x1, #0xf0]\n\t" /* context->Fp, Lr */ "str x5, [x1, #0x108]\n\t" /* context->Pc */ "str x5, [x0, #0x10]\n\t" /* rec->ExceptionAddress */ - "mov x2, #1\n\t" + "ldr x3, [x18, #0x60]\n\t" /* peb */ + "ldrb w2, [x3, #2]\n\t" /* peb->BeingDebugged */ + "cbnz w2, 1f\n\t" + "bl " __ASM_NAME("dispatch_exception") "\n" + "1:\tmov x2, #1\n\t" "bl " __ASM_NAME("NtRaiseException") "\n\t" "bl " __ASM_NAME("RtlRaiseStatus") /* does not return */ );
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 792695869e2..3057ceb3f20 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -8646,7 +8646,6 @@ static void test_KiUserExceptionDispatcher(void) pRtlRaiseException(&record);
ok(got_exception, "Handler was not called.\n"); - todo_wine ok(!hook_called, "Hook was called.\n");
memcpy( pKiUserExceptionDispatcher, patched_code, sizeof(patched_code) );