VOID
NdisTransferData(
OUT PNDIS_STATUS Status,
IN NDIS_HANDLE NdisBindingHandle,
IN NDIS_HANDLE MacReceiveContext,
IN UINT ByteOffset,
IN UINT BytesToTransfer,
IN OUT PNDIS_PACKET Packet,
OUT PUINT BytesTransferred
);
NdisTransferData forwards a request to copy data received on the underlying NIC into a protocol-supplied packet.
Several protocols can be bound to a single underlying NIC, and each such protocol driver can receive an indication for the same packet. Such a packet is read-only to protocol drivers. Each such driver’s ProtocolReceive function determines whether to make itself a copy of the indicated packet with NdisTransferData.
Before calling NdisTransferData, the protocol must allocate a packet descriptor and chain some number of buffer descriptors mapping protocol-allocated buffers into which the underlying driver will copy the data. The protocol also might set up the ProtocolReserved part of its packet descriptor before calling NdisTransferData.
A protocol driver should always allocate its packet descriptors from the packet pool that the driver set up during initialization.
The range requested in a call to NdisTransferData, specified by ByteOffset and BytesToTransfer, should be suitable to the PacketSize passed in to the caller’s ProtocolReceive function. Callers of NdisTransferData usually pass a ByteOffset value calculated from the input parameters to ProtocolReceive as (LookaheadBufferRange + 1). That is, the ProtocolReceive function already consumed the data in the lookahead buffer so it calls NdisTransferData to get the remaining data in the indicated receive packet.
Callers of NdisTransferData run at IRQL <= DISPATCH_LEVEL.
NdisAllocatePacket, NdisMIndicateReceivePacket, NDIS_PACKET, ProtocolReceive, ProtocolReceivePacket, ProtocolTransferDataComplete