From 18168b454a7526b1cb3c208e67162120f9593c21 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 9 Jul 2004 20:06:40 +0000 Subject: [PATCH] - Fixed dispatching of nested exceptions. svn path=/trunk/; revision=10049 --- reactos/lib/rtl/i386/exception.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/reactos/lib/rtl/i386/exception.c b/reactos/lib/rtl/i386/exception.c index bb091e72396..e6abf5a5d68 100644 --- a/reactos/lib/rtl/i386/exception.c +++ b/reactos/lib/rtl/i386/exception.c @@ -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 * PROJECT: ReactOS kernel @@ -90,8 +90,7 @@ ULONG RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context) { - PEXCEPTION_REGISTRATION RegistrationFrame; - DWORD DispatcherContext; + PEXCEPTION_REGISTRATION RegistrationFrame, NestedFrame = NULL, DispatcherContext; DWORD ReturnValue; DPRINT("RtlpDispatchException()\n"); @@ -107,7 +106,6 @@ RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, while ((ULONG_PTR)RegistrationFrame != -1) { EXCEPTION_RECORD ExceptionRecord2; - DWORD Temp = 0; //PVOID RegistrationFrameEnd = (PVOID)RegistrationFrame + 8; // 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]); } #endif - if (RegistrationFrame == NULL) + if (RegistrationFrame == NestedFrame) { ExceptionRecord->ExceptionFlags &= ~EXCEPTION_NESTED_CALL; // Turn off flag + NestedFrame = NULL; } if (ReturnValue == ExceptionContinueExecution) @@ -207,10 +206,10 @@ RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, { DPRINT("ReturnValue == ExceptionNestedException\n"); - ExceptionRecord->ExceptionFlags |= EXCEPTION_EXIT_UNWIND; - if (DispatcherContext > Temp) + ExceptionRecord->ExceptionFlags |= EXCEPTION_NESTED_CALL; + if (NestedFrame < DispatcherContext) { - Temp = DispatcherContext; + NestedFrame = DispatcherContext; } } else /* if (ReturnValue == ExceptionCollidedUnwind) */