Mega compiler intrinsics patch:
[reactos.git] / reactos / ntoskrnl / kd64 / kdlock.c
index f7a72a4..e294997 100644 (file)
@@ -74,16 +74,13 @@ BOOLEAN
 NTAPI\r
 KdPollBreakIn(VOID)\r
 {\r
-    BOOLEAN DoBreak = FALSE;\r
-    ULONG Flags = 0;\r
+    BOOLEAN DoBreak = FALSE, Enable;\r
 \r
     /* First make sure that KD is enabled */\r
     if (KdDebuggerEnabled)\r
     {\r
         /* Disable interrupts */\r
-        Ke386SaveFlags(Flags);\r
-        //Flags = __getcallerseflags();\r
-        _disable();\r
+        Enable = KeDisableInterrupts();\r
 \r
         /* Check if a CTRL-C is in the queue */\r
         if (KdpContext.KdpControlCPending)\r
@@ -115,11 +112,10 @@ KdPollBreakIn(VOID)
             }\r
         }\r
 \r
-        /* Re-enable interrupts if they were disabled */\r
-        if (Flags & EFLAGS_INTERRUPT_MASK) _enable();\r
+        /* Re-enable interrupts if they were enabled previously */\r
+        if (Enable) _enable();\r
     }\r
 \r
     /* Tell the caller to do a break */\r
     return DoBreak;\r
 }\r
-\r