HalAllocateCommonBufferExV2

CHAR *__fastcall HalAllocateCommonBufferExV2(
        INT64 a1,
        LARGE_INTEGER *a2,
        UINT64 a3,
        LARGE_INTEGER *a4,
        INT64 a5,
        INT64 a6){
  UINT64 v6; 
  LONGLONG QuadPart; 
  CHAR *ContiguousNodeMemory; 
  CHAR *v10; 
  UINT64 Protect; 
  UINT64 PreferredNode; 
  v6 = (unsigned int)a3;
  if( a2 )
    QuadPart = a2->QuadPart;
  else
    QuadPart = *(_QWORD *)(a1 + 136);
  LODWORD(PreferredNode) = a6;
  LODWORD(Protect) = *(_BYTE *)(a1 + 437) != 0 ? 4 : 516;
  ContiguousNodeMemory = (CHAR *)MmAllocateContiguousNodeMemory(
                                   v6,
                                   0i64,
                                   (LARGE_INTEGER)QuadPart,
                                   (LARGE_INTEGER)((-(__int64)(*(_BYTE *)(a1 + 145) != 0) & 0xFFFF0000i64) + 0x10000),
                                   Protect,
                                   PreferredNode);
  v10 = ContiguousNodeMemory;
  if( ContiguousNodeMemory )
    *a4 = MmGetPhysicalAddress(ContiguousNodeMemory);
  return v10;
}

Referenced by:

HalAllocateCommonBuffer