MiMapParametersInitialize

INT64 __fastcall MiMapParametersInitialize(
        INT64 result,
        INT64 a2,
        INT64 a3,
        INT64 a4,
        INT64 a5,
        INT64 a6,
        INT64 a7,
        INT64 a8){
  _CONTROL_AREA *v11; 
  unsigned int v12; 
  unsigned int v13; 
  int v15; 
  v11 = MiSectionControlArea((_SECTION *)a2);
  memset(result, 0i64);
  *(_QWORD *)(result + 96) = *((_QWORD *)KeGetCurrentThread() + 23);
  *(_QWORD *)(result + 88) = a3;
  v12 = (unsigned __int16)KeNumberNodes;
  v13 = a6 & 0x7F;
  *(_BYTE *)(result + 104) = *((_BYTE *)KeGetCurrentThread() + 562);
  *(_DWORD *)(result + 52) = v13;
  if( v13 > v12 )
    return 3221225485i64;
  *(_DWORD *)(result + 40) = a6 & 0xFFFFFF80;
  *(_DWORD *)(result + 44) = a7;
  if( a4 )
    *(_DWORD *)(result + 72) |= 1u;
  *(_QWORD *)(result + 24) = a5;
  if( (*((_DWORD *)v11 + 14) & 0x20) == 0 && (*(_DWORD *)(result + 72) & 1) != 0 )
    a8 = 0i64;
  *(_QWORD *)(result + 8) = MiGetUserReservationHighestAddress(a3, a8);
  *(_QWORD *)(result + 16) = 0x10000i64;
  if( (*((_DWORD *)v11 + 14) & 0x420) == 0 )
  {
    if( (v15 & 0x20000000) != 0 )
    {
      *(_QWORD *)(result + 16) = 0x200000i64;
    }
    else if( (v15 & 0x40000000) != 0 )
    {
      *(_QWORD *)(result + 16) = 4096i64;
    }
  }
  return 0i64;
}

Referenced by:

MiMapViewOfSectionExCommon
MmMapSecureViewOfSection
MmMapViewOfSection
NtMapViewOfSection