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
fda39b20
Commit
fda39b20
authored
Feb 19, 2010
by
Erich Hoover
Committed by
Alexandre Julliard
Feb 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Allow 'all processors' flag used in Vista and newer.
parent
10789142
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
info.c
dlls/ntdll/tests/info.c
+17
-0
thread.c
dlls/ntdll/thread.c
+7
-4
No files found.
dlls/ntdll/tests/info.c
View file @
fda39b20
...
...
@@ -927,11 +927,28 @@ static void test_affinity(void)
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
ok
(
tbi
.
AffinityMask
==
1
,
"Unexpected thread affinity
\n
"
);
/* NOTE: Pre-Vista does not recognize the "all processors" flag (all bits set) */
thread_affinity
=
~
0UL
;
status
=
pNtSetInformationThread
(
GetCurrentThread
(),
ThreadAffinityMask
,
&
thread_affinity
,
sizeof
(
thread_affinity
)
);
ok
(
broken
(
status
==
STATUS_INVALID_PARAMETER
)
||
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
if
(
si
.
dwNumberOfProcessors
<=
1
)
{
skip
(
"only one processor, skipping affinity testing
\n
"
);
return
;
}
/* Test thread affinity mask resulting from "all processors" flag */
if
(
status
==
STATUS_SUCCESS
)
{
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
ok
(
broken
(
tbi
.
AffinityMask
==
1
)
||
tbi
.
AffinityMask
==
(
1
<<
si
.
dwNumberOfProcessors
)
-
1
,
"Unexpected thread affinity
\n
"
);
}
else
skip
(
"Cannot test thread affinity mask for 'all processors' flag
\n
"
);
proc_affinity
=
2
;
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessAffinityMask
,
&
proc_affinity
,
sizeof
(
proc_affinity
)
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
...
...
dlls/ntdll/thread.c
View file @
fda39b20
...
...
@@ -1134,14 +1134,17 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
case
ThreadAffinityMask
:
{
const
ULONG_PTR
affinity_mask
=
((
ULONG_PTR
)
1
<<
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
)
-
1
;
const
ULONG_PTR
*
paff
=
data
;
ULONG_PTR
req_aff
;
if
(
length
!=
sizeof
(
ULONG_PTR
))
return
STATUS_INVALID_PARAMETER
;
if
(
*
paff
&
~
affinity_mask
)
return
STATUS_INVALID_PARAMETER
;
if
(
!*
paff
)
return
STATUS_INVALID_PARAMETER
;
req_aff
=
*
(
const
ULONG_PTR
*
)
data
;
if
(
req_aff
==
~
0UL
)
req_aff
=
affinity_mask
;
else
if
(
req_aff
&
~
affinity_mask
)
return
STATUS_INVALID_PARAMETER
;
else
if
(
!
req_aff
)
return
STATUS_INVALID_PARAMETER
;
SERVER_START_REQ
(
set_thread_info
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
affinity
=
*
p
aff
;
req
->
affinity
=
req_
aff
;
req
->
mask
=
SET_THREAD_INFO_AFFINITY
;
status
=
wine_server_call
(
req
);
}
...
...
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