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
171de0a7
Commit
171de0a7
authored
May 26, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix GetLogicalProcessorInformationEx() usage.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a71cb210
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
35 deletions
+24
-35
process.c
dlls/kernel32/process.c
+23
-34
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+1
-1
No files found.
dlls/kernel32/process.c
View file @
171de0a7
...
...
@@ -604,24 +604,34 @@ HRESULT WINAPI RegisterApplicationRecoveryCallback(APPLICATION_RECOVERY_CALLBACK
return
S_OK
;
}
static
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
get_logical_processor_info
(
void
)
{
DWORD
size
=
0
;
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
info
;
GetLogicalProcessorInformationEx
(
RelationGroup
,
NULL
,
&
size
);
if
(
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
return
NULL
;
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
NULL
;
if
(
!
GetLogicalProcessorInformationEx
(
RelationGroup
,
info
,
&
size
))
{
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
NULL
;
}
return
info
;
}
/***********************************************************************
* GetActiveProcessorGroupCount (KERNEL32.@)
*/
WORD
WINAPI
GetActiveProcessorGroupCount
(
void
)
{
WORD
groups
;
DWORD
size
=
0
;
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
info
;
TRACE
(
"()
\n
"
);
if
(
!
GetLogicalProcessorInformationEx
(
RelationGroup
,
NULL
,
&
size
))
return
0
;
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
0
;
if
(
!
GetLogicalProcessorInformationEx
(
RelationGroup
,
info
,
&
size
))
{
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
0
;
}
if
(
!
(
info
=
get_logical_processor_info
()))
return
0
;
groups
=
info
->
Group
.
ActiveGroupCount
;
...
...
@@ -635,18 +645,11 @@ WORD WINAPI GetActiveProcessorGroupCount(void)
DWORD
WINAPI
GetActiveProcessorCount
(
WORD
group
)
{
DWORD
cpus
=
0
;
DWORD
size
=
0
;
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
info
;
TRACE
(
"(0x%x)
\n
"
,
group
);
if
(
!
GetLogicalProcessorInformationEx
(
RelationGroup
,
NULL
,
&
size
))
return
0
;
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
0
;
if
(
!
GetLogicalProcessorInformationEx
(
RelationGroup
,
info
,
&
size
))
{
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
0
;
}
if
(
!
(
info
=
get_logical_processor_info
()))
return
0
;
if
(
group
==
ALL_PROCESSOR_GROUPS
)
{
...
...
@@ -669,27 +672,20 @@ DWORD WINAPI GetActiveProcessorCount(WORD group)
DWORD
WINAPI
GetMaximumProcessorCount
(
WORD
group
)
{
DWORD
cpus
=
0
;
DWORD
size
=
0
;
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
info
;
TRACE
(
"(0x%x)
\n
"
,
group
);
if
(
!
GetLogicalProcessorInformationEx
(
RelationGroup
,
NULL
,
&
size
))
return
0
;
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
0
;
if
(
!
GetLogicalProcessorInformationEx
(
RelationGroup
,
info
,
&
size
))
{
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
0
;
}
if
(
!
(
info
=
get_logical_processor_info
()))
return
0
;
if
(
group
==
ALL_PROCESSOR_GROUPS
)
{
for
(
group
=
0
;
group
<
info
->
Group
.
Active
GroupCount
;
group
++
)
for
(
group
=
0
;
group
<
info
->
Group
.
Maximum
GroupCount
;
group
++
)
cpus
+=
info
->
Group
.
GroupInfo
[
group
].
MaximumProcessorCount
;
}
else
{
if
(
group
<
info
->
Group
.
Active
GroupCount
)
if
(
group
<
info
->
Group
.
Maximum
GroupCount
)
cpus
=
info
->
Group
.
GroupInfo
[
group
].
MaximumProcessorCount
;
}
...
...
@@ -703,18 +699,11 @@ DWORD WINAPI GetMaximumProcessorCount(WORD group)
WORD
WINAPI
GetMaximumProcessorGroupCount
(
void
)
{
WORD
groups
;
DWORD
size
=
0
;
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
info
;
TRACE
(
"()
\n
"
);
if
(
!
GetLogicalProcessorInformationEx
(
RelationGroup
,
NULL
,
&
size
))
return
0
;
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
0
;
if
(
!
GetLogicalProcessorInformationEx
(
RelationGroup
,
info
,
&
size
))
{
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
0
;
}
if
(
!
(
info
=
get_logical_processor_info
()))
return
0
;
groups
=
info
->
Group
.
MaximumGroupCount
;
...
...
dlls/ntoskrnl.exe/tests/driver.c
View file @
171de0a7
...
...
@@ -1832,7 +1832,7 @@ static void test_affinity(void)
ok
(
!!
pKeRevertToUserAffinityThreadEx
,
"KeRevertToUserAffinityThreadEx is not available.
\n
"
);
count
=
pKeQueryActiveProcessorCountEx
(
1
);
todo_wine
ok
(
!
count
,
"Got unexpected count %u.
\n
"
,
count
);
ok
(
!
count
,
"Got unexpected count %u.
\n
"
,
count
);
cpu_count
=
pKeQueryActiveProcessorCountEx
(
0
);
ok
(
cpu_count
,
"Got unexpected cpu_count %u.
\n
"
,
cpu_count
);
...
...
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