Huw Davies : ntdll: Zero-init the buffer for non-linux versions of SystemProcessorPerformanceInformation.
Alexandre Julliard
julliard at winehq.org
Mon Oct 24 15:57:55 CDT 2016
Module: wine
Branch: master
Commit: 47303892ac4dcbfd2270a3bb09046b72fde8f9f2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=47303892ac4dcbfd2270a3bb09046b72fde8f9f2
Author: Huw Davies <huw at codeweavers.com>
Date: Mon Oct 24 14:11:55 2016 +0100
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 <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 46393a4..e0f6df0 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++)
More information about the wine-cvs
mailing list