TDI_CONNECT

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.

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 connection request. The transport sets this member before it completes the IRP, possibly to one of the following:

STATUS_SUCCESS
STATUS_PENDING
STATUS_BAD_NETWORK_PATH
STATUS_INVALID_CONNECTION
STATUS_REMOTE_NOT_LISTENING
STATUS_INSUFFICIENT_RESOURCES
STATUS_REQUEST_TIMED_OUT

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_CONNECT.
IrpSp->FileObject
Points 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.
IrpSp->Parameters
Points 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.

IrpSp->Parameters.RequestSpecific
Points 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.

Comments

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.

TdiBuildConnect is the macro a client uses to fill in the IRP.

See Also

ClientEventConnect, TdiBuildConnect, TDI_CONNECTION_INFORMATION, TdiDispatchInternalDeviceControl, TDI_LISTEN, TDI_REQUEST_KERNEL