NdisMFreeSharedMemory

VOID
    NdisMFreeSharedMemory(
        IN NDIS_HANDLE
 MiniportAdapterHandle,
        IN ULONG Length,
        IN BOOLEAN Cached,
        IN PVOID VirtualAddress,
        IN NDIS_PHYSICAL_ADDRESS PhysicalAddress
        );

NdisMFreeSharedMemory frees memory that was previously allocated by NdisMAllocateSharedMemory or NdisMAllocateSharedMemoryAsync by the driver of a busmaster DMA NIC.

Parameters

MiniportAdapterHandle
Specifies the handle originally input to MiniportInitialize.
Length
Specifies the number of bytes originally allocated.
Cached
Specifies TRUE if the original allocation was cacheable.
VirtualAddress
Specifies the base virtual address returned by NdisMAllocateSharedMemory(Async).
PhysicalAddress
Specifies the corresponding physical address returned by NdisMAllocateSharedMemory(Async).

Comments

If it has already made a successful call to NdisMAllocateSharedMemory or NdisMAllocateSharedMemoryAsync, the NIC driver of a busmaster DMA device calls NdisMFreeSharedMemory if any of the following occurs:

A miniport cannot call NdisMFreeSharedMemory to free a subrange within an allocated shared memory range. The parameters passed to NdisMFreeSharedMemory must match exactly those that were passed to NdisMAllocateSharedMemory or NdisMAllocateSharedMemoryAsync.

NdisMFreeSharedMemory cannot be called from a MiniportShutdown function

Callers of NdisMFreeSharedMemory run at IRQL <= DISPATCH_LEVEL.

See Also

MiniportAllocateComplete, MiniportHalt, MiniportInitialize, MiniportShutdown, NdisMAllocateSharedMemory, NdisMAllocateSharedMemoryAsync, NdisMFreeMapRegisters