Commit 23b44e8d authored by Martin Storsjo's avatar Martin Storsjo Committed by Alexandre Julliard

ntdll: Fix arm64 call_user_exception_dispatcher with kernel stack for syscalls.

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). This fixes unwinding test cases that worked before 08c4419a. Signed-off-by: 's avatarMartin Storsjo <martin@martin.st> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 0342de8e
......@@ -705,12 +705,18 @@ void call_raise_user_exception_dispatcher(void)
NTSTATUS call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context )
{
struct syscall_frame *frame = arm64_thread_data()->syscall_frame;
ULONG64 fp = frame->fp;
ULONG64 lr = frame->lr;
ULONG64 sp = frame->sp;
NTSTATUS status = NtSetContextThread( GetCurrentThread(), context );
if (status) return status;
frame->x[0] = (ULONG64)rec;
frame->x[1] = (ULONG64)context;
frame->pc = (ULONG64)pKiUserExceptionDispatcher;
frame->fp = fp;
frame->lr = lr;
frame->sp = sp;
frame->restore_flags |= CONTEXT_INTEGER | CONTEXT_CONTROL;
return status;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment