The MmUnmapLockedPages routine releases a mapping set up by a preceding call to MmMapLockedPages or MmMapLockedPagesSpecifyCache.
VOID
MmUnmapLockedPages(
IN PVOID BaseAddress,
IN PMDL MemoryDescriptorList
);
None
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
Callers of MmUnmapLockedPages must be running at IRQL <= DISPATCH_LEVEL if the pages were mapped to system space. Otherwise, the caller must be running at IRQL < DISPATCH_LEVEL.
Note that if the call to MmMapLockedPages or MmMapLockedPagesSpecifyCache specified user mode, the caller must be in the context of the original process before calling MmUnmapLockedPages. This is because the unmapping operation occurs in the context of the calling process, and if the context is incorrect the unmapping operation could delete the address range of a random process.