https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d0e2fada23b6f84ee34b55048068d1fc60a3d8f1

commit d0e2fada23b6f84ee34b55048068d1fc60a3d8f1
Author:     Hervé Poussineau <[email protected]>
AuthorDate: Sat Mar 7 18:54:21 2020 +0100
Commit:     Hervé Poussineau <[email protected]>
CommitDate: Mon Nov 16 08:55:02 2020 +0100

    [NTOS:KD] Rename KdpEnterDebuggerException to KdpTrap + add KdpStub 
forwarder
    
    This removes somes uses of _WINKD_ macro.
---
 ntoskrnl/kd/kdmain.c   | 22 ++++++++++++++++++----
 ntoskrnl/kd64/kddata.c |  2 --
 ntoskrnl/kd64/kdinit.c |  4 ----
 3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/ntoskrnl/kd/kdmain.c b/ntoskrnl/kd/kdmain.c
index b2ebe1b661f..d411c83d53c 100644
--- a/ntoskrnl/kd/kdmain.c
+++ b/ntoskrnl/kd/kdmain.c
@@ -158,7 +158,7 @@ KdpServiceDispatcher(ULONG Service,
 
 BOOLEAN
 NTAPI
-KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame,
+KdpTrap(IN PKTRAP_FRAME TrapFrame,
                           IN PKEXCEPTION_FRAME ExceptionFrame,
                           IN PEXCEPTION_RECORD ExceptionRecord,
                           IN PCONTEXT Context,
@@ -292,6 +292,23 @@ KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame,
     return TRUE;
 }
 
+BOOLEAN
+NTAPI
+KdpStub(IN PKTRAP_FRAME TrapFrame,
+        IN PKEXCEPTION_FRAME ExceptionFrame,
+        IN PEXCEPTION_RECORD ExceptionRecord,
+        IN PCONTEXT ContextRecord,
+        IN KPROCESSOR_MODE PreviousMode,
+        IN BOOLEAN SecondChanceException)
+{
+    return KdpTrap(TrapFrame,
+                   ExceptionFrame,
+                   ExceptionRecord,
+                   ContextRecord,
+                   PreviousMode,
+                   SecondChanceException);
+}
+
 BOOLEAN
 NTAPI
 KdIsThisAKdTrap(IN PEXCEPTION_RECORD ExceptionRecord,
@@ -414,9 +431,6 @@ KdSystemDebugControl(IN SYSDBG_COMMAND Command,
                                 PreviousMode);
 }
 
-PKDEBUG_ROUTINE KiDebugRoutine = KdpEnterDebuggerException;
-
-CODE_SEG("INIT")
 PCHAR
 NTAPI
 KdpGetDebugMode(PCHAR Currentp2)
diff --git a/ntoskrnl/kd64/kddata.c b/ntoskrnl/kd64/kddata.c
index fb3e313733b..6d32ad6ec77 100644
--- a/ntoskrnl/kd64/kddata.c
+++ b/ntoskrnl/kd64/kddata.c
@@ -71,9 +71,7 @@ BOOLEAN KdpContextSent;
 //
 // Debug Trap Handlers
 //
-#ifdef _WINKD_
 PKDEBUG_ROUTINE KiDebugRoutine = KdpStub;
-#endif
 PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine;
 
 //
diff --git a/ntoskrnl/kd64/kdinit.c b/ntoskrnl/kd64/kdinit.c
index fdf79aceba3..55f96609759 100644
--- a/ntoskrnl/kd64/kdinit.c
+++ b/ntoskrnl/kd64/kdinit.c
@@ -171,10 +171,8 @@ KdInitSystem(IN ULONG BootPhase,
     /* Check if we already initialized once */
     if (KdDebuggerEnabled) return TRUE;
 
-#ifdef _WINKD_
     /* Set the Debug Routine as the Stub for now */
     KiDebugRoutine = KdpStub;
-#endif
 
     /* Disable break after symbol load for now */
     KdBreakAfterSymbolLoad = FALSE;
@@ -368,10 +366,8 @@ KdInitSystem(IN ULONG BootPhase,
     /* Initialize the debugger if requested */
     if (EnableKd && (NT_SUCCESS(KdDebuggerInitialize0(LoaderBlock))))
     {
-#ifdef _WINKD_
         /* Now set our real KD routine */
         KiDebugRoutine = KdpTrap;
-#endif
 
         /* Check if we've already initialized our structures */
         if (!KdpDebuggerStructuresInitialized)

Reply via email to