Compartir a través de


Opening a Connection Endpoint

The following figure shows how a kernel-mode client opens a connection endpoint in its underlying transport driver.

If a local-node client requires connection-oriented communication with a remote-node peer process, the local-node client must first open a transport address and then open a connection endpoint in its underlying transport. The client makes two calls to ZwCreateFile, first to open an address and, then, a connection endpoint.

When opening a connection endpoint, the client passes a client-supplied context for the connection in the EA (extended attributes) buffer parameter to ZwCreateFile. Within the EA buffer, the client sets the EaName member to the system-defined value TdiConnectionContext followed by an EA value that is usually the address of a client-allocated context area in which the client will subsequently maintain state about the endpoint-to-endpoint connection to be established.

The client's call to ZwCreateFile causes the I/O manager to create a client-process-specific file object to represent the connection endpoint and to call the TDI transport driver's TdiDispatchCreateroutine with an IRP containing the client-supplied parameters to ZwCreateFile. TdiDispatchCreate parses the EA information, and the transport sets up internal state for the open connection endpoint of this client if the call succeeds.

After its successful call to ZwCreateFile returns a file handle to the client and the client has obtained a pointer to the file object with ObReferenceObjectByHandle, it is ready to make certain TDI_XXX IOCTL requests to the underlying transport to establish an endpoint-to-endpoint connection with a remote-node peer.

First, the client must associate the connection endpoint with its open transport address by submitting a TDI_ASSOCIATE_ADDRESSrequest, set up with TdiBuildAssociateAddress, to its underlying transport.

For more information about setting up TDI_XXX IOCTL IRPs, see Packaging and Submitting IOCTL Requests, next. For more information about how to establish an endpoint-to-endpoint connection, see Making an Endpoint-to-Endpoint Connection.

When the endpoint-to-endpoint connection has been disconnected and the client no longer will use any connection-oriented communications, the client must close the connection endpoint by passing the file handle that was returned by ZwCreateFile to ZwClose, as described later in Closing a Connection Endpoint.

Note   The TDI feature is deprecated and will be removed in future versions of Microsoft Windows. Depending on how you use TDI, use either the Winsock Kernel (WSK) or Windows Filtering Platform (WFP). For more information about WFP and WSK, see Windows Filtering Platform and Winsock Kernel. For a Windows Core Networking blog entry about WSK and TDI, see Introduction to Winsock Kernel (WSK).

 

 

 

Send comments about this topic to Microsoft