From 025e6f69759548a1f54dc9e372e36369828d3d45 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Mon, 12 Sep 2005 03:59:03 +0000 Subject: [PATCH] Fix previous strangely incomplete NtRaiseException implementation and re-enable the ProbeForRead call that failed svn path=/trunk/; revision=17816 --- reactos/ntoskrnl/ke/exception.c | 2 +- reactos/ntoskrnl/ke/i386/exp.c | 2 ++ reactos/ntoskrnl/ke/i386/syscall.S | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/exception.c b/reactos/ntoskrnl/ke/exception.c index 40f190e472b..49ec4fcfed3 100644 --- a/reactos/ntoskrnl/ke/exception.c +++ b/reactos/ntoskrnl/ke/exception.c @@ -23,7 +23,7 @@ KiContinuePreviousModeUser(IN PCONTEXT Context, CONTEXT LocalContext; /* We'll have to make a copy and probe it */ - //ProbeForRead(Context, sizeof(CONTEXT), sizeof(ULONG)); + ProbeForRead(Context, sizeof(CONTEXT), sizeof(ULONG)); RtlMoveMemory(&LocalContext, Context, sizeof(CONTEXT)); Context = &LocalContext; diff --git a/reactos/ntoskrnl/ke/i386/exp.c b/reactos/ntoskrnl/ke/i386/exp.c index 2288f27b224..1e2e3b95840 100644 --- a/reactos/ntoskrnl/ke/i386/exp.c +++ b/reactos/ntoskrnl/ke/i386/exp.c @@ -1017,6 +1017,7 @@ KiDispatchException(PEXCEPTION_RECORD ExceptionRecord, /* Align context size and get stack pointer */ Size = (sizeof(CONTEXT) + 3) & ~3; Stack = (Context.Esp & ~3) - Size; + DPRINT1("Stack: %lx\n", Stack); /* Probe stack and copy Context */ ProbeForWrite((PVOID)Stack, Size, sizeof(ULONG)); @@ -1027,6 +1028,7 @@ KiDispatchException(PEXCEPTION_RECORD ExceptionRecord, (EXCEPTION_MAXIMUM_PARAMETERS - ExceptionRecord->NumberParameters) * sizeof(ULONG) + 3) & ~3; NewStack = Stack - Size; + DPRINT1("NewStack: %lx\n", NewStack); /* Probe stack and copy exception record. Don't forget to add the two params */ ProbeForWrite((PVOID)(NewStack - 2 * sizeof(ULONG_PTR)), diff --git a/reactos/ntoskrnl/ke/i386/syscall.S b/reactos/ntoskrnl/ke/i386/syscall.S index 916d1d3c639..1854acd4d96 100644 --- a/reactos/ntoskrnl/ke/i386/syscall.S +++ b/reactos/ntoskrnl/ke/i386/syscall.S @@ -498,6 +498,13 @@ _NtRaiseException@12: pop ebp mov esp, ebp + /* Check the result */ + or eax, eax + jz _KiServiceExit2 + + /* Restore debug registers too */ + jmp _KiServiceExit + .globl _NtContinue@8 _NtContinue@8: