The KeGetProcessorIndexFromNumber routine converts a group number and a group-relative processor number to a systemwide processor index.
ULONG KeGetProcessorIndexFromNumber( PPROCESSOR_NUMBER ProcNumber );
A pointer to a caller-allocated PROCESSOR_NUMBER structure that contains a group number and a group-relative processor number.
KeGetProcessorIndexFromNumber returns a systemwide processor index if the call is successful. If ProcNumber points to an invalid PROCESSOR_NUMBER value, the routine returns INVALID_PROCESSOR_INDEX, which is defined in the Wdm.h header file.
This routine accepts as input a PROCESSOR_NUMBER structure that identifies a processor by its group number and its processor number within the group. The return value is a processor index that identifies the processor across the entire multiprocessor system.
For example, if a multiprocessor system contains two groups, and each group contains 64 logical processors, the processor numbers in each group range from 0 to 63, but the systemwide processor indexes range from 0 to 127.
To obtain the total number of active logical processors in the system, call the KeQueryActiveProcessorCountEx routine and set this routine's GroupNumber parameter to ALL_PROCESSOR_GROUPS.
The KeGetProcessorNumberFromIndex routine converts a systemwide processor index to a group number and a group-relative processor number.
|Windows version||Available in Windows 7 and later versions of Windows.|
|Header||ntifs.h (include Wdm.h, Ntddk.h, Ntifs.h)|