From 734a043b22d56d0eee89f546de39a632360619f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 22 Sep 2024 21:42:21 +0200 Subject: [PATCH] [NTOS:EX] Implement NtSystemDebugControl: SysDbgGetPrintBufferSize --- ntoskrnl/ex/dbgctrl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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: