Microsoft Windows CE 3.0  

NdisTransferData

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.

This function forwards a request to copy data received on the underlying NIC into a protocol-supplied packet.

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
);

Parameters

Status
Pointer to a caller-supplied variable that can be one of the following values on return from this function:
Value Description
NDIS_STATUS_SUCCESS The requested data has been transferred into the packet at Packet.
NDIS_STATUS_PENDING The request is being handled asynchronously, and the caller's ProtocolTransferCompletefunction will be called when it is completed.
NDIS_STATUS_RESET_IN_PROGRESS The underlying driver is currently resetting its NIC or virtual NIC state. The caller's ProtocolStatusfunction was or will be called with NDIS_STATUS_RESET_START to indicate that a reset is in progress.
NDIS_STATUS_REQUEST_ABORTED The caller's binding is being closed.
NDIS_STATUS_FAILURE The given ByteOffsetand/or the given BytesToTransferis too large.
NdisBindingHandle
Handle returned by the NdisOpenAdapterfunction that identifies the target NIC or the virtual adapter of the next-lower driver to which the caller is bound.
MacReceiveContext
Specifies the underlying driver's handle that was passed as an input parameter to the caller's ProtocolReceivefunction. The protocol driver must consider this handle to be opaque.
ByteOffset
Specifies the offset from the start of the receive network packet at which to begin the transfer.
BytesToTransfer
Specifies the number of bytes to transfer. This value can be 0.
Packet
Pointer to the packet descriptor, provided by the caller, into which the underlying NIC driver is to copy the data.
BytesTransferred
Pointer to a caller-supplied variable in which this function returns the number of bytes actually transferred. The value is invalid if this function returns NDIS_STATUS_PENDING at Status.

Remarks

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 ProtocolReceivefunction determines whether to make itself a copy of the indicated packet with this function.

Before calling this function, the protocol must allocate a packet descriptor and chain some number of buffer descriptors mapping protocol-allocated buffers into which the underlying driver copies the data. The protocol also might set up the ProtocolReservedpart of its packet descriptor before calling this function.

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 this function, specified by ByteOffsetand BytesToTransfer, should be suitable to the PacketSizepassed in to the caller's ProtocolReceivefunction. Callers of this function usually pass a ByteOffsetvalue calculated from the input parameters to ProtocolReceiveas ( LookaheadBufferRange+ 1). That is, ProtocolReceivealready consumed the data in the look-ahead buffer, so it calls this function to get the remaining data in the indicated receive packet.

A driver that calls this function runs at IRQL <= DISPATCH_LEVEL.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h    
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

NdisMIndicateReceivePacket



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.