MiUnmapImageInSystemSpace

VOID __fastcall MiUnmapImageInSystemSpace(INT64 a1){
  VOID *v1; 
  INT64 v3; 
  v1 = *(VOID **)a1;
  if( *(_QWORD *)a1 <= 0x7FFFFFFEFFFFui64 )
  {
    MiUnmapViewOfSection(*((_QWORD *)KeGetCurrentThread() + 23), (unsigned __int64)v1, 0, 0);
    KiUnstackDetachProcess((KAPC_STATE *)(a1 + 32), 0i64);
  }
  else
  {
    MiRemoveFromSystemSpace(&Session, v1, 1ui64);
  }
  v3 = *(_QWORD *)(a1 + 8);
  if( v3 )
    MiReturnCrossPartitionControlAreaCharges(v3);
}

Referenced by:

MiCreateSessionDriverProtos
MiGetSystemAddressForImage
MiOpenHotPatchFile
MiParseComAndCetHeaders
MiPerformImageHotPatch
MiRelocateImage
MiSetPagesModified
MiValidateSectionCreate