[ros-diffs] [fireball] 34377: Yuriy Sidorov <jura at 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.
fireball at svn.reactos.org
fireball at svn.reactos.org
Tue Jul 8 23:17:47 CEST 2008
Author: fireball
Date: Tue Jul 8 16:17:47 2008
New Revision: 34377
URL: http://svn.reactos.org/svn/reactos?rev=34377&view=rev
Log:
Yuriy Sidorov <jura at 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.
Modified:
trunk/reactos/lib/rtl/exception.c
Modified: trunk/reactos/lib/rtl/exception.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/exception.c?rev=34377&r1=34376&r2=34377&view=diff
==============================================================================
--- trunk/reactos/lib/rtl/exception.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/exception.c [iso-8859-1] Tue Jul 8 16:17:47 2008
@@ -41,8 +41,8 @@
/* 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 @@
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 @@
}
}
- /* We should never return */
- while (TRUE);
+ /* If we returned, raise a status */
+ RtlRaiseStatus(Status);
}
/*
@@ -94,8 +94,8 @@
/* 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);
More information about the Ros-diffs
mailing list