mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 16:32:57 +00:00
- Fixed RtlUnwind to correctly remove SEH frames and not to call ZwContinue.
svn path=/trunk/; revision=10010
This commit is contained in:
parent
7a25c2785c
commit
bfb94c6d6f
1 changed files with 15 additions and 35 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: exception.c,v 1.2 2004/07/04 02:01:02 navaraf Exp $
|
/* $Id: exception.c,v 1.3 2004/07/07 16:25:00 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ***************************************************************/
|
||||||
|
@ -307,20 +307,12 @@ RtlUnwind(PEXCEPTION_REGISTRATION RegistrationFrame,
|
||||||
Context.Eax = EaxValue;
|
Context.Eax = EaxValue;
|
||||||
|
|
||||||
// Begin traversing the list of EXCEPTION_REGISTRATION
|
// Begin traversing the list of EXCEPTION_REGISTRATION
|
||||||
while ((ULONG_PTR)ERHead != -1)
|
while ((ULONG_PTR)ERHead != -1 && ERHead != RegistrationFrame)
|
||||||
{
|
{
|
||||||
EXCEPTION_RECORD er2;
|
EXCEPTION_RECORD er2;
|
||||||
|
|
||||||
DPRINT("ERHead 0x%X\n", ERHead);
|
DPRINT("ERHead 0x%X\n", ERHead);
|
||||||
|
|
||||||
if (ERHead == RegistrationFrame)
|
|
||||||
{
|
|
||||||
DPRINT("Continueing execution\n");
|
|
||||||
ZwContinue(&Context, FALSE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// If there's an exception frame, but it's lower on the stack
|
// If there's an exception frame, but it's lower on the stack
|
||||||
// than the head of the exception list, something's wrong!
|
// than the head of the exception list, something's wrong!
|
||||||
if (RegistrationFrame && (RegistrationFrame <= ERHead))
|
if (RegistrationFrame && (RegistrationFrame <= ERHead))
|
||||||
|
@ -335,7 +327,6 @@ RtlUnwind(PEXCEPTION_REGISTRATION RegistrationFrame,
|
||||||
|
|
||||||
RtlRaiseException(&er2);
|
RtlRaiseException(&er2);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
Stack = ERHead + sizeof(EXCEPTION_REGISTRATION);
|
Stack = ERHead + sizeof(EXCEPTION_REGISTRATION);
|
||||||
|
@ -386,10 +377,10 @@ RtlUnwind(PEXCEPTION_REGISTRATION RegistrationFrame,
|
||||||
DPRINT("New ERHead is 0x%X\n", ERHead);
|
DPRINT("New ERHead is 0x%X\n", ERHead);
|
||||||
|
|
||||||
DPRINT("Setting exception registration at 0x%X as current\n",
|
DPRINT("Setting exception registration at 0x%X as current\n",
|
||||||
RegistrationFrame->prev);
|
/*RegistrationFrame->prev*/ pCurrExceptReg->prev);
|
||||||
|
|
||||||
// Unlink the exception handler
|
// Unlink the exception handler
|
||||||
SehpSetExceptionList(RegistrationFrame->prev);
|
SehpSetExceptionList(pCurrExceptReg->prev);
|
||||||
}
|
}
|
||||||
else // The stack looks goofy! Raise an exception to bail out
|
else // The stack looks goofy! Raise an exception to bail out
|
||||||
{
|
{
|
||||||
|
@ -403,17 +394,6 @@ RtlUnwind(PEXCEPTION_REGISTRATION RegistrationFrame,
|
||||||
RtlRaiseException(&er2);
|
RtlRaiseException(&er2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we get here, we reached the end of the EXCEPTION_REGISTRATION list.
|
|
||||||
// This shouldn't happen normally.
|
|
||||||
|
|
||||||
DPRINT("Ran out of exception registrations. RegistrationFrame is (0x%X)\n",
|
|
||||||
RegistrationFrame);
|
|
||||||
|
|
||||||
if ((ULONG_PTR)RegistrationFrame == -1)
|
|
||||||
ZwContinue(&Context, FALSE);
|
|
||||||
else
|
|
||||||
NtRaiseException(pExceptRec, &Context, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue