From 7f28a1c521341399da1f3559358f2abf876d34be Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 6 Jun 2020 15:17:07 +0200 Subject: [PATCH] ntdll: Use NtContinue() to restore context after an exception. Signed-off-by: Alexandre Julliard --- dlls/ntdll/signal_arm.c | 4 ++-- dlls/ntdll/signal_arm64.c | 4 ++-- dlls/ntdll/signal_i386.c | 7 +++---- dlls/ntdll/signal_powerpc.c | 4 ++-- dlls/ntdll/signal_x86_64.c | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 291536ecb86..101912f7ec1 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -528,10 +528,10 @@ NTSTATUS WINAPI KiUserExceptionDispatcher( EXCEPTION_RECORD *rec, CONTEXT *conte } if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if ((status = call_stack_handlers( rec, context )) == STATUS_SUCCESS) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if (status != STATUS_UNHANDLED_EXCEPTION) RtlRaiseStatus( status ); return NtRaiseException( rec, context, FALSE ); diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 4abcee52962..334c217b943 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -783,10 +783,10 @@ NTSTATUS WINAPI KiUserExceptionDispatcher( EXCEPTION_RECORD *rec, CONTEXT *conte } if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if ((status = call_function_handlers( rec, context )) == STATUS_SUCCESS) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if (status != STATUS_UNHANDLED_EXCEPTION) RtlRaiseStatus( status ); return NtRaiseException( rec, context, FALSE ); diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index ccdc8ec7f3f..568fa34f18f 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -757,10 +757,10 @@ NTSTATUS WINAPI KiUserExceptionDispatcher( EXCEPTION_RECORD *rec, CONTEXT *conte if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context->Eip--; if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if ((status = call_stack_handlers( rec, context )) == STATUS_SUCCESS) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if (status != STATUS_UNHANDLED_EXCEPTION) RtlRaiseStatus( status ); return NtRaiseException( rec, context, FALSE ); @@ -1978,8 +1978,7 @@ void WINAPI DECLSPEC_HIDDEN __regs_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEn } frame = __wine_pop_frame( frame ); } - - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); } __ASM_STDCALL_FUNC( RtlUnwind, 16, "pushl %ebp\n\t" diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index 18ae3dbf2c8..e4c30f38a4e 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -372,10 +372,10 @@ NTSTATUS WINAPI KiUserExceptionDispatcher( EXCEPTION_RECORD *rec, CONTEXT *conte } if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if ((status = call_stack_handlers( rec, context )) == STATUS_SUCCESS) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if (status != STATUS_UNHANDLED_EXCEPTION) RtlRaiseStatus( status ); return NtRaiseException( rec, context, FALSE ); diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 961b6a9ab82..225cb981b07 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -2264,10 +2264,10 @@ NTSTATUS WINAPI KiUserExceptionDispatcher( EXCEPTION_RECORD *rec, CONTEXT *conte if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context->Rip--; if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if ((status = call_stack_handlers( rec, context )) == STATUS_SUCCESS) - NtSetContextThread( GetCurrentThread(), context ); + NtContinue( context, FALSE ); if (status != STATUS_UNHANDLED_EXCEPTION) RtlRaiseStatus( status ); return NtRaiseException( rec, context, FALSE );