Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
93fa2e0a
Commit
93fa2e0a
authored
Aug 05, 2020
by
Daniel Lehman
Committed by
Alexandre Julliard
Aug 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Handle 32 cores.
Signed-off-by:
Daniel Lehman
<
dlehman25@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f7895ef2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
info.c
dlls/ntdll/tests/info.c
+15
-9
No files found.
dlls/ntdll/tests/info.c
View file @
93fa2e0a
...
...
@@ -51,6 +51,12 @@ static BOOL is_wow64;
*/
static
DWORD
one_before_last_pid
=
0
;
static
inline
DWORD_PTR
get_affinity_mask
(
DWORD
num_cpus
)
{
if
(
num_cpus
>=
sizeof
(
DWORD_PTR
)
*
8
)
return
~
(
DWORD_PTR
)
0
;
return
((
DWORD_PTR
)
1
<<
num_cpus
)
-
1
;
}
#define NTDLL_GET_PROC(func) do { \
p ## func = (void*)GetProcAddress(hntdll, #func); \
if(!p ## func) { \
...
...
@@ -2251,8 +2257,8 @@ static void test_affinity(void)
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
proc_affinity
=
pbi
.
AffinityMask
;
ok
(
proc_affinity
==
(
1
<<
si
.
dwNumberOfProcessors
)
-
1
,
"Unexpected process affinity
\n
"
);
proc_affinity
=
1
<<
si
.
dwNumberOfProcessors
;
ok
(
proc_affinity
==
get_affinity_mask
(
si
.
dwNumberOfProcessors
)
,
"Unexpected process affinity
\n
"
);
proc_affinity
=
(
DWORD_PTR
)
1
<<
si
.
dwNumberOfProcessors
;
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessAffinityMask
,
&
proc_affinity
,
sizeof
(
proc_affinity
)
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got %08x
\n
"
,
status
);
...
...
@@ -2264,8 +2270,8 @@ static void test_affinity(void)
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
tbi
.
AffinityMask
==
(
1
<<
si
.
dwNumberOfProcessors
)
-
1
,
"Unexpected thread affinity
\n
"
);
thread_affinity
=
1
<<
si
.
dwNumberOfProcessors
;
ok
(
tbi
.
AffinityMask
==
get_affinity_mask
(
si
.
dwNumberOfProcessors
)
,
"Unexpected thread affinity
\n
"
);
thread_affinity
=
(
DWORD_PTR
)
1
<<
si
.
dwNumberOfProcessors
;
status
=
pNtSetInformationThread
(
GetCurrentThread
(),
ThreadAffinityMask
,
&
thread_affinity
,
sizeof
(
thread_affinity
)
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got %08x
\n
"
,
status
);
...
...
@@ -2319,7 +2325,7 @@ static void test_affinity(void)
{
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
tbi
.
AffinityMask
==
(
1
<<
si
.
dwNumberOfProcessors
)
-
1
,
"unexpected affinity %#lx
\n
"
,
tbi
.
AffinityMask
);
ok
(
tbi
.
AffinityMask
==
get_affinity_mask
(
si
.
dwNumberOfProcessors
)
,
"unexpected affinity %#lx
\n
"
,
tbi
.
AffinityMask
);
}
else
skip
(
"Cannot test thread affinity mask for 'all processors' flag
\n
"
);
...
...
@@ -2341,13 +2347,13 @@ static void test_affinity(void)
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got %08x
\n
"
,
status
);
proc_affinity
=
(
1
<<
si
.
dwNumberOfProcessors
)
-
1
;
proc_affinity
=
get_affinity_mask
(
si
.
dwNumberOfProcessors
)
;
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessAffinityMask
,
&
proc_affinity
,
sizeof
(
proc_affinity
)
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
/* Resetting the process affinity also resets the thread affinity */
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
tbi
.
AffinityMask
==
(
1
<<
si
.
dwNumberOfProcessors
)
-
1
,
ok
(
tbi
.
AffinityMask
==
get_affinity_mask
(
si
.
dwNumberOfProcessors
)
,
"Unexpected thread affinity
\n
"
);
}
...
...
@@ -2445,13 +2451,13 @@ static void test_NtGetCurrentProcessorNumber(void)
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%x (expected STATUS_SUCCESS)
\n
"
,
status
);
/* allow the test to run on all processors */
new_mask
=
(
1
<<
si
.
dwNumberOfProcessors
)
-
1
;
new_mask
=
get_affinity_mask
(
si
.
dwNumberOfProcessors
)
;
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessAffinityMask
,
&
new_mask
,
sizeof
(
new_mask
));
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%x (expected STATUS_SUCCESS)
\n
"
,
status
);
for
(
i
=
0
;
i
<
si
.
dwNumberOfProcessors
;
i
++
)
{
new_mask
=
1
<<
i
;
new_mask
=
(
DWORD_PTR
)
1
<<
i
;
status
=
pNtSetInformationThread
(
GetCurrentThread
(),
ThreadAffinityMask
,
&
new_mask
,
sizeof
(
new_mask
));
ok
(
status
==
STATUS_SUCCESS
,
"%d: got 0x%x (expected STATUS_SUCCESS)
\n
"
,
i
,
status
);
...
...
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