MmUnmapLockedPages

VOID __stdcall MmUnmapLockedPages(VOID *BaseAddress, _MDL *MemoryDescriptorList){
  unsigned int v3; 
  __int64 ByteOffset; 
  __int64 v6; 
  unsigned __int64 v7; 
  unsigned __int64 v8; 
  _MMPTE *v9; 
  _KTBFLUSH_TYPE v10; 
  unsigned int v11; 

  v3 = 0;
  if( (MemoryDescriptorList->MdlFlags & 0x200) != 0 )
  {
    MiRetardMdl(MemoryDescriptorList);
    v3 = v11;
  }
  ByteOffset = MemoryDescriptorList->ByteOffset;
  v6 = ((_WORD)ByteOffset + (unsigned __int16)LODWORD(MemoryDescriptorList->StartVa)) & 0xFFF;
  v7 = (v6 + (unsigned __int64)MemoryDescriptorList->ByteCount + 4095) >> 12;
  if( (unsigned __int64)BaseAddress <= 0x7FFFFFFEFFFFi64 )
  {
    MiUnmapLockedPagesInUserSpace(
      BaseAddress,
      (_MDL *)((v6 + (unsigned __int64)MemoryDescriptorList->ByteCount + 4095) >> 12));
  }
  else
  {
    v8 = (unsigned __int64)BaseAddress - v3;
    MemoryDescriptorList->MdlFlags &= 0xFFDEu;
    v9 = (_MMPTE *)((char *)MmGetPteBase() + ((v8 >> 9) & 0x7FFFFFFFF8i64));
    if( (MemoryDescriptorList->MdlFlags & 4) != 0 )
      MemoryDescriptorList->MappedSystemVa = (char *)MemoryDescriptorList->StartVa + ByteOffset;
    if( MiMappingHasIoTracker((VOID *)v8) == 1 )
      MiZeroAndFlushPtes((VOID *)v8, v7);
    if( MmProtectFreedNonPagedPool == 1 )
      ++v7;
    if( (dword_140CFA17C & 1) != 0 )
      MiRemovePteTracker(MemoryDescriptorList, (VOID *)v8, v7);
    MiReleasePtes((_MI_SYSTEM_PTE_TYPE *)((char *)&stru_140C4DB30 + 4432), v9, (unsigned int)v7, v10);
  }
}

Referenced by:

EtwpAllocatePartitionMemory
EtwpFreePartitionMemory
ExpProfileDelete
HalAllocateCommonBufferVector
HalFlushAdapterBuffersEx
HalFreeCommonBufferThin
HalFreeCommonBufferVector
HalInitializeBios
HalPutScatterGatherList
HalPutScatterGatherListV3
HalpAllocateCommonBufferThin
HalpDmaAllocateLocalContiguousPool
HalpDmaAllocateLocalScatterPool
HalpDmaAllocateMapRegisters
HalpDmaFreeChildAdapter
HalpDmaGrowContiguousMapBuffers
HalpDmaGrowScatterMapBuffers
HalpDmaReleaseBufferMappings
IoFreeKsrPersistentMemory
IoFreeMdl
IopCleanupFileObjectIosbRange
IopCompleteRequest
IopSetFileObjectIosbRange
MiApplyImageHotPatch
MiDeleteImageCreationMdls
MiFlushComplete
MiFlushFileOnlyMdl
MiFreePagesFromMdl
MiMakeOutswappedPageResident
MiMapPageFileHash
MiPfCompleteCoalescedIo
MiSectionCreated
MiUnlockFlushMdl
MiValidateInPage
MiWaitForInPageComplete
MiWriteComplete
MiZeroPageFile
MiZeroPageFileFirstPage
MiZeroPageWrite
NtStopProfile
PipGetPersistentMemory
PsDispatchIumService
PspIumAllocatePhysicalPages
PspIumAllocateSecurePool
PspIumFreePhysicalPages
SMKM_STORE_MGR::SmCompressCtxProcessReadyQueue
SMKM_STORE_MGR::SmPageWrite
SmFpFree
SmKmUnlockMdl
SmPrepareForFatalPageError
VfFillAllocatePagesForMdl
ViFreeMapRegisterFile