SetThreadGroupAffinity

Sets the processor group affinity for the specified thread.

Syntax

BOOL SetThreadGroupAffinity(
         HANDLE hThread,
         CONST GROUP_AFFINITY* GroupAffinity,
         PGROUP_AFFINITY PreviousGroupAffinity
)  

Parameters

hThread
Type: HANDLE 

[in] A handle to the thread.

GroupAffinity
Type: CONST GROUP_AFFINITY* 

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

PreviousGroupAffinity
Type: PGROUP_AFFINITY 

[out] A pointer to a GROUP_AFFINITY structure to receive the thread’s previous group affinity. This parameter can be NULL.

Return value

Type: BOOL 

If the function succeeds, the return value is nonzero.

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

Requirements

Header: Declared in processtopologyapi.h.

Library: Use kernelx.lib.