NDIS_STATUS
NdisMAllocateSharedMemoryAsync(
IN NDIS_HANDLE MiniportAdapterHandle,
IN ULONG Length,
IN BOOLEAN Cached,
IN PVOID Context
);
NdisMAllocateSharedMemoryAsync allocates additional memory shared between a miniport and its busmaster DMA NIC, usually when the miniport is running low on available NIC receive buffers.
NdisMAllocateSharedMemoryAsync can return one of the following:
Drivers of busmaster DMA NICs call NdisMAllocateSharedMemoryAsync to dynamically allocate shared memory for transfer operations when high network traffic places excessive demands on the shared memory space that the driver allocated during initialization.
Such a NIC driver usually maintains one or more state variables to track the number of shared memory buffers available for incoming transfers. When the number of available buffers reaches a driver-determined low, the miniport calls NdisMAllocateSharedMemoryAsync to allocate more buffer space in shared memory. When the number of available buffers climbs to a driver-determined high, it calls NdisMFreeSharedMemory one or more times to release its preceding dynamic allocation(s).
Usually, such a driver retains the block of shared memory that its MiniportInitialize function allocated with NdisMAllocateSharedMemory until the NIC is removed, when its MiniportHalt function is called. This allocation is sufficient to handle an average demand for transfers through the NIC.
Any miniport that calls NdisMAllocateSharedMemoryAsync or NdisMAllocateSharedMemory must release all outstanding allocations with one or more calls to NdisMFreeSharedMemory when its NIC is removed.
Callers of NdisMAllocateSharedMemoryAsync run at IRQL <= DISPATCH_LEVEL.
MiniportAllocateComplete, MiniportHalt, MiniportInitialize, NdisAllocateBuffer, NdisMAllocateSharedMemory, NdisMFreeSharedMemory