KeEnumerateNextProcessor

VOID __fastcall KeEnumerateNextProcessor(UINT64 *ProcIndex, _KAFFINITY_ENUMERATION_CONTEXT *Context){
  unsigned int Count; 
  unsigned __int64 CurrentMask; 
  unsigned __int64 v5; 

  if( Context->Affinity )
    Count = Context->Affinity->Count;
  else
    Count = Context->CurrentIndex + 1;
  CurrentMask = Context->CurrentMask;
  if( CurrentMask )
  {
LABEL_4:
    _BitScanForward64(&v5, CurrentMask);
    Context->CurrentMask = CurrentMask & ~(1i64 << v5);
    *(_DWORD *)ProcIndex = KiProcessorNumberToIndexMappingTable[64 * Context->CurrentIndex + (unsigned __int8)v5];
  }
  else
  {
    while( ++Context->CurrentIndex < Count )
    {
      CurrentMask = Context->Affinity->Bitmap[Context->CurrentIndex];
      Context->CurrentMask = CurrentMask;
      if( CurrentMask )
        goto LABEL_4;
    }
  }
}

Referenced by:

EmonAllocateResources
HalGetMessageRoutingInfo
HvlpAffinityToHvProcessorSet
IopAddLiveDumpPagesToPartialKernelDump
IopLiveDumpCorralProcessors
IopLiveDumpMarkImportantDumpData
IopLiveDumpMarkRequiredDumpData
KeFlushQueuedDpcs
KeFreezeExecution
KeIntSteerPeriodic
KeRemoveQueueDpcEx
KiConfigureSchedulingInformation
KiForceIdleUpdateSchedulerParkState
KiIntSteerLogStatus
KiIntSteerUpdateDeviceInterruptMask
KiIpiEnlightenedGuestPriorityKick
KiSendFreeze
KiSendThawExecution
KiStartProfileTarget
KiStopProfileTarget
KiSynchNumaCounterSetCallback
PnprQuiesceProcessors
PopCheckForIdleness
PopEndMirroring
PopEtIsrDpcQuery
PopInitializeHeteroProcessors
PopProcessorInformation
PopQueueTargetDpc
PpmCapturePerformanceDistribution
PpmCheckComputeHeteroResponse
PpmCheckInitProcessors
PpmCheckMakeupSkippedChecks
PpmEstimateIdleDuration
PpmEventTraceControlCallback
PpmHeteroDetectHgsCores
PpmHeteroDistributeUtility
PpmHeteroUpdateHgsConfiguration
PpmIdleCheckCoordinatedDependency
PpmIdlePrepare
PpmIdleWaitForDependentTransitions
PpmParkApplyPolicy
PpmParkCalculateCoreParkingMask
PpmParkDistributeUtility
PpmParkRegisterParking
PpmParkReportParkedCores
PpmParkReportUnparkedCores
PpmParkSteerInterrupts
PpmParkUnblockIdle
PpmPerfApplyProcessorStates
PpmPerfGetBrandedFrequency
PpmPerfResetHistoryAll
PpmPerfResizeHistoryAll
PpmUnlockProcessors
VslConnectSwInterrupt