https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b9852e83d294f7f047943…
commit b9852e83d294f7f047943ca5eaa89e9aa24462d8
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sun Sep 22 21:43:25 2024 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Tue Jan 28 22:00:56 2025 +0100
[NTOS:EX] HACK: on livecd, disable security features in NtSystemDebugControl
WinDBG can do some local debugging using 'windbg -kl'. In that case,
WinDBG tries to directly use NtSystemDebugControl. If this function
returns an error, WinDBG extracts a driver from its resources.
WinDBG will send IOCTLs to this driver, and this driver will call
KdSystemDebugControl.
However, on livecd (where %SYSTEMROOT% is read-only), WinDBG is unable
to extract the driver from its resources, and can't use the driver to
call KdSystemDebugControl.
As a work-around, allow all control classes in NtSystemDebugControl
in case of livecd.
WinDBG local debugging now also works on livecd (windbg -kl).
---
ntoskrnl/ex/dbgctrl.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/ex/dbgctrl.c b/ntoskrnl/ex/dbgctrl.c
index a62345ee692..5ed32619fee 100644
--- a/ntoskrnl/ex/dbgctrl.c
+++ b/ntoskrnl/ex/dbgctrl.c
@@ -267,7 +267,17 @@ NtSystemDebugControl(
case SysDbgWriteBusData:
case SysDbgCheckLowMemory:
/* Those are implemented in KdSystemDebugControl */
- Status = STATUS_NOT_IMPLEMENTED;
+ if (InitIsWinPEMode)
+ {
+ Status = KdSystemDebugControl(Command,
+ InputBuffer, InputBufferLength,
+ OutputBuffer, OutputBufferLength,
+ &Length, PreviousMode);
+ }
+ else
+ {
+ Status = STATUS_NOT_IMPLEMENTED;
+ }
break;
case SysDbgBreakPoint: