Commit 3d7118bc authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

ntdll: Implement the ThreadAffinityMask query.

parent 5a24b42b
...@@ -1194,6 +1194,26 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, ...@@ -1194,6 +1194,26 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
} }
} }
return status; return status;
case ThreadAffinityMask:
{
const ULONG_PTR affinity_mask = ((ULONG_PTR)1 << NtCurrentTeb()->Peb->NumberOfProcessors) - 1;
ULONG_PTR affinity = 0;
SERVER_START_REQ( get_thread_info )
{
req->handle = wine_server_obj_handle( handle );
req->tid_in = 0;
if (!(status = wine_server_call( req )))
affinity = reply->affinity & affinity_mask;
}
SERVER_END_REQ;
if (status == STATUS_SUCCESS)
{
if (data) memcpy( data, &affinity, min( length, sizeof(affinity) ));
if (ret_len) *ret_len = min( length, sizeof(affinity) );
}
}
return status;
case ThreadTimes: case ThreadTimes:
{ {
KERNEL_USER_TIMES kusrt; KERNEL_USER_TIMES kusrt;
...@@ -1325,7 +1345,6 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, ...@@ -1325,7 +1345,6 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
} }
case ThreadPriority: case ThreadPriority:
case ThreadBasePriority: case ThreadBasePriority:
case ThreadAffinityMask:
case ThreadImpersonationToken: case ThreadImpersonationToken:
case ThreadEnableAlignmentFaultFixup: case ThreadEnableAlignmentFaultFixup:
case ThreadEventPair_Reusable: case ThreadEventPair_Reusable:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment