MiCreateColorAnchors

INT64 __fastcall MiCreateColorAnchors(INT64 a1, UINT64 a2){
  unsigned int ClosestNodeWithProcessors; 
  unsigned int i; 
  unsigned int v5; 
  unsigned int v6; 
  __int64 v7; 
  INT64 result; 
  _QWORD *v9; 
  __int64 v10; 
  struct _GROUP_AFFINITY v11; 
  struct _GROUP_AFFINITY Affinity; 
  USHORT Count; 
  Affinity = 0i64;
  ClosestNodeWithProcessors = 0;
  Count = 0;
  for( i = 0; i < (unsigned __int16)KeNumberNodes; LODWORD(a2) = ClosestNodeWithProcessors )
  {
    ClosestNodeWithProcessors = MiGetClosestNodeWithProcessors((unsigned int)a2);
    KeQueryNodeActiveAffinity(ClosestNodeWithProcessors, &Affinity, &Count);
    if( Count )
      break;
    ++i;
  }
  v5 = MiGetOptimalProcessorWriteCount(ClosestNodeWithProcessors);
  if( v6 <= v5 )
    v5 = v6;
  v7 = v5;
  LODWORD(result) = MiAllocatePool((struct _SLIST_ENTRY *)0x40);
  if( result )
  {
    if( (_DWORD)v7 )
    {
      v9 = (_QWORD *)(result + 32);
      v10 = v7;
      do
      {
        v9[1] = v9;
        *v9 = v9;
        v9 += 6;
        --v10;
      }
      while( v10 );
    }
    v11 = Affinity;
    *(_QWORD *)a1 = result;
    result = 1i64;
    *(_DWORD *)(a1 + 20) = 0;
    *(struct _GROUP_AFFINITY *)(a1 + 32) = v11;
    *(_DWORD *)(a1 + 16) = v7;
    *(_DWORD *)(a1 + 24) = ClosestNodeWithProcessors;
    *(_DWORD *)(a1 + 8) = 0;
  }
  return result;
}

Referenced by:

MiAllocateLargeZeroPages
MiFindLargePageMemory
MiInitializeMdlOneNodeBatchPages