Trap Handlers in C Patch 1 of X (Patch by Sir_Richard <ros.arm@reactos.org>):
[reactos.git] / reactos / ntoskrnl / ke / i386 / exp.c
index c80ee03..c529a17 100644 (file)
@@ -772,6 +772,7 @@ KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame,
             /* Otherwise clear DR registers */
             Context->Dr0 =
             Context->Dr1 =
+            Context->Dr2 =
             Context->Dr3 =
             Context->Dr6 =
             Context->Dr7 = 0;
@@ -838,8 +839,8 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
     /* Set the context flags */
     Context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;
 
-    /* Check if User Mode or if the debugger is enabled */
-    if ((PreviousMode == UserMode) || (KdDebuggerEnabled))
+    /* Check if User Mode or if the kernel debugger is enabled */
+    if ((PreviousMode == UserMode) || (KeGetPcr()->KdVersionBlock))
     {
         /* Add the FPU Flag */
         Context.ContextFlags |= CONTEXT_FLOATING_POINT;