ntdll: Zero-init the buffer for non-linux versions of SystemProcessorPerformanceInformation.
Huw Davies
huw at codeweavers.com
Mon Oct 24 08:11:55 CDT 2016
This ensures that the unused fields are set to zero, which matches the linux version.
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
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++)
--
2.7.4
More information about the wine-patches
mailing list