Freigeben über


NdisMFreeSharedMemory (Compact 2013)

3/26/2014

This function frees memory that was previously allocated by NdisMAllocateSharedMemory.

Syntax

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

Parameters

  • Length
    [in] Specifies the number of bytes originally allocated.
  • Cached
    [in] Specifies TRUE if the original allocation was cacheable.
  • VirtualAddress
    [in] Specifies the base virtual address returned by NdisMAllocateSharedMemory.
  • PhysicalAddress
    [in] Specifies the corresponding physical address returned by NdisMAllocateSharedMemory.

Return Value

None.

Remarks

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.

Requirements

Header

ndis.h

Library

ndis.dll

See Also

Reference

NDIS Shared Memory Interface
MiniportHaltEx
MiniportInitializeEx
MiniportShutdownEx
MiniportInitialize
MiniportShutdown
NdisMAllocateSharedMemory