HalpAllocateCR3Root

INT64 __fastcall HalpAllocateCR3Root(INT64 a1){
  __int64 v1; 
  VOID *ContiguousNodeMemory; 
  UINT64 Protect; 
  UINT64 PreferredNode; 
  v1 = (unsigned int)a1;
  if( (unsigned int)a1 >= HalpQueryMaximumRegisteredProcessorCount(a1) )
    return 3221225485i64;
  if( *(_QWORD *)(HalpCR3Root + 8 * v1) )
    return 0i64;
  LODWORD(PreferredNode) = 0x80000000;
  LODWORD(Protect) = 4;
  ContiguousNodeMemory = MmAllocateContiguousNodeMemory(
                           0x1000ui64,
                           0i64,
                           (LARGE_INTEGER)0xFFFFFFFFi64,
                           0i64,
                           Protect,
                           PreferredNode);
  if( ContiguousNodeMemory )
  {
    *(_QWORD *)(HalpCR3Root + 8 * v1) = ContiguousNodeMemory;
    return 0i64;
  }
  return 3221225626i64;
}

Referenced by:

HalpDispatchPnp
HalpMmBuildTiledMemoryMap