KeSetSystemAffinityThread - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

VOID KeSetSystemAffinityThread(
  [in] KAFFINITY Affinity
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-kesetsystemaffinitythread)

KeSetSystemAffinityThread function

Description

The KeSetSystemAffinityThread routine sets the system affinity of the current thread.

Parameters

Affinity [in]

A KAFFINITY-typed variable that specifies the new system affinity of the current thread.

Remarks

The implementation of KeSetSystemAffinityThread in Windows 7 and later versions of Windows provides compatibility for drivers that were written for earlier versions of Windows, which do not support processor groups. In this implementation, KeSetSystemAffinityThread assigns the thread to group 0, and uses the affinity mask to specify a set of logical processors in this group on which the thread can run.

If KeSetSystemAffinityThread is called at IRQL <= APC_LEVEL and the call is successful, the new affinity mask takes effect immediately. When the call returns, the calling thread is already running on a processor that is specified in the new affinity mask. If KeSetSystemAffinityThread is called at IRQL = DISPATCH_LEVEL and the call is successful, the pending processor change is deferred until the caller lowers the IRQL below DISPATCH_LEVEL.

See also

KAFFINITY

KeSetSystemAffinityThreadEx