typedef struct _TDI_CONNECTION_INFORMATION {
INT UserDataLength;
PVOID UserData;
INT OptionsLength;
PVOID Options;
INT RemoteAddressLength;
PVOID RemoteAddress;
} TDI_CONNECTION_INFORMATION, *PTDI_CONNECTION_INFORMATION;
TDI_CONNECTION_INFORMATION defines information the client passes to or receives from a TDI driver connection function. Not all driver connection functions use all members of the structure.
Note In general, if a function is asynchronous, it does not write information for the client in a TDI_CONNECTION_INFORMATION structure until it actually completes.
Members
UserDataLength
Specifies the length, in bytes, of the buffer the UserData member indicates. A TDI driver can have a maximum allowable user data length, which the client can determine by issuing a query information request using TDI_QUERY_INFORMATION (kernel-mode client).
When the client is sending user data, a length of zero implies that the client provides no user data in its request to the appropriate driver function. When the client is receiving user data, a length of zero implies that the driver receive function does not write user data. The function merely updates this member with the number of bytes of data received.
If the client specifies a nonzero user data length and the corresponding driver function receives data too large to fit into the data buffer, it truncates the data. In this case, the function completes in normal fashion but returns a TDI status code indicating data truncation.
Note When the client is not allowed to supply user data in a request, the associated driver function fails if the client specifies a nonzero user data length.
UserData
Points to the user data buffer. A client can determine whether user data is valid for a function by making a query information request.
Internal driver connect, listen, and disconnect functions use this member and the associated length member for both input and output. The accept and send datagram functions use this member for input only, and the receive datagram function uses them for output only.
OptionsLength
Specifies the length, in bytes, of the buffer indicated by the Options member. When the client is using Options to supply driver-specific options, a length of zero implies that the driver can use default values for options. When the client is using Options for values the driver writes, zero implies that a driver function should not write final options.
If the client specifies a nonzero options length and the driver receives an option string too large for the buffer, the driver function truncates the data. It completes normally and returns a TDI status code indicating data truncation.
Options
Points to the address of a buffer containing either TDI driver-specific options for a client request or options the associated driver function writes. When the client uses Options to specify option values the driver writes, the values the driver actually writes can be different from the client-specified values. If the client provides an illegal or badly formed option string in its request, the driver function fails.
The internal driver connect, listen, accept, and receive datagram functions use this member and the associated length member for both input and output. The send datagram function uses these members for input only, and the disconnect function uses them for output only.
Note The driver determines the syntax and semantics of options.
RemoteAddressLength
Specifies the length, in bytes, of the buffer the RemoteAddress field indicates. If the client specifies a buffer length of zero, the driver does not write the remote node transport address. If the client specifies a nonzero length and the driver writes an address too long for the buffer, the driver function truncates the address. It completes normally and returns a TDI status code indicating data truncation.
RemoteAddress
Points to the address of a buffer containing a remote transport address specified by the client or written by a driver function for the client. The syntax of this address is driver-specific.
Use of this member depends on the client request. For an “active” request, the client uses the member to specify the address with which the associated driver function is to establish a connection or to which the function is to send data. For a “passive” request, the client uses this member as a filter to determine driver activities that might satisfy the request.
The internal driver connect and listen functions are the only driver functions that use this member and the associated length member. They both use the members for input and output.
See Also