- KdDebuggerNotPresent should be FALSE by default.
[reactos.git] / reactos / ntoskrnl / kd64 / kdlock.c
index 179115b..9f5eafd 100644 (file)
@@ -30,6 +30,41 @@ KdpPortUnlock(VOID)
     KiReleaseSpinLock(&KdpDebuggerLock);\r
 }\r
 \r
+BOOLEAN\r
+NTAPI\r
+KdpPollBreakInWithPortLock(VOID)\r
+{\r
+    BOOLEAN DoBreak = FALSE;\r
+\r
+    /* First make sure that KD is enabled */\r
+    if (KdDebuggerEnabled)\r
+    {\r
+        /* Check if a CTRL-C is in the queue */\r
+        if (KdpContext.KdpControlCPending)\r
+        {\r
+            /* Set it and prepare for break */\r
+            DoBreak = TRUE;\r
+            KdpContext.KdpControlCPending = FALSE;\r
+        }\r
+        else\r
+        {\r
+            /* Now get a packet */\r
+            if (!KdReceivePacket(PACKET_TYPE_KD_POLL_BREAKIN,\r
+                                 NULL,\r
+                                 NULL,\r
+                                 NULL,\r
+                                 NULL))\r
+            {\r
+                /* Successful breakin */\r
+                DoBreak = TRUE;\r
+            }\r
+        }\r
+    }\r
+\r
+    /* Tell the caller to do a break */\r
+    return DoBreak;\r
+}\r
+\r
 /* PUBLIC FUNCTIONS **********************************************************/\r
 \r
 /*\r