Export (0) Print
Expand All
Expand Minimize
0 out of 1 rated this helpful - Rate this topic

SetThreadGroupAffinity function

Sets the processor group affinity for the specified thread.

Syntax


BOOL SetThreadGroupAffinity(
  _In_       HANDLE hThread,
  _In_       const GROUP_AFFINITY *GroupAffinity,
  _Out_opt_  PGROUP_AFFINITY PreviousGroupAffinity
);

Parameters

hThread [in]

A handle to the thread.

The handle must have the THREAD_SET_INFORMATION access right. For more information, see Thread Security and Access Rights.

GroupAffinity [in]

A GROUP_AFFINITY structure that specifies the processor group affinity to be used for the specified thread.

PreviousGroupAffinity [out, optional]

A pointer to a GROUP_AFFINITY structure to receive the thread's previous group affinity. This parameter can be NULL.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, use GetLastError.

Remarks

To compile an application that uses this function, set _WIN32_WINNT >= 0x0601. For more information, see Using the Windows Headers.

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

WinBase.h on Windows 7 and Windows Server 2008 R2 (include Windows.h);
Processtopologyapi.h on Windows 8 and Windows Server 2012

Library

Kernel32.lib

DLL

Kernel32.dll

See also

GROUP_AFFINITY

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.