NdisFreeMemory releases a block of memory previously allocated with NdisAllocateMemory or NdisAllocateMemoryWithTag.
VOID
NdisFreeMemory(
IN PVOID VirtualAddress,
IN UINT Length,
IN UINT MemoryFlags
);
| Value | Meaning |
|---|---|
| zero | Nonpaged system-space memory |
| NDIS_MEMORY_CONTIGUOUS | Physically contiguous memory |
| NDIS_MEMORY_NONCACHED | Noncached memory |
This value must be zero if the memory was allocated with NdisAllocateMemoryWithTag. This value must be identical to the MemoryFlags that was passed to NdisAllocateMemory.
Declared in Ndis.h. Include Ndis.h.
The parameters passed to NdisFreeMemory must be identical to those passed to NdisAllocateMemory when the block of memory was allocated. That is, a caller of NdisFreeMemory cannot release a subrange of the block that was allocated.
Because noncached memory and contiguous memory are seldom released until the allocating NIC driver is unloading, a caller of NdisFreeMemory usually is running at IRQL = PASSIVE_LEVEL for these types of deallocations. In any case: