NdisMFreeSharedMemory (Compact 2013)
This function frees memory that was previously allocated by NdisMAllocateSharedMemory.
VOID NdisMFreeSharedMemory( NDIS_HANDLE MiniportAdapterHandle, ULONG Length, BOOLEAN Cached, PVOID VirtualAddress, NDIS_PHYSICAL_ADDRESS PhysicalAddress );
[in] Specifies the handle originally input to MiniportInitialize.
[in] Specifies the number of bytes originally allocated.
[in] Specifies TRUE if the original allocation was cacheable.
[in] Specifies the base virtual address returned by NdisMAllocateSharedMemory.
[in] Specifies the corresponding physical address returned by NdisMAllocateSharedMemory.
If it has already made a successful call to NdisMAllocateSharedMemory, the miniport driver of a DMA device calls NdisMFreeSharedMemory if any of the following scenarios occur:
- Its MiniportInitializeEx function is unable to initialize the network adapter, so this function must release all existing claims on hardware resources for that network adapter before it returns control.
- The network adapter for which the miniport driver allocated the memory is being removed.
- The driver is being unloaded, whether because the system is shutting down or because the user reconfigured the network components used in the device.
A miniport driver cannot call NdisMFreeSharedMemory to free a subrange within an allocated shared memory range. The parameters that are passed to NdisMFreeSharedMemory must match exactly those that were passed to NdisMAllocateSharedMemory.
NdisMFreeSharedMemory cannot be called from a MiniportShutdownEx function.