MiCreateUserPhysicalView

INT64 __fastcall MiCreateUserPhysicalView(INT64 a1, INT64 rdx0, INT64 a3, _WORD *a4){
  void *v5; 
  char v7; 
  unsigned int v8; 
  INT64 v9; 
  INT64 result; 
  INT64 v11; 
  __int64 v12; 
  __int64 v13; 
  INT64 a2; 
  a2 = 0i64;
  v5 = *(void **)(a3 + 112);
  v7 = rdx0;
  if( v5 )
  {
    v8 = (unsigned __int64)(rdx0 & 4 | 8) >> 1;
    v9 = v8 | 8;
    if( (v7 & 2) == 0 )
      v9 = v8;
    result = MiReferenceAweHandle(v5, v9);
    if( (int)result >= 0 )
      return 3221225480i64;
  }
  else if( (*(_QWORD *)(a3 + 120) & 0xA) != 0 )
  {
    return 3221225485i64;
  }
  else if( (_DWORD)rdx0 == 4 )
  {
    LOBYTE(v5) = *(_BYTE *)(a3 + 104);
    result = MiCreateProcessDefaultAweInfo((INT64)v5, &a2);
    if( (int)result >= 0 )
    {
      v11 = a2;
      LODWORD(v12) = MiAllocatePool((struct _SLIST_ENTRY *)0x40);
      v13 = v12;
      if( v12 )
      {
        *(_DWORD *)(v12 + 64) = 256;
        *(_QWORD *)(v12 + 32) = a1;
        *(_QWORD *)(v12 + 40) = v11;
        *a4 = *(_WORD *)MiGetAweInfoPartition(v11);
        *(_QWORD *)(v13 + 24) = 0i64;
        MiInsertVadEvent((_MMVAD_SHORT *)a1, (_MI_VAD_EVENT_BLOCK *)v13, 0i64);
        return 0i64;
      }
      else
      {
        return 3221225626i64;
      }
    }
  }
  else
  {
    return 3221225541i64;
  }
  return result;
}

Referenced by:

MiReserveUserMemory