https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f36ef3392ac3cc446404…
commit 0f36ef3392ac3cc446404c6d1bf13aabeb19b6d9
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sat Sep 14 08:32:40 2024 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Tue Jan 28 22:00:37 2025 +0100
[NTOS:KD64] Improve KdSystemDebugControl
- Explicitly return STATUS_NOT_IMPLEMENTED on not implemented classes
- Return STATUS_INVALID_INFO_CLASS on all other classes
---
ntoskrnl/kd64/kdapi.c | 35 ++++++++++++++++++++++++++++++++---
1 file changed, 32 insertions(+), 3 deletions(-)
diff --git a/ntoskrnl/kd64/kdapi.c b/ntoskrnl/kd64/kdapi.c
index 36600e4beac..e2dce3491e6 100644
--- a/ntoskrnl/kd64/kdapi.c
+++ b/ntoskrnl/kd64/kdapi.c
@@ -2222,6 +2222,9 @@ KdSystemDebugControl(
_Out_opt_ PULONG ReturnLength,
_In_ KPROCESSOR_MODE PreviousMode)
{
+ NTSTATUS Status;
+ ULONG Length = 0;
+
/* Handle some internal commands */
switch ((ULONG)Command)
{
@@ -2285,9 +2288,35 @@ KdSystemDebugControl(
break;
}
- /* Local kernel debugging is not yet supported */
- DbgPrint("KdSystemDebugControl is unimplemented!\n");
- return STATUS_NOT_IMPLEMENTED;
+ switch (Command)
+ {
+ case SysDbgQueryVersion:
+ case SysDbgReadVirtual:
+ case SysDbgWriteVirtual:
+ case SysDbgReadPhysical:
+ case SysDbgWritePhysical:
+ case SysDbgReadControlSpace:
+ case SysDbgWriteControlSpace:
+ case SysDbgReadIoSpace:
+ case SysDbgWriteIoSpace:
+ case SysDbgReadMsr:
+ case SysDbgWriteMsr:
+ case SysDbgReadBusData:
+ case SysDbgWriteBusData:
+ case SysDbgCheckLowMemory:
+ UNIMPLEMENTED;
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+
+ default:
+ Status = STATUS_INVALID_INFO_CLASS;
+ break;
+ }
+
+ if (ReturnLength)
+ *ReturnLength = Length;
+
+ return Status;
}
/*