From 47303892ac4dcbfd2270a3bb09046b72fde8f9f2 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Mon, 24 Oct 2016 14:11:55 +0100 Subject: [PATCH] ntdll: Zero-init the buffer for non-linux versions of SystemProcessorPerformanceInformation. This ensures that the unused fields are set to zero, which matches the linux version. Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/ntdll/nt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 46393a42440..e0f6df0dc27 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -2062,7 +2062,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( int i; cpus = min(cpus,out_cpus); len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * cpus; - sppi = RtlAllocateHeap(GetProcessHeap(), 0,len); + sppi = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, len); for (i = 0; i < cpus; i++) { sppi[i].IdleTime.QuadPart = pinfo[i].cpu_ticks[CPU_STATE_IDLE]; @@ -2118,7 +2118,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( unsigned int n; cpus = min(NtCurrentTeb()->Peb->NumberOfProcessors, out_cpus); len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * cpus; - sppi = RtlAllocateHeap(GetProcessHeap(), 0, len); + sppi = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, len); FIXME("stub info_class SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION\n"); /* many programs expect these values to change so fake change */ for (n = 0; n < cpus; n++)