diff --git a/ntoskrnl/ex/dbgctrl.c b/ntoskrnl/ex/dbgctrl.c index 1948164397f..0091af90f23 100644 --- a/ntoskrnl/ex/dbgctrl.c +++ b/ntoskrnl/ex/dbgctrl.c @@ -319,6 +319,18 @@ NtSystemDebugControl( break; case SysDbgGetPrintBufferSize: + if (OutputBufferLength != sizeof(ULONG)) + { + Status = STATUS_INFO_LENGTH_MISMATCH; + } + else + { + /* Return buffer size only if KD is enabled */ + *(PULONG)OutputBuffer = KdPitchDebugger ? 0 : KdPrintBufferSize; + Status = STATUS_SUCCESS; + } + break; + case SysDbgSetPrintBufferSize: case SysDbgGetKdUmExceptionEnable: case SysDbgSetKdUmExceptionEnable: