VOID
MmFreeNonCachedMemory(
IN PVOID BaseAddress,
IN ULONG NumberOfBytes
);
MmFreeNonCachedMemory releases a range of noncached memory that was allocated with MmAllocateNonCachedMemory.
This routine is the reciprocal of MmAllocateNonCachedMemory, and is usually called only when a driver is being unloaded.
A device driver that must use noncached memory should allocate only what it needs during driver initialization because nonpaged pool is likely to become fragmented as the system runs. Such a driver must deallocate the memory if it is unloaded.
Callers of MmFreeNonCachedMemory must be running at IRQL < DISPATCH_LEVEL.