ntdll: Respect multiple CPUs when faking values.

This commit is contained in:
André Hentschel 2011-01-03 20:27:00 +01:00 committed by Alexandre Julliard
parent dcf5548bd6
commit 40294182c1
1 changed files with 10 additions and 9 deletions

View File

@ -1647,17 +1647,18 @@ NTSTATUS WINAPI NtQuerySystemInformation(
if (cpus == 0)
{
static int i = 1;
sppi = RtlAllocateHeap(GetProcessHeap(),0,sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION));
memset(sppi, 0 , sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION));
int n;
cpus = min(NtCurrentTeb()->Peb->NumberOfProcessors, out_cpus);
len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * cpus;
sppi = RtlAllocateHeap(GetProcessHeap(), 0, len);
FIXME("stub info_class SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION\n");
/* many programs expect these values to change so fake change */
len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION);
sppi->KernelTime.QuadPart = 1 * i;
sppi->UserTime.QuadPart = 2 * i;
sppi->IdleTime.QuadPart = 3 * i;
for (n = 0; n < cpus; n++)
{
sppi[n].KernelTime.QuadPart = 1 * i;
sppi[n].UserTime.QuadPart = 2 * i;
sppi[n].IdleTime.QuadPart = 3 * i;
}
i++;
}