Operation
TDI_SET_EVENT_HANDLER is a request message a client issues to indicate a request to register an event handler the TDI driver can notify of network events.
Note TdiBuildSetEventHandler is the macro a client uses to fill in the IRP.
In a set event handler request, the client registers one event handler for a given event type for an address object. The client should assume that the connection is active when it makes the request. The client can clear an event handler by making a set event handler request and specifying NULL as the address of the handler. (When the client first opens an address object, the driver initializes all event handlers to NULL.)
Along with the request message, the TDI client must provide input and output buffers for the IRP, as well as a status block structure the driver uses to write information about the request. These items are described below. For more information about the members of the IRP related to a set event handler request, see TdiBuildSetEventHandler.
In its preparation of the IRP, the client can also specify an event type. If the most significant bit is set, the event is unique to the vendor. Otherwise, TDI defines the event type as one of the following:
Event Type | Meaning |
TDI_EVENT_CONNECT | Specifies an incoming request from a remote node client. The associated event handler is ClientEventConnect. |
TDI_EVENT_DISCONNECT | Specifies an established connection is disconnected. The associated event handler is ClientEventDisconnect. |
TDI_EVENT_ERROR | Specifies a failure in the TDI driver or in the lower layers that the driver depends on for services. The associated event handler is ClientEventError. |
TDI_EVENT_RECEIVE | Specifies a received connection-oriented TSDU. The associated event handler is ClientEventReceive. |
TDI_EVENT_RECEIVE_DATAGRAM | Specifies a received connectionless TSDU. The associated event handler is ClientEventReceiveDatagram. |
TDI_EVENT_RECEIVE_EXPEDITED | Specifies a received connection-oriented expedited TSDU. The associated event handler is ClientEventReceiveExpedited. |
TDI_EVENT_SEND_POSSIBLE | Specifies that the TDI driver has enough buffer space for a send operation. The associated event handler is ClientEventSendPossible. |
Input
None
Output
None
I/O Status Block
The driver fills in the Status member of the IRP with one of the following TDI status codes:
STATUS_INVALID_ADDRESS_COMPONENT
STATUS_INVALID_PARAMETER
STATUS_SUCCESS
For more information about status codes, see Part II, Chapter 10.
Comments
In general, the TDI driver can indicate an event to a client while an event of the same kind is in progress (in other words, reenter the client event handler). The driver can also call ClientEventReceive before the client set event handler request returns. Therefore, the client must be prepared to receive data through event notification even before the I/O subsystem formally completes its set event handler request.
See Also
ClientEventConnect, ClientEventDisconnect, ClientEventError, ClientEventReceive, ClientEventReceiveDatagram, ClientEventReceiveExpedited, ClientEventSendPossible, TdiBuildSetEventHandler