/* 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);
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);
}
}
- /* We should never return */
- while (TRUE);
+ /* If we returned, raise a status */
+ RtlRaiseStatus(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);