MiInitializeBootMemoryDescriptor

VOID __stdcall MiInitializeBootMemoryDescriptor(
        _MX_ALLOCATION_DESCRIPTOR *Md,
        _MEMORY_ALLOCATION_DESCRIPTOR *MemoryDescriptor,
        UINT64 BasePage,
        UINT64 PageCount){
  UINT64 v4; 
  unsigned __int64 v5; 
  __int64 v6; 

  *(_QWORD *)Md = BasePage;
  v4 = BasePage + PageCount - 1;
  *((_QWORD *)Md + 1) = PageCount;
  *((_QWORD *)Md + 2) = v4;
  v5 = v4 & 0xFFFFFFFFFFFFFE00ui64;
  *((_QWORD *)Md + 4) = MemoryDescriptor;
  if( v5 < BasePage || v5 - BasePage < 0x200 )
    v6 = -1i64;
  else
    v6 = v5 - 512;
  *((_QWORD *)Md + 3) = v6;
}

Referenced by:

MxInitializeFreeNodeDescriptors
MxSwitchDescriptors