Module: wine Branch: master Commit: 3794c6b9368bc791f98d11680ca3f9da9e89b51c URL: http://source.winehq.org/git/wine.git/?a=commit;h=3794c6b9368bc791f98d11680c...
Author: Eric Pouech eric.pouech@orange.fr Date: Tue Sep 15 21:38:15 2009 +0200
ntdll: Implement basic support for processor power information.
---
dlls/ntdll/nt.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 54cb133..632d966 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -773,7 +773,7 @@ NTSTATUS WINAPI NtSetIntervalProfile( }
static SYSTEM_CPU_INFORMATION cached_sci; -static DWORD cpuHz; +static ULONGLONG cpuHz = 1000000000; /* default to a 1GHz */
#define AUTH 0x68747541 /* "Auth" */ #define ENTI 0x69746e65 /* "enti" */ @@ -1798,6 +1798,20 @@ NTSTATUS WINAPI NtPowerInformation( *ExecutionState = ES_USER_PRESENT; return STATUS_SUCCESS; } + case ProcessorInformation: { + PPROCESSOR_POWER_INFORMATION cpu_power = lpOutputBuffer; + + WARN("semi-stub: ProcessorInformation\n"); + if (nOutputBufferSize < sizeof(PROCESSOR_POWER_INFORMATION)) + 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; + } default: /* FIXME: Needed by .NET Framework */ WARN("Unimplemented NtPowerInformation action: %d\n", InformationLevel);