KeQueryGroupAffinity function (wdm.h)

The KeQueryGroupAffinity routine returns an affinity mask that identifies the active logical processors in a specified group in a multiprocessor system.

Syntax

KAFFINITY KeQueryGroupAffinity(
  [in] USHORT GroupNumber
);

Parameters

[in] GroupNumber

The group number. If a multiprocessor system contains n groups, the groups are numbered from 0 to n-1. To obtain the number of active groups in the system, call the KeQueryActiveGroupCount routine.

Return value

KeQueryGroupAffinity returns a KAFFINITY value that identifies the active logical processors in the specified group. If the GroupNumber parameter value is not a valid group number, the routine returns zero.

Remarks

A related routine, KeQueryActiveProcessors, returns an affinity mask that represents a set of active processors, but this routine, unlike KeQueryGroupAffinity, does not accept a group number as an input parameter. In Windows 7 and later versions of the Windows operating system, KeQueryActiveProcessors returns an affinity mask for the active processors in group 0, which is compatible with the behavior of this routine in earlier versions of Windows that do not support groups. This behavior ensures that existing drivers that call KeQueryActiveProcessors and that use no group-oriented features will run correctly in multiprocessor systems that have two or more groups. However, drivers that use any group-oriented features in Windows 7 and later versions of the Windows operating system should call KeQueryGroupAffinity instead of KeQueryActiveProcessors.

Requirements

Requirement Value
Minimum supported client Available in Windows 7 and later versions of Windows.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL Any level

See also

KAFFINITY

KeQueryActiveProcessors