Поделиться через


TdiBuildConnect macro

TdiBuildConnect sets up an internal device control IRP for a TDI_CONNECT request to the underlying transport in which a local-node client has already associated an address and a connection endpoint.

Syntax

VOID TdiBuildConnect(
  [in]  PIRP                        Irp,
  [in]  PDEVICE_OBJECT              DevObj,
  [in]  PFILE_OBJECT                FileObj,
  [in]  PVOID                       CompRoutine,
  [in]  PVOID                       Contxt,
  [in]  PLARGE_INTEGER              Time,
  [in]  PTDI_CONNECTION_INFORMATION RequestConnectionInfo,
  [out] PTDI_CONNECTION_INFORMATION ReturnConnectionInfo
);

Parameters

  • Irp [in]
    Pointer to a client-supplied IRP, either originating in a higher level network component or allocated with TdiBuildInternalDeviceControlIrp.

  • DevObj [in]
    Pointer to the device object created by the underlying TDI transport driver.

  • FileObj [in]
    Pointer to a file object representing the connection endpoint.

  • CompRoutine [in]
    Specifies the entry point of a client-supplied IoCompletion routine or NULL. The I/O manager calls this routine when the given IRP is completed, unless the client sets this parameter to NULL.

  • Contxt [in]
    Pointer to a client-determined context. This client-supplied pointer is passed in to the IoCompletion routine when it is called with the completed IRP. Contxt is NULL if CompRoutine is NULL.

  • Time [in]
    Pointer to a variable specifying a system-relative time-out interval that the transport is to use for the connection attempt, or this parameter can be NULL.

    An explicit time-out must be specified as the negative of the number of 100-nanosecond intervals, relative to the current system time, that its connection attempt is allowed to remain pending before the transport fails this connect request. If this pointer is NULL, the transport uses its own default time-out interval for establishing a connection with any remote node.

  • RequestConnectionInfo [in]
    Pointer to a caller-supplied buffer containing a TDI_CONNECTION_INFORMATION structure that specifies the remote-node client address to which the local-node client is requesting an endpoint-to-endpoint connection.

  • ReturnConnectionInfo [out]
    Pointer to a caller-supplied buffer in which the transport returns the remote-node client address with which it has established a connection. This buffer is also formatted as TDI_CONNECTION_INFORMATION structure. If a local-node client requires no output information or if the underlying transport does not return such information, this parameter should be NULL.

Return value

None

Remarks

TdiBuildConnect sets IRP_MJ_INTERNAL_DEVICE_CONTROL as the MajorFunction and TDI_CONNECT as the MinorFunction codes in the transport's I/O stack location of the given IRP.

If the specified endpoint is inactive or nonexistent, the transport fails the connect request. If the specified endpoint has not been associated with a local-node address, the transport also fails the connect request.

For a local-node client to establish an endpoint-to-endpoint connection with a remote-node peer process, it must first associate an idle local connection endpoint with a local-node address. A client cannot initiate a connection attempt to a remote-node peer until it has made a successful TDI_ASSOCIATE_ADDRESS request, which it set up with TdiBuildAsociateAddress, to its underlying transport.

For a local-node client's connect request to succeed, the remote-node client must have an open listen request or a registered ClientEventConnect routine that can receive notification from its underlying transport of connection offers.

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).

 

Requirements

Target platform

Desktop

Header

Tdikrnl.h (include TdiKrnl.h)

See also

ClientEventConnect

TdiBuildAssociateAddress

TdiBuildInternalDeviceControlIrp

TdiBuildListen

TdiBuildSetEventHandler

TDI_CONNECT

TDI_CONNECTION_INFORMATION

 

 

Send comments about this topic to Microsoft