MiCreateColorAnchors

NTSTATUS __stdcall MiCreateColorAnchors(INT64 a1, UINT64 a2){
  unsigned int ClosestNodeWithProcessors; 
  unsigned int i; 
  __int64 v5; 
  unsigned int v6; 
  __int64 v7; 
  char *Pool; 
  _QWORD *v9; 
  __int64 v10; 
  _GROUP_AFFINITY v11; 
  _GROUP_AFFINITY Affinity; 
  USHORT Count; 

  Affinity = 0i64;
  ClosestNodeWithProcessors = 0;
  Count = 0;
  for( i = 0; i < (unsigned __int16)KeNumberNodes; LODWORD(a2) = ClosestNodeWithProcessors )
  {
    ClosestNodeWithProcessors = MiGetClosestNodeWithProcessors(a2);
    KeQueryNodeActiveAffinity(ClosestNodeWithProcessors, &Affinity, &Count);
    if( Count )
      break;
    ++i;
  }
  LODWORD(v5) = MiGetOptimalProcessorWriteCount(ClosestNodeWithProcessors);
  if( v6 <= (unsigned int)v5 )
    v5 = v6;
  v7 = (unsigned int)v5;
  Pool = (char *)MiAllocatePool(64i64, 48 * v5, 0x6C646D4Dui64);
  if( Pool )
  {
    if( (_DWORD)v7 )
    {
      v9 = Pool + 32;
      v10 = v7;
      do
      {
        v9[1] = v9;
        *v9 = v9;
        v9 += 6;
        --v10;
      }
      while( v10 );
    }
    v11 = Affinity;
    *(_QWORD *)a1 = Pool;
    LODWORD(Pool) = 1;
    *(_DWORD *)(a1 + 20) = 0;
    *(_GROUP_AFFINITY *)(a1 + 32) = v11;
    *(_DWORD *)(a1 + 16) = v7;
    *(_DWORD *)(a1 + 24) = ClosestNodeWithProcessors;
    *(_DWORD *)(a1 + 8) = 0;
  }
  return(int)Pool;
}

Referenced by:

MiAllocateLargeZeroPages
MiFindLargePageMemory
MiInitializeMdlOneNodeBatchPages