ntdll: Respect multiple CPUs when faking values.
This commit is contained in:
parent
dcf5548bd6
commit
40294182c1
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue