NDIS_STATUS
MiniportTransferData(
OUT PNDIS_PACKET Packet,
OUT PUINT BytesTransferred,
IN NDIS_HANDLE MiniportAdapterContext,
IN NDIS_HANDLE MiniportReceiveContext,
IN UINT ByteOffset,
IN UINT BytesToTransfer
);
MiniportTransferData is a required function in NIC drivers that do not indicate multipacket receives and/or media-specific information with NdisMIndicateReceivePacket and in those that do not support WAN media.
MiniportTransferData can return one of the the following:
MiniportTransferData copies the contents of the received packet to a given protocol-allocated packet.
NDIS calls MiniportTransferData when a ProtocolReceive function calls NdisTransferData. The media header associated with a packet cannot be copied; only the data portion of a packet can be copied. The range passed to NdisTransferData never includes the media header. Usually, the ByteOffset input to MiniportTransferData excludes data that the miniport already indicated in the lookahead buffer.
A miniport must be prepared to copy a given packet more than once. If its NIC supports reading a given packet only once, the miniport must copy each received network packet to a staging buffer.
MiniportTransferData can call NdisQueryPacket to determine how many buffer descriptors the allocating protocol has provided. The protocol is responsible for supplying a packet descriptor that accommodates the transfer it requested. MiniportTransferData can call NdisQueryBuffer to determine how much data to copy into each protocol-supplied buffer.
MiniportTransferData can fail a request if the given ByteOffset and BytesToTransfer exceed the packet size originally indicated. Alternatively, MiniportTransferData can simply transfer all available data starting at any valid ByteOffset.
Because MiniportTransferData is asynchronous, a miniport that has this function cannot deliver receive indications while a transfer is pending. If MiniportTransferData returns NDIS_STATUS_PENDING, the miniport must call NdisMTransferDataComplete when the transfer is complete.
A driver that indicates packets with NdisMIndicateReceivePacket does not need a MiniportTransferData function because such a driver always indicates full packets to bound protocols.
Interrupts are still disabled when MiniportTransferData is called.
By default, MiniportTransferData runs at IRQL DISPATCH_LEVEL.
MiniportInitialize, NdisGetFirstBufferFromPacket, NdisGetNextBuffer, NdisMArcIndicateReceive, NdisMEthIndicateReceive, NdisMFddiIndicateReceive, NdisMIndicateReceivePacket, NdisMoveMemory, NdisMTransferDataComplete, NdisMTrIndicateReceive, NdisQueryBuffer, NdisQueryPacket, NdisTransferData, ProtocolReceive