NdisDprFreePacketNonInterlocked (Windows Embedded CE 6.0)
1/6/2010
NdisDprFreePacketNonInterlocked releases a driver-allocated packet descriptor and returns it to the free list when the caller provides internal synchronization for accessing packet pool. Because Windows Embedded CE does not support DPC IRQL, all NdisDprXXX functions perform identically to the non-DPR equivalent.
Syntax
VOID NdisDprFreePacketNonInterlocked(
PNDIS_PACKET Packet
);
Parameters
- Packet
[in] Pointer to a packet descriptor returned by NdisDprAllocatePacketNonInterlocked.
Return Value
None.
Remarks
Before calling NdisDprFreePacketNonInterlocked, the driver either must call NdisFreeBuffer as many times as necessary to release all buffer descriptors chained to the packet, or it must call an NdisUnchainBufferAtXxx function as many times as necessary to save all pointers to buffer descriptors. Otherwise, memory associated with buffer descriptors in the chain remains unusable by the driver
A driver that calls NdisDprFreePacketNonInterlocked (and its reciprocal NdisDprAllocatePacketNonInterlocked) is responsible for synchronizing all accesses to the packet pool that driver allocated with NdisAllocatePacketPool. Usually, such a driver protects its packet pool with a driver-allocated spin lock. First, the driver calls NdisAcquireSpinLock. When the driver resumes execution with a locked packet pool, it calls NdisDprFreePacketNonInterlocked. Finally, the driver releases its spin lock with NdisReleaseSpinLock when NdisDprFreePacketNonInterlocked returns control.
A driver that does not manage this synchronization should let NDIS manage this synchronization on its behalf by calling NdisAllocate/FreePacket or NdisDprAllocate/FreePacket.
Requirements
Header | ndis.h |
Library | ndis.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
See Also
Reference
NDIS Library Functions
MiniportDisableInterrupt
MiniportISR
MiniportSynchronizeISR
NdisAcquireSpinLock
NdisAllocatePacket
NdisAllocatePacketPool
NdisAllocateSpinLock
NdisDprAllocatePacket
NdisDprFreePacket
NdisDprAllocatePacketNonInterlocked
NdisDprReleaseSpinLock
NdisFreeBuffer
NdisFreePacket
NdisMSynchronizeWithInterrupt
NdisReleaseSpinLock