Module: wine Branch: master Commit: 66d39fba285128702fbe59b26063b4d9f69f5eaf URL: http://source.winehq.org/git/wine.git/?a=commit;h=66d39fba285128702fbe59b260...
Author: Hans Leidekker hans@codeweavers.com Date: Mon Sep 17 12:18:46 2012 +0200
wbemprox: Adapt to the new behavior of NtPowerInformation.
---
dlls/wbemprox/builtin.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index c2271c0..30dfd4c 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -782,9 +782,17 @@ static void get_processor_name( WCHAR *name ) } static UINT get_processor_maxclockspeed( void ) { - PROCESSOR_POWER_INFORMATION info; - if (!NtPowerInformation( ProcessorInformation, NULL, 0, &info, sizeof(info) )) return info.MaxMhz; - return 1000000; + PROCESSOR_POWER_INFORMATION *info; + UINT ret = 1000000, size = get_processor_count() * sizeof(PROCESSOR_POWER_INFORMATION); + NTSTATUS status; + + if ((info = heap_alloc( size ))) + { + status = NtPowerInformation( ProcessorInformation, NULL, 0, info, size ); + if (!status) ret = info[0].MaxMhz; + heap_free( info ); + } + return ret; }
static void fill_processor( struct table *table )