Skip to content

Commit 858846e

Browse files
committed
[NTOS:KD] Rename KdpEnterDebuggerException to KdpTrap + add KdpStub forwarder
This removes somes uses of _WINKD_ macro.
1 parent 175cc5f commit 858846e

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

ntoskrnl/kd/kdmain.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ KdpServiceDispatcher(ULONG Service,
158158

159159
BOOLEAN
160160
NTAPI
161-
KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame,
161+
KdpTrap(IN PKTRAP_FRAME TrapFrame,
162162
IN PKEXCEPTION_FRAME ExceptionFrame,
163163
IN PEXCEPTION_RECORD ExceptionRecord,
164164
IN PCONTEXT Context,
@@ -292,6 +292,23 @@ KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame,
292292
return TRUE;
293293
}
294294

295+
BOOLEAN
296+
NTAPI
297+
KdpStub(IN PKTRAP_FRAME TrapFrame,
298+
IN PKEXCEPTION_FRAME ExceptionFrame,
299+
IN PEXCEPTION_RECORD ExceptionRecord,
300+
IN PCONTEXT ContextRecord,
301+
IN KPROCESSOR_MODE PreviousMode,
302+
IN BOOLEAN SecondChanceException)
303+
{
304+
return KdpTrap(TrapFrame,
305+
ExceptionFrame,
306+
ExceptionRecord,
307+
ContextRecord,
308+
PreviousMode,
309+
SecondChanceException);
310+
}
311+
295312
BOOLEAN
296313
NTAPI
297314
KdIsThisAKdTrap(IN PEXCEPTION_RECORD ExceptionRecord,
@@ -414,8 +431,6 @@ KdSystemDebugControl(IN SYSDBG_COMMAND Command,
414431
PreviousMode);
415432
}
416433

417-
PKDEBUG_ROUTINE KiDebugRoutine = KdpEnterDebuggerException;
418-
419434
PCHAR
420435
NTAPI
421436
KdpGetDebugMode(PCHAR Currentp2)

ntoskrnl/kd64/kddata.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ BOOLEAN KdpContextSent;
7171
//
7272
// Debug Trap Handlers
7373
//
74-
#ifdef _WINKD_
7574
PKDEBUG_ROUTINE KiDebugRoutine = KdpStub;
76-
#endif
7775
PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine;
7876

7977
//

ntoskrnl/kd64/kdinit.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,8 @@ KdInitSystem(IN ULONG BootPhase,
171171
/* Check if we already initialized once */
172172
if (KdDebuggerEnabled) return TRUE;
173173

174-
#ifdef _WINKD_
175174
/* Set the Debug Routine as the Stub for now */
176175
KiDebugRoutine = KdpStub;
177-
#endif
178176

179177
/* Disable break after symbol load for now */
180178
KdBreakAfterSymbolLoad = FALSE;
@@ -368,10 +366,8 @@ KdInitSystem(IN ULONG BootPhase,
368366
/* Initialize the debugger if requested */
369367
if (EnableKd && (NT_SUCCESS(KdDebuggerInitialize0(LoaderBlock))))
370368
{
371-
#ifdef _WINKD_
372369
/* Now set our real KD routine */
373370
KiDebugRoutine = KdpTrap;
374-
#endif
375371

376372
/* Check if we've already initialized our structures */
377373
if (!KdpDebuggerStructuresInitialized)

0 commit comments

Comments
 (0)