Microsoft Windows CE 3.0  

MiniportReturnPacket

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

MiniportReturnPacketis a required function in drivers that indicate receives with NdisMIndicateReceivePacket.

VOID
MiniportReturnPacket(
IN NDIS_HANDLE
MiniportAdapterContext
,
IN PNDIS_PACKET
Packet
);

Parameters

MiniportAdapterContext
Specifies the handle to a miniport-allocated context area in which the driver maintains per-network adapter state, set up by MiniportInitialize.
Packet
Points to a packet descriptor being returned to the miniport, which previously indicated a packet array that contained this pointer.

Comments

Drivers of busmaster DMA network adapters that support multipacket receives and network adapter drivers that supply media-specific information, such as packet priorities, with their indications must have MiniportReturnPacketfunctions. NDIS intermediate drivers that bind themselves to such a network adapter driver also must have MiniportReturnPacketfunctions.

Any packet with associated NDIS_PACKET_OOB_DATA in which the Statusis set to NDIS_STATUS_PENDING on return from NdisMIndicateReceivePacketwill be returned to MiniportReturnPacket. When all bound protocols have called NdisReturnPacketsas many times as necessary to release their references to the originally indicated packet array, NDIS returns pended packets from the array to the MiniportReturnPacketfunction of the driver that originally allocated the packet array.

Usually, MiniportReturnPacketprepares such a returned packet to be used in a subsequent receive indication. Although MiniportReturnPacketcould return the buffer descriptors chained to the packet to buffer pool and the packet descriptor itself to packet pool, it is far more efficient to reuse returned descriptors.

MiniportReturnPacketmust call NdisUnchainBufferAt XXXas many times as necessary to save the pointers to all chained buffer descriptors before it calls NdisReinitializePacket. Otherwise, MiniportReturnPacketcannot recover the buffer descriptors the driver originally chained to the packet for the indication.

MiniportReturnPacketalso can call NdisZeroMemorywith the pointer returned by NDIS_OOB_DATA_FROM_PACKET to prepare the packet's associated out-of-band block for reuse.

If a particular buffer descriptor was shortened to match the size of an indicated range of data, MiniportReturnPacketshould call NdisAdjustBufferLengthwith that buffer descriptor to restore its mapping of the network adapter's receive buffer range.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h   Ndislib.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

MiniportInitialize, NdisAdjustBufferLength, NdisMIndicateReceivePacket, NdisReinitializePacket, NdisReturnPackets, NdisZeroMemory