MiCreateSlabAllocationsFromLoaderBlock

INT64 __fastcall MiCreateSlabAllocationsFromLoaderBlock(INT64 a1){
  int BootSlabEntries; 
  __int64 **v3; 
  INT64 SlabAllocator; 
  __int64 *i; 
  int v6; 
  ULONG_PTR v7; 
  ULONG_PTR v8; 
  INT64 result[14]; 
  if( (dword_140C50AC4 & 8) != 0 )
  {
    v3 = (__int64 **)(a1 + 32);
    SlabAllocator = MiGetSlabAllocator((INT64)&MiSystemPartition, 0i64, 24);
    for( i = *v3; i != (__int64 *)v3; i = (__int64 *)*i )
    {
      v6 = *((_DWORD *)i + 4);
      if( v6 == 29 || v6 == 36 )
      {
        v7 = i[4];
        v8 = i[3];
        if( ((v8 | v7) & 0x1FF) != 0 || !v8 || !v7 || v7 + v8 < v8 || v7 + v8 - 1 > 0xFFFFFFFFFi64 )
          KeBugCheckEx(0x1Au, 0x3030310ui64, v8, v7, 0i64);
        BootSlabEntries = MiCreateBootSlabEntries(SlabAllocator, i[3], i[4], 0i64);
        if( BootSlabEntries < 0 )
          return(unsigned int)BootSlabEntries;
      }
    }
  }
  BootSlabEntries = 0;
  if( (MiFlags & 0x8000) != 0 )
  {
    memset((INT64)result, 0i64);
    result[1] = ((unsigned int)dword_140C50AC4 >> 3) & 1;
    return(unsigned int)VslpEnterIumSecureMode(2u, 219, 0i64, (INT64)result);
  }
  return(unsigned int)BootSlabEntries;
}

Referenced by:

MiInitSystem