From 2ea30bfeae021f7c99f40b0a8698ab855313dd94 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sat, 6 Jun 2015 09:36:01 +0000 Subject: [PATCH] [NTOSKRNL] do not set ReturnLength in ProcessWow64Information error case add size check in PROCESSOR_POWER_INFORMATION stub svn path=/trunk/; revision=68031 --- reactos/ntoskrnl/ex/sysinfo.c | 7 +++++++ reactos/ntoskrnl/ps/query.c | 1 + 2 files changed, 8 insertions(+) diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index 5a00c12d478..d2c7c4d442a 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -1839,6 +1839,13 @@ QSI_DEF(SystemDockInformation) /* Class 42 - Power Information */ QSI_DEF(SystemPowerInformation) { + *ReqSize = sizeof(PROCESSOR_POWER_INFORMATION) * KeNumberProcessors; + + if (sizeof(PROCESSOR_POWER_INFORMATION) * KeNumberProcessors > Size) + { + return STATUS_INFO_LENGTH_MISMATCH; + } + /* FIXME */ DPRINT1("NtQuerySystemInformation - SystemPowerInformation not implemented\n"); return STATUS_NOT_IMPLEMENTED; diff --git a/reactos/ntoskrnl/ps/query.c b/reactos/ntoskrnl/ps/query.c index 64a318e4706..64f45113993 100644 --- a/reactos/ntoskrnl/ps/query.c +++ b/reactos/ntoskrnl/ps/query.c @@ -960,6 +960,7 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle, Length = sizeof(ULONG_PTR); if (ProcessInformationLength != Length) { + Length = 0; Status = STATUS_INFO_LENGTH_MISMATCH; break; }