Skip to content

Commit 0f36ef3

Browse files
hpoussinHBelusca
authored andcommitted
[NTOS:KD64] Improve KdSystemDebugControl
- Explicitly return STATUS_NOT_IMPLEMENTED on not implemented classes - Return STATUS_INVALID_INFO_CLASS on all other classes
1 parent a0b009f commit 0f36ef3

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

ntoskrnl/kd64/kdapi.c

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,6 +2222,9 @@ KdSystemDebugControl(
22222222
_Out_opt_ PULONG ReturnLength,
22232223
_In_ KPROCESSOR_MODE PreviousMode)
22242224
{
2225+
NTSTATUS Status;
2226+
ULONG Length = 0;
2227+
22252228
/* Handle some internal commands */
22262229
switch ((ULONG)Command)
22272230
{
@@ -2285,9 +2288,35 @@ KdSystemDebugControl(
22852288
break;
22862289
}
22872290

2288-
/* Local kernel debugging is not yet supported */
2289-
DbgPrint("KdSystemDebugControl is unimplemented!\n");
2290-
return STATUS_NOT_IMPLEMENTED;
2291+
switch (Command)
2292+
{
2293+
case SysDbgQueryVersion:
2294+
case SysDbgReadVirtual:
2295+
case SysDbgWriteVirtual:
2296+
case SysDbgReadPhysical:
2297+
case SysDbgWritePhysical:
2298+
case SysDbgReadControlSpace:
2299+
case SysDbgWriteControlSpace:
2300+
case SysDbgReadIoSpace:
2301+
case SysDbgWriteIoSpace:
2302+
case SysDbgReadMsr:
2303+
case SysDbgWriteMsr:
2304+
case SysDbgReadBusData:
2305+
case SysDbgWriteBusData:
2306+
case SysDbgCheckLowMemory:
2307+
UNIMPLEMENTED;
2308+
Status = STATUS_NOT_IMPLEMENTED;
2309+
break;
2310+
2311+
default:
2312+
Status = STATUS_INVALID_INFO_CLASS;
2313+
break;
2314+
}
2315+
2316+
if (ReturnLength)
2317+
*ReturnLength = Length;
2318+
2319+
return Status;
22912320
}
22922321

22932322
/*

0 commit comments

Comments
 (0)