VOID
TdiBuildAccept (
IN PIRP Irp,
IN PDEVICE_OBJECT DevObj,
IN PFILE_OBJECT FileObj,
IN PVOID CompRoutine,
IN PVOID Contxt,
IN PTDI_CONNECTION_INFORMATION RequestConnectionInfo,
OUT PTDI_CONNECTION_INFORMATION ReturnConnectionInfo
);
TdiBuildAccept sets up an internal device control IRP for a TDI_ACCEPT request to the underlying transport in which a local-node client has already opened a connection endpoint and associated it with a local-node address and to which the client has already issued a TDI_LISTEN request.
TdiBuildAccept sets IRP_MJ_INTERNAL_DEVICE_CONTROL as the MajorFunction and TDI_ACCEPT as the MinorFunction codes in the transport's I/O stack location of the given IRP.
When a kernel-mode client issues a TDI_ACCEPT request, it asks the underlying transport to accept an incoming request to connect from a remote-node client and, thereby, to enable network data reception on an established endpoint-to-endpoint connection.
Usually, a client sends an accept request in response to a return from its preceding listen request, set up with TdiBuildListen with the TDI_QUERY_ACCEPT option selected. If a client did not set this value in the Flags for its listen request, its accept request fails because the underlying transport has already established an endpoint-to-endpoint connection when the listen request completes.
Most TDI transports have a time-out feature that prevents attempts to establish endpoint-to-endpoint connections from hanging when a remote node does not respond. Therefore, a client must either accept or reject a connection as soon as possible after completion of its listen request. The interval between client notification of a remote-node peer connection offer and that local client's connection acceptance or rejection is subject to a transport-determined time-out limit, usually something less than one second.
A client indicates its acceptances of a connection to the remote-node peer by submitting a request set up by TdiBuildAccept to the underlying transport. It indicates its rejection of a connection offer by submitting an IRP set up with TdiBuildDisconnect.
The local client's registered ClientEvent(Chained)Receive(Expedited) handler(s) can be called before the I/O Manager formally completes its processing of the accept IRP. That is, the remote-node peer can start sending data to the local client as soon as the remote node receives an acceptance of the offered connection.
ClientEventChainedReceive, ClientEventChainedReceiveExpedited, ClientEventConnect, ClientEventReceive, ClientEventReceiveExpedited, TDI_ACCEPT, TdiBuildDisconnect, TdiBuildInternalDeviceControlIrp, TdiBuildListen, TDI_CONNECTION_INFORMATION