MmFreeNonCachedMemory

VOID
    MmFreeNonCachedMemory(

        IN PVOID  BaseAddress,
        IN ULONG  NumberOfBytes
        );

MmFreeNonCachedMemory releases a range of noncached memory that was allocated with MmAllocateNonCachedMemory.

Parameters

BaseAddress
Points to the virtual address of the memory to be freed.
NumberOfBytes
Specifies the size of the range to be freed. The value must match the size passed in a preceding call to MmAllocateNonCachedMemory.

Comments

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.

See Also

MmAllocateNonCachedMemory