TDI_RECEIVE

Operation

TDI_RECEIVE is a request message a client issues to indicate a receive request for a normal or an expedited TSDU on a specified connection endpoint.

Note TdiBuildReceive is the macro a client uses to fill in the IRP.

The internal driver receive function receives normal data until the receive buffer is full or it receives an end-of-record indication. However, if the function is receiving normal data and expedited data arrives at the TDI driver, the arrival preempts the normal receive operation. The driver receive function returns immediately with any normal data it has received. Then, the client must make as many receive requests as necessary to receive all the expedited data. When the client has received all this data, its next receive request expects normal data.

Note If a client has registered a ClientEventReceive function for events associated with the connection endpoint, a receive request suppresses receive events. Suppression continues until the internal driver receive function returns.

Along with the request message, the TDI client must provide input and output buffers for the IRP, as well as a status block structure the driver uses to write information about the request. These items are described below. For more information about the members of the IRP related to an receive request, see TdiBuildReceive.

When preparing the IRP, the client can also specify the type of receive it wants. Receive types are:

Input Value Meaning
TDI_RECEIVE_EXPEDITED Specifies expedited data.
TDI_RECEIVE_NORMAL Specifies normal data.
TDI_RECEIVE_PARTIAL For output of a message-mode TDI driver, specifies that the received TSDU is incomplete because the driver has not received an end-of-record mark.
TDI_RECEIVE_PEEK For input for a TDI driver supporting internal buffering, specifies that the receive operation finishes when data arrives, but that the data remains in the buffer for a future receive operation.

Note On input, if the client specifies both TDI_RECEIVE_NORMAL and TDI_RECEIVE_EXPEDITED, or if it specifies neither value, the internal driver receive function will receive either type of data.

Input

None

Output

None

I/O Status Block

The driver fills in the Status member of the IRP with one of the following TDI status codes:

STATUS_INSUFFICIENT_RESOURCES
STATUS_INVALID_CONNECTION
STATUS_PENDING
STATUS_BUFFER_OVERFLOW

For more information about status codes, see Part II, Chapter 10.

The Information member of the IRP contains the number of data bytes the internal driver receive function writes for the client.

Comments

A client can also receive data on a connection by using the read function of the I/O subsystem. In this case, the major function code is IRP_MJ_READ. Because the read function has no mechanism for writing receive flags, the client cannot use a read for expedited data. Also, the read function does not allow the client to tell whether the TDI driver has received an end-of-record indication.

See Also

ClientEventReceive, TdiBuildReceive