ntdll: Fix arm call_user_exception_dispatcher with kernel stack for syscalls.

This does the same as 23b44e8df6,
but for arm:

Don't call KiUserExceptionDispatcher directly on the stack pointer
stored in the CONTEXT, but use the one stored in syscall_frame
(which includes the stack allocation in e.g. RtlRaiseException).

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Martin Storsjö 2021-11-09 16:05:48 +02:00 committed by Alexandre Julliard
parent aa256deedd
commit 324150c0ae
1 changed files with 4 additions and 0 deletions

View File

@ -563,12 +563,16 @@ void call_raise_user_exception_dispatcher(void)
NTSTATUS call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context )
{
struct syscall_frame *frame = arm_thread_data()->syscall_frame;
DWORD lr = frame->lr;
DWORD sp = frame->sp;
NTSTATUS status = NtSetContextThread( GetCurrentThread(), context );
if (status) return status;
frame->r0 = (DWORD)rec;
frame->r1 = (DWORD)context;
frame->pc = (DWORD)pKiUserExceptionDispatcher;
frame->lr = lr;
frame->sp = sp;
frame->restore_flags |= CONTEXT_INTEGER | CONTEXT_CONTROL;
return status;
}