MmFreeContiguousMemory - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ntddk.h

VOID MmFreeContiguousMemory(
  [in] PVOID BaseAddress
);

View the official Windows Driver Kit DDI reference
// wdm.h

VOID MmFreeContiguousMemory(
  [in] PVOID BaseAddress
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ntddk-mmfreecontiguousmemory)

MmFreeContiguousMemory function (ntddk.h)

Description

The MmFreeContiguousMemory routine releases a range of physically contiguous memory that was allocated by an MmAllocateContiguousMemoryXxx routine.

Parameters

BaseAddress [in]

Pointer to the virtual address of the memory to be freed.

Remarks

The MmFreeContiguousMemory routine frees a block of physically contiguous memory that was allocated by a previous call to the MmAllocateContiguousMemory, MmAllocateContiguousMemorySpecifyCache, or MmAllocateContiguousMemorySpecifyCacheNode routine. The BaseAddress parameter must be the base address that was obtained from the previous call to the MmAllocateContiguousMemoryXxx routine.

A device driver that must use contiguous memory should allocate only what it needs during driver initialization because physical memory is likely to become fragmented as the system runs. Such a driver must deallocate the memory when the driver is done using the memory.

Callers of MmFreeContiguousMemory must be running at IRQL = APC_LEVEL. For Windows Server 2008 and later versions of the Windows operating system, you can also call MmFreeContiguousMemory with IRQL <= DISPATCH_LEVEL. However, you can improve driver performance by calling at APC_LEVEL or below.

See also

MmAllocateContiguousMemory

MmAllocateContiguousMemorySpecifyCache

MmAllocateContiguousMemorySpecifyCacheNode


Windows Driver Kit DDI reference (nf-wdm-mmfreecontiguousmemory)

MmFreeContiguousMemory function (wdm.h)

Description

The MmFreeContiguousMemory routine releases a range of physically contiguous memory that was allocated by an MmAllocateContiguousMemoryXxx routine.

Parameters

BaseAddress [in]

Pointer to the virtual address of the memory to be freed.

Remarks

The MmFreeContiguousMemory routine frees a block of physically contiguous memory that was allocated by a previous call to the MmAllocateContiguousMemory, MmAllocateContiguousMemorySpecifyCache, or MmAllocateContiguousMemorySpecifyCacheNode routine. The BaseAddress parameter must be the base address that was obtained from the previous call to the MmAllocateContiguousMemoryXxx routine.

A device driver that must use contiguous memory should allocate only what it needs during driver initialization because physical memory is likely to become fragmented as the system runs. Such a driver must deallocate the memory when the driver is done using the memory.

Callers of MmFreeContiguousMemory must be running at IRQL = APC_LEVEL. For Windows Server 2008 and later versions of the Windows operating system, you can also call MmFreeContiguousMemory with IRQL <= DISPATCH_LEVEL. However, you can improve driver performance by calling at APC_LEVEL or below.

See also

MmAllocateContiguousMemory

MmAllocateContiguousMemorySpecifyCache

MmAllocateContiguousMemorySpecifyCacheNode