- Fixed dispatching of nested exceptions.

svn path=/trunk/; revision=10049
This commit is contained in:
Filip Navara 2004-07-09 20:06:40 +00:00
parent b00489100f
commit 18168b454a

View file

@ -1,4 +1,4 @@
/* $Id: exception.c,v 1.3 2004/07/07 16:25:00 navaraf Exp $ /* $Id: exception.c,v 1.4 2004/07/09 20:06:40 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -90,8 +90,7 @@ ULONG
RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
IN PCONTEXT Context) IN PCONTEXT Context)
{ {
PEXCEPTION_REGISTRATION RegistrationFrame; PEXCEPTION_REGISTRATION RegistrationFrame, NestedFrame = NULL, DispatcherContext;
DWORD DispatcherContext;
DWORD ReturnValue; DWORD ReturnValue;
DPRINT("RtlpDispatchException()\n"); DPRINT("RtlpDispatchException()\n");
@ -107,7 +106,6 @@ RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
while ((ULONG_PTR)RegistrationFrame != -1) while ((ULONG_PTR)RegistrationFrame != -1)
{ {
EXCEPTION_RECORD ExceptionRecord2; EXCEPTION_RECORD ExceptionRecord2;
DWORD Temp = 0;
//PVOID RegistrationFrameEnd = (PVOID)RegistrationFrame + 8; //PVOID RegistrationFrameEnd = (PVOID)RegistrationFrame + 8;
// Make sure the registration frame is located within the stack // Make sure the registration frame is located within the stack
@ -172,9 +170,10 @@ RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
DPRINT("EBP == 0x%.08x\n", sp[6]); DPRINT("EBP == 0x%.08x\n", sp[6]);
} }
#endif #endif
if (RegistrationFrame == NULL) if (RegistrationFrame == NestedFrame)
{ {
ExceptionRecord->ExceptionFlags &= ~EXCEPTION_NESTED_CALL; // Turn off flag ExceptionRecord->ExceptionFlags &= ~EXCEPTION_NESTED_CALL; // Turn off flag
NestedFrame = NULL;
} }
if (ReturnValue == ExceptionContinueExecution) if (ReturnValue == ExceptionContinueExecution)
@ -207,10 +206,10 @@ RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
{ {
DPRINT("ReturnValue == ExceptionNestedException\n"); DPRINT("ReturnValue == ExceptionNestedException\n");
ExceptionRecord->ExceptionFlags |= EXCEPTION_EXIT_UNWIND; ExceptionRecord->ExceptionFlags |= EXCEPTION_NESTED_CALL;
if (DispatcherContext > Temp) if (NestedFrame < DispatcherContext)
{ {
Temp = DispatcherContext; NestedFrame = DispatcherContext;
} }
} }
else /* if (ReturnValue == ExceptionCollidedUnwind) */ else /* if (ReturnValue == ExceptionCollidedUnwind) */