When a kernel-mode client makes a TDI_CONNECT request, it asks the underlying TDI transport driver to offer a connection on a particular local-node connection endpoint to a remote-node peer.
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. The pointer to the IRP is shown in the following list as Irp. IRP members relevant to this request include the following:
Specifies the final status of the connection request. The transport sets this member before it completes the IRP, possibly to one of the following:
Specifies IRP_MJ_INTERNAL_DEVICE_CONTROL. The transport can ignore this member if it exports a TdiDispatchInternalDeviceControl routine that handles only TDI_XXX requests.
Pointer to an open file object representing the connection endpoint already associated with a local-node address. The transport uses the FsContext and, possibly, FsContext2 fields to access the state it maintains about this connection.
Pointer to a TDI_REQUEST_KERNEL_CONNECT structure, equivalent to the TDI_REQUEST_KERNEL structure.
The RequestFlags member is irrelevant for connect requests. The transport uses the client-supplied information, such as the remote-node address to which the connection should be offered, in the buffer at RequestConnectionInformation. The transport returns information to the client-supplied buffer at ReturnConnectionInformation. Each of these buffers is formatted as a TDI_CONNECTION_INFORMATION structure.
Pointer to a LARGE_INTEGER variable specifying the time-out value for the connection offer or is NULL. An explicit time out is specified as the negative of the number of 100-nanosecond units, relative to the current system time, for the time-out interval. If this member is NULL, the transport must choose an appropriate time-out interval, usually something less than one second.
For a local-node client to establish an endpoint-to-endpoint connection with a remote-node peer, it must associate an idle local connection endpoint with an open transport address before making a TDI_CONNECT request. If the specified local endpoint is active or nonexistent, the transport fails the connect request.
For a TDI_CONNECT request to succeed, the remote-node client must have an open TDI_LISTEN request or have registered its ClientEventConnect handler to receive connection offers indicated by the underlying transport on the remote node.
TdiBuildConnectis the macro a client uses to fill in the IRP.