mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
Yuriy Sidorov <jura@cp-lab.com>
- Always call ZwRaiseException in user mode and RtlDispatchException in kernel mode. - If RtlDispatchException failed call ZwRaiseException in kernel mode. Otherwise unhandled RtlRaiseException() call in kernel mode simply ignored (do nothing)! - Call RtlRaiseStatus in RtlRaiseException, if something went wrong. See issue #3434 for more details. svn path=/trunk/; revision=34377
This commit is contained in:
parent
2c16b9c687
commit
be356d11cd
1 changed files with 7 additions and 7 deletions
|
@ -41,8 +41,8 @@ RtlRaiseException(PEXCEPTION_RECORD ExceptionRecord)
|
|||
/* Write the context flag */
|
||||
Context.ContextFlags = CONTEXT_FULL;
|
||||
|
||||
/* Check if we're being debugged (user-mode only) */
|
||||
if (!RtlpCheckForActiveDebugger(TRUE))
|
||||
/* Check mode */
|
||||
if (RtlpGetMode() == UserMode)
|
||||
{
|
||||
/* Raise an exception immediately */
|
||||
Status = ZwRaiseException(ExceptionRecord, &Context, TRUE);
|
||||
|
@ -50,7 +50,7 @@ RtlRaiseException(PEXCEPTION_RECORD ExceptionRecord)
|
|||
else
|
||||
{
|
||||
/* Dispatch the exception and check if we should continue */
|
||||
if (RtlDispatchException(ExceptionRecord, &Context))
|
||||
if (!RtlDispatchException(ExceptionRecord, &Context))
|
||||
{
|
||||
/* Raise the exception */
|
||||
Status = ZwRaiseException(ExceptionRecord, &Context, FALSE);
|
||||
|
@ -62,8 +62,8 @@ RtlRaiseException(PEXCEPTION_RECORD ExceptionRecord)
|
|||
}
|
||||
}
|
||||
|
||||
/* We should never return */
|
||||
while (TRUE);
|
||||
/* If we returned, raise a status */
|
||||
RtlRaiseStatus(Status);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -94,8 +94,8 @@ RtlRaiseStatus(NTSTATUS Status)
|
|||
/* Write the context flag */
|
||||
Context.ContextFlags = CONTEXT_FULL;
|
||||
|
||||
/* Check if we're being debugged (user-mode only) */
|
||||
if (!RtlpCheckForActiveDebugger(TRUE))
|
||||
/* Check mode */
|
||||
if (RtlpGetMode() == UserMode)
|
||||
{
|
||||
/* Raise an exception immediately */
|
||||
ZwRaiseException(&ExceptionRecord, &Context, TRUE);
|
||||
|
|
Loading…
Reference in a new issue