Compartilhar via


ClientEventDisconnect routine

The ClientEventDisconnect routine is an event handler that the underlying TDI transport calls in response to an incoming disconnection notification from a remote node.

Syntax

NTSTATUS ClientEventDisconnect(
  _In_ PVOID              TdiEventContext,
  _In_ CONNECTION_CONTEXT ConnectionContext,
  _In_ LONG               DisconnectDataLength,
  _In_ PVOID              DisconnectData,
  _In_ LONG               DisconnectInformationLength,
  _In_ PVOID              DisconnectInformation,
  _In_ ULONG              DisconnectFlags
);

Parameters

  • TdiEventContext [in]
    Pointer to the client-supplied context provided in the IRP that was set up with TdiBuildSetEventHandler when ClientEventDisconnect was registered with the underlying transport.

  • ConnectionContext [in]
    Pointer to the client's context area for this connection endpoint. The client previously supplied this value to its underlying transport when its ClientEventConnect handler accepted a connection offer from the remote-node peer and/or when it opened the connection endpoint with ZwCreateFile.

  • DisconnectDataLength [in]
    Specifies the size in bytes of the buffer at DisconnectData. Zero indicates that no disconnect data was transmitted from the remote node.

  • DisconnectData [in]
    Pointer to a buffer containing disconnect data received from the remote node by the underlying transport. This pointer is NULL if DisconnectDataLength is zero.

  • DisconnectInformationLength [in]
    Specifies the size in bytes of the buffer at DisconnectInformation. Zero indicates that no additional disconnect information was transmitted from the remote node.

  • DisconnectInformation [in]
    Pointer to a buffer containing any additional transport-specific disconnect information. This pointer is NULL if DisconnectInformationLength is zero.

  • DisconnectFlags [in]
    Specifies the nature of the disconnection operation as zero or as one of the following flags:

    • TDI_DISCONNECT_ABORT
      The transport is closing the endpoint-to-endpoint connection immediately without completing any pending operations on the connection. In effect, this flag is equivalent to a DisconnectFlags of zero.

    • TDI_DISCONNECT_RELEASE
      The transport is engaged in a controlled disconnect operation with the remote node.

Return value

ClientEventDisconnect can return STATUS_SUCCESS.

Remarks

A call to ClientEventDisconnect notifies the local-node client that its remote-node peer is closing their established endpoint-to-endpoint connection. Depending on the input DisconnectFlags, the disconnect can be either controlled or uncontrolled. ClientEventDisconnect is the last event handler the TDI driver calls on an endpoint-to-endpoint connection.

If TDI_DISCONNECT_RELEASE is set in the DisconnectFlags, both transports are coordinating a controlled disconnection. (For more information, see TDI_DISCONNECT.)

A call to ClientEventDisconnect notifies the local-node client that endpoint-to-endpoint activity has ceased or is ceasing on the connection endpoint opened by that client. However, the connection endpoint is still valid after the endpoint-to-endpoint connection has been broken. The local-node client can reuse its open connection endpoint in a subsequent operation after ClientEventDisconnect returns control.

ClientEventDisconnect must be capable of carrying out its operations at IRQL = DISPATCH_LEVEL.

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)

IRQL

DISPATCH_LEVEL (see Remarks section)

See also

TdiBuildDisconnect

TdiBuildSetEventHandler

TDI_DISCONNECT

 

 

Send comments about this topic to Microsoft