When a kernel-mode client makes a TDI_ACCEPT request, it asks the underlying TDI transport driver to accept an incoming connection offer from a remote-node peer and, thereby, to enable network data transfers on the endpoint-to-endpoint connection between that local-node client and its remote-node peer.
IRP
The transport calls IoGetCurrentIrpStackLocation with the given Irp to get a pointer to its own I/O stack location in the IRP, shown in the following list as IrpSp. IRP members relevant to this request include the following:
IoStatus.Status
Specifies the final status of the accept request. The transport sets this member before it completes the IRP, possibly to one of the following:
STATUS_SUCCESS
STATUS_INVALID_CONNECTION
IrpSp->MajorFunction
Specifies IRP_MJ_INTERNAL_DEVICE_CONTROL. The transport can ignore this member if it exports a TdiDispatchInternalDeviceControl routine that handles only TDI_XXX requests.
IrpSp->MinorFunction
Specifies TDI_ACCEPT.
IrpSp->FileObject
Points to an open file object representing the connection endpoint at which a listen request has completed. The transport uses the FsContext and, possibly, FsContext2 fields to access the state it maintains about this connection.
IrpSp->Parameters
Specifies a TDI_REQUEST_KERNEL_ACCEPT structure, defined as follows:
struct _TDI_REQUEST_KERNEL_ACCEPT {
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation;
} TDI_REQUEST_KERNEL_ACCEPT, *PTDI_REQUEST_KERNEL_ACCEPT;
The transport uses the members of this structure as follows:
RequestConnectionInformation
Points to a TDI_CONNECTION_INFORMATION structure, possibly containing connection information supplied by the client. This information can include a pointer (in the UserData member) to a buffer of client-supplied accept data to be sent to the remote node when the transport notifies the remote-node transport that the offered connection is accepted.
ReturnConnectionInformation
Points to a client-supplied variable of type TDI_CONNECTION_INFORMATION in which the transport returns connection information, if any, to the client. This member is NULL if the transport does not return information for delayed-connection acceptances.
Comments
In normal operation, a client submits an accept request in response to a return from a preceding listen request in which it set the TDI_QUERY_ACCEPT flag. If the client did not set this flag in its TDI_LISTEN request for this connection, the transport should fail this accept request.
The transport can call already registered ClientEvent(Chained)Receive(Expedited) handler(s) with incoming receive(s) from the remote node on this connection before the I/O Manager formally completes its processing of the client's accept IRP.
Most TDI transport drivers have a time-out feature to prevent communication sequences from hanging when a remote node is not responding. Therefore, a TDI client must either accept or reject a connection as soon as possible after completion of its listen request. As a general rule, a transport-determined time-out interval between client notification of an offered connection and the local-node client's connection acceptance or rejection should be less than one second.
TdiBuildAccept is the macro a client uses to fill in this IRP.
See Also
ClientEventChainedReceive, ClientEventChainedReceiveExpedited, ClientEventReceive, ClientEventReceiveExpedited, TdiBuildAccept, TDI_CONNECTION_INFORMATION, TdiDispatchInternalDeviceControl, TDI_LISTEN, TDI_RECEIVE