https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6cf426345b425e9328ebd0b481f955b994dc0cd8
commit 6cf426345b425e9328ebd0b481f955b994dc0cd8 Author: Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org> AuthorDate: Thu Nov 28 22:53:10 2024 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org> CommitDate: Tue Dec 3 22:14:02 2024 +0100 [NTOS:KD64] Use KdpDprintf() instead of DbgPrint() for the debugger banner DPRINTs (#7540) Override DbgPrint(), used by the debugger banner DPRINTs, because KdInitSystem() can be called under the debugger lock by KdEnableDebugger(WithLock)(). In this case, when DbgPrint() (re-)enters the debugger via an interrupt and acquires the debugger lock, a deadlock occurs. --- ntoskrnl/kd64/kdinit.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ntoskrnl/kd64/kdinit.c b/ntoskrnl/kd64/kdinit.c index a49655ff6cb..93f2bd7dfca 100644 --- a/ntoskrnl/kd64/kdinit.c +++ b/ntoskrnl/kd64/kdinit.c @@ -11,9 +11,18 @@ #include <ntoskrnl.h> #include <reactos/buildno.h> + #define NDEBUG #include <debug.h> +/* + * Override DbgPrint(), used by the debugger banner DPRINTs below, + * because KdInitSystem() can be called under the debugger lock by + * KdEnableDebugger(WithLock)(). + */ +#define DbgPrint(fmt, ...) (KdpDprintf(fmt, ##__VA_ARGS__), 0) +#define DbgPrintEx(cmpid, lvl, fmt, ...) (KdpDprintf(fmt, ##__VA_ARGS__), 0) + /* UTILITY FUNCTIONS *********************************************************/ /*