[NTOS:KD] Protect against invalid user arguments in KdpPrompt. CORE-14057
[reactos.git] / ntoskrnl / kd / kdmain.c
index e7d635e..a6627b8 100644 (file)
@@ -175,7 +175,8 @@ KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame,
                                     (USHORT)ExceptionRecord->
                                     ExceptionInformation[2],
                                     OutString,
-                                    OutStringLength);
+                                    OutStringLength,
+                                    PreviousMode);
 
             /* Return the number of characters that we received */
             Context->Eax = ReturnValue;
@@ -295,6 +296,7 @@ KdDisableDebugger(VOID)
 
     /* Disable the Debugger */
     KdDebuggerEnabled = FALSE;
+    SharedUserData->KdDebuggerEnabled = FALSE;
 
     /* Lower the IRQL */
     KeLowerIrql(OldIrql);
@@ -319,6 +321,7 @@ KdEnableDebugger(VOID)
 
     /* Enable the Debugger */
     KdDebuggerEnabled = TRUE;
+    SharedUserData->KdDebuggerEnabled = TRUE;
 
     /* Lower the IRQL */
     KeLowerIrql(OldIrql);