The ExFreePool routine deallocates a block of pool memory.
VOID
ExFreePool(
IN PVOID P
);
None
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
This routine releases memory allocated by ExAllocatePool, ExAllocatePoolWithTag, ExAllocatePoolWithQuota, or ExAllocatePoolWithQuotaTag. The memory block must not be accessed after it is freed.
Drivers can also use the ExFreePoolWithTag routine to free buffers allocated by ExAllocatePoolWithTag and ExAllocatePoolWithQuotaTag.
Callers of ExFreePool must be running at IRQL <= DISPATCH_LEVEL. A caller at DISPATCH_LEVEL must have specified a NonPagedXxx PoolType when the memory was allocated. Otherwise, the caller must be running at IRQL < DISPATCH_LEVEL.
ExAllocatePool, ExAllocatePoolWithQuota, ExAllocatePoolWithQuotaTag, ExAllocatePoolWithTag, ExFreePoolWithTag