ClientEventConnect

TDI_STATUS
ClientEventConnect (
IN PVOID TdiEventContext,
IN INT RemoteAddressLength,
IN PVOID RemoteAddress,
IN INT UserDataLength,
IN PVOID UserData,
IN INT OptionsLength,
IN PVOID Options,
OUT CONNECTION_CONTEXT *ConnectionContext,
OUT PIRP *AcceptIoRequestPacket
);

ClientEventConnect is a routine the TDI driver calls in response to a TDI_EVENT_CONNECT event. It notifies the client of a connection request from a remote node client. The local node client inspects address information identifying the remote node client and accepts or rejects the connection.

If the local node client wants to accept the connection, ClientEventConnect must write a connection context and an acceptance indication (AcceptIoRequestPacket) and then return STATUS_MORE_PROCESSING_REQUIRED. If the client does not have enough resources for the connection, ClientEventConnect returns STATUS_INSUFFICIENT_RESOURCES. In this case, the TDI driver rejects the remote node client connection request.

Parameters

TdiEventContext

Points to the context the client specifies in an IRP when it issues the TDI_SET_EVENT_HANDLER request message to register ClientEventConnect.

RemoteAddressLength

Specifies the length, in bytes, of the buffer that RemoteAddress indicates.

RemoteAddress

Points to a buffer containing the transport address of the remote node client.

UserDataLength

Specifies the length, in bytes, of the buffer UserData indicates. A value of 0 indicates that no data is available or that the TDI driver does not support connection data.

UserData

Points to a connection data buffer the client provides in the original open connection request (TdiDispatchCreate).

OptionsLength

Specifies the length, in bytes, of the buffer that Options indicates. A value of 0 implies no option string.

Options

Points to a buffer of driver-specific options for the connection.

ConnectionContext

Points to the caller–defined memory location to which ClientEventConnect writes a connection endpoint identifier.

AcceptIoRequestPacket

Points to a caller–defined memory location to which ClientEventConnect writes an IRP indicating connection acceptance. The driver completes the IRP as it does a normal accept IRP. The IRP is identical to the one a kernel-mode client passes for the TDI_ACCEPT request message following the completion of a listen request.

Return Value

ClientEventConnect can return the following TDI status codes:

STATUS_INSUFFICIENT_RESOURCES
STATUS_MORE_PROCESSING_REQUIRED

For more information about status codes, see Part II, Chapter 10.

See Also

TDI_ACCEPT, TdiDispatchCreate, TDI_SET_EVENT_HANDLER