Skip to content

Commit 6cf4263

Browse files
committed
[NTOS:KD64] Use KdpDprintf() instead of DbgPrint() for the debugger banner DPRINTs (reactos#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.
1 parent 1a02d33 commit 6cf4263

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ntoskrnl/kd64/kdinit.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,18 @@
1111

1212
#include <ntoskrnl.h>
1313
#include <reactos/buildno.h>
14+
1415
#define NDEBUG
1516
#include <debug.h>
1617

18+
/*
19+
* Override DbgPrint(), used by the debugger banner DPRINTs below,
20+
* because KdInitSystem() can be called under the debugger lock by
21+
* KdEnableDebugger(WithLock)().
22+
*/
23+
#define DbgPrint(fmt, ...) (KdpDprintf(fmt, ##__VA_ARGS__), 0)
24+
#define DbgPrintEx(cmpid, lvl, fmt, ...) (KdpDprintf(fmt, ##__VA_ARGS__), 0)
25+
1726
/* UTILITY FUNCTIONS *********************************************************/
1827

1928
/*

0 commit comments

Comments
 (0)