Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e2bd61b4
Commit
e2bd61b4
authored
Sep 06, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Add a function to retrieve the maximum processor clock speed.
parent
b11cfb7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
builtin.c
dlls/wbemprox/builtin.c
+9
-8
No files found.
dlls/wbemprox/builtin.c
View file @
e2bd61b4
...
...
@@ -780,14 +780,19 @@ static void get_processor_name( WCHAR *name )
regs_to_str
(
regs
,
16
,
name
+
32
);
}
}
static
UINT
get_processor_maxclockspeed
(
void
)
{
PROCESSOR_POWER_INFORMATION
info
;
if
(
!
NtPowerInformation
(
ProcessorInformation
,
NULL
,
0
,
&
info
,
sizeof
(
info
)
))
return
info
.
MaxMhz
;
return
1000000
;
}
static
void
fill_processor
(
struct
table
*
table
)
{
static
const
WCHAR
fmtW
[]
=
{
'C'
,
'P'
,
'U'
,
'%'
,
'u'
,
0
};
WCHAR
device_id
[
14
],
processor_id
[
17
],
manufacturer
[
13
],
name
[
49
]
=
{
0
};
struct
record_processor
*
rec
;
UINT
i
,
offset
=
0
,
num_logical_processors
,
count
=
get_processor_count
(),
cpuMhz
;
PROCESSOR_POWER_INFORMATION
ppi
;
UINT
i
,
offset
=
0
,
maxclockspeed
,
num_logical_processors
,
count
=
get_processor_count
();
if
(
!
(
table
->
data
=
heap_alloc
(
sizeof
(
*
rec
)
*
count
)))
return
;
...
...
@@ -795,11 +800,7 @@ static void fill_processor( struct table *table )
get_processor_manufacturer
(
manufacturer
);
get_processor_name
(
name
);
if
(
!
NtPowerInformation
(
ProcessorInformation
,
NULL
,
0
,
&
ppi
,
sizeof
(
ppi
)))
cpuMhz
=
ppi
.
MaxMhz
;
else
cpuMhz
=
1000000
;
maxclockspeed
=
get_processor_maxclockspeed
();
num_logical_processors
=
get_logical_processor_count
()
/
count
;
for
(
i
=
0
;
i
<
count
;
i
++
)
...
...
@@ -809,7 +810,7 @@ static void fill_processor( struct table *table )
sprintfW
(
device_id
,
fmtW
,
i
);
rec
->
device_id
=
heap_strdupW
(
device_id
);
rec
->
manufacturer
=
heap_strdupW
(
manufacturer
);
rec
->
maxclockspeed
=
cpuMhz
;
rec
->
maxclockspeed
=
maxclockspeed
;
rec
->
name
=
heap_strdupW
(
name
);
rec
->
num_logical_processors
=
num_logical_processors
;
rec
->
processor_id
=
heap_strdupW
(
processor_id
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment