ntdll: Return as many PROCESSOR_POWER_INFORMATIONs as there are CPUs.

This commit is contained in:
James Eder 2012-09-12 13:14:27 -06:00 committed by Alexandre Julliard
parent 8c5f5b49ec
commit c683b98da5

View File

@ -2325,20 +2325,27 @@ NTSTATUS WINAPI NtPowerInformation(
*ExecutionState = ES_USER_PRESENT;
return STATUS_SUCCESS;
}
case ProcessorInformation: {
PPROCESSOR_POWER_INFORMATION cpu_power = lpOutputBuffer;
case ProcessorInformation: {
PROCESSOR_POWER_INFORMATION* cpu_power = lpOutputBuffer;
int i;
WARN("semi-stub: ProcessorInformation\n");
if (nOutputBufferSize < sizeof(PROCESSOR_POWER_INFORMATION))
if ((lpOutputBuffer == NULL) || (nOutputBufferSize == 0))
return STATUS_INVALID_PARAMETER;
if ((nOutputBufferSize / sizeof(PROCESSOR_POWER_INFORMATION)) < NtCurrentTeb()->Peb->NumberOfProcessors)
return STATUS_BUFFER_TOO_SMALL;
cpu_power->Number = NtCurrentTeb()->Peb->NumberOfProcessors;
cpu_power->MaxMhz = cpuHz / 1000000;
cpu_power->CurrentMhz = cpuHz / 1000000;
cpu_power->MhzLimit = cpuHz / 1000000;
cpu_power->MaxIdleState = 0; /* FIXME */
cpu_power->CurrentIdleState = 0; /* FIXME */
return STATUS_SUCCESS;
}
for(i = 0; i < NtCurrentTeb()->Peb->NumberOfProcessors; i++) {
cpu_power[i].Number = i;
cpu_power[i].MaxMhz = cpuHz / 1000000;
cpu_power[i].CurrentMhz = cpuHz / 1000000;
cpu_power[i].MhzLimit = cpuHz / 1000000;
cpu_power[i].MaxIdleState = 0; /* FIXME */
cpu_power[i].CurrentIdleState = 0; /* FIXME */
}
return STATUS_SUCCESS;
}
default:
/* FIXME: Needed by .NET Framework */
WARN("Unimplemented NtPowerInformation action: %d\n", InformationLevel);