TdiCopyLookaheadData

VOID
TdiCopyLookaheadData(
IN PVOID Destination,
IN PVOID Source,
IN ULONG Length,
IN ULONG ReceiveFlags
);

TdiCopyLookaheadData safely copies receive data indicated in a lookahead buffer to the transport protocol by the underlying NDIS driver.

Parameters

Destination

Points to a caller-supplied buffer into which to copy the data.

Source

Points to the source buffer from which to copy the data.

Length

Specifies how many bytes of data to copy.

ReceiveFlags

Specifies a combination (ORed) of TDI_RECEIVE_XXX flags of which only the following is pertinent to this call:

TDI_RECEIVE_COPY_LOOKAHEAD

Must be set if the underlying NIC driver set the NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA flag in response to the protocol's binding-time call to NdisRequest with the OID_GEN_MAC_OPTIONS query. Otherwise, this flag must be clear in the given ReceiveFlags.

Comments

TdiCopyLookaheadData can be called by a transport's ProtocolReceive function to copy receive data from a lookahead buffer that was indicated up by the underlying NIC driver. In particular, TdiCopyLookaheadData must be called if the underlying NIC driver did not set the NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA flag in response to the transport's OID_GEN_MAC_OPTIONS query. For more information about this OID request, see Part 1, Chapter 5.

However, TdiCopyLookaheadData can be called by any NDIS driver's ProtocolReceive function, whatever the nature of the receive buffers on the underlying NIC.

Any driver that exports a ProtocolReceive function can call TdiCopyLookaheadData.

Callers of TdiCopyLookaheadData can be running at any IRQL if the buffer at Destination was allocated from nonpaged pool. Otherwise, a caller must be running at IRQL < DISPATCH_LEVEL.

See Also

NdisRequest, ProtocolReceive