MiUnmapVad

VOID __stdcall MiUnmapVad(_MMVAD *Vad, UINT64 Flags){
  _CONTROL_AREA *ControlArea; 
  _FILE_OBJECT *v5; 
  UINT64 FsContext; 
  _EPROCESS *Process; 
  unsigned __int64 v8; 

  if( (Vad->u2.LongFlags2 & 0x2000000) != 0 )
  {
    ControlArea = Vad->Subsection->ControlArea;
    v5 = MiReferenceControlAreaFile(ControlArea);
    FsContext = (UINT64)v5->FsContext;
    MiDereferenceControlAreaFile(ControlArea, v5);
    Process = KeGetCurrentThread()->ApcState.Process;
    if( (Process->Flags & 0x4000) != 0 )
    {
      v8 = Vad->Core.StartingVpn | ((unsigned __int64)Vad->Core.StartingVpnHigh << 32);
      PfCheckDeprioritizeFile(
        Process->ImagePathHash,
        FsContext,
        (Vad->Core.EndingVpn | ((unsigned __int64)Vad->Core.EndingVpnHigh << 32)) - v8 + 1,
        v8);
    }
  }
  MiDeleteVad(Vad, Flags);
}

Referenced by:

MiCleanVad
MiMapViewOfDataSection
MiMapViewOfImageSection
MiUnmapViewOfSection