From 39f888f2b3252cd1f70c4146c193872bbe9fccaa Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Tue, 15 Jul 2008 13:32:18 +0000 Subject: [PATCH] Yuriy Sidorov - Speed-up user mode exception handling by calling RtlDispatchException() first if there is no active user mode debugger. This avoids switches to kernel mode if exception can be handled by SEH. See issue #3485 for more details. svn path=/trunk/; revision=34521 --- reactos/lib/rtl/exception.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/lib/rtl/exception.c b/reactos/lib/rtl/exception.c index 1984ba957f8..87dde5761dc 100644 --- a/reactos/lib/rtl/exception.c +++ b/reactos/lib/rtl/exception.c @@ -41,8 +41,8 @@ RtlRaiseException(PEXCEPTION_RECORD ExceptionRecord) /* Write the context flag */ Context.ContextFlags = CONTEXT_FULL; - /* Check mode */ - if (RtlpGetMode() == UserMode) + /* Check if user mode debugger is active */ + if (RtlpCheckForActiveDebugger(FALSE)) { /* Raise an exception immediately */ Status = ZwRaiseException(ExceptionRecord, &Context, TRUE); @@ -94,8 +94,8 @@ RtlRaiseStatus(NTSTATUS Status) /* Write the context flag */ Context.ContextFlags = CONTEXT_FULL; - /* Check mode */ - if (RtlpGetMode() == UserMode) + /* Check if user mode debugger is active */ + if (RtlpCheckForActiveDebugger(FALSE)) { /* Raise an exception immediately */ ZwRaiseException(&ExceptionRecord, &Context, TRUE);