NdisFreePacket

VOID
NdisFreePacket(

IN PNDIS_PACKET Packet
);

NdisFreePacket releases a packet that was allocated from packet pool with NdisAllocatePacket and returns it to the free list.

Parameters

Packet

Points to the packet descriptor returned by NdisAllocatePacket or NdisDprAllocatePacket.

Comments

Before calling NdisFreePacket, 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 and by NDIS until the system is rebooted.

The driver must release any spin lock it is holding before calling NdisFreePacket.

Callers of NdisFreePacket run at IRQL <= DISPATCH_LEVEL.

See Also

NdisAllocatePacket, NdisDprAllocatePacket, NdisFreeBuffer, NdisReleaseSpinLock, NdisUnchainBufferAtBack, NdisUnchainBufferAtFront