TDI_QUERY_INFORMATION
When a kernel-mode client makes a TDI_QUERY_INFORMATION request, it asks the
underlying TDI transport driver to return information of a client-specified
type, such as a broadcast address, the tranport's capabilities, or its
current statistics for I/O on a particular connection.
IRP
The transport calls IoGetCurrentIrpStackLocation with the given Irp
to get a pointer to its own I/O stack location in the IRP, shown in the
following list as IrpSp. IRP members relevant to this request include
the following:
-
IoStatus.Status
-
Specifies the final status of the query-information request. The transport
sets this member before it completes the IRP, possibly to one of the
following:
STATUS_SUCCESS
STATUS_BUFFER_OVERFLOW
STATUS_INSUFFICIENT_RESOURCES
STATUS_INVALID_CONNECTION
STATUS_INVALID_DEVICE_REQUEST
STATUS_NOT_IMPLEMENTED
-
IoStatus.Information
-
Specifies the number of bytes of information the transport is returning to its
client.
-
IrpSp->MajorFunction
-
Specifies IRP_MJ_INTERNAL_DEVICE_CONTROL. The transport can ignore this member
if it exports a TdiDispatchInternalDeviceControl routine that handles only
TDI_XXX requests.
-
IrpSp->MinorFunction
-
Specifies TDI_QUERY_INFORMATION.
-
IrpSp->FileObject
-
Points to an open file object representing an address, connection endpoint, or
control channel. The transport uses the FsContext and, possibly, FsContext2
fields to access the state it maintains about this address, connection
endpoint, or control channel.
-
IrpSp->Parameters
-
Points to a TDI_REQUEST_KERNEL_QUERY_INFO structure, defined as follows:
struct _TDI_REQUEST_KERNEL_QUERY_INFO {
LONG QueryType;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
} TDI_REQUEST_KERNEL_QUERY_INFORMATION, *PTDI_REQUEST_KERNEL_QUERY_INFORMATION;
A transport can ignore the RequestConnectionInformation member; it is
always NULL. The transport checks the QueryType member to determine
what information the client requested, which also determines the format of the
information to be returned and, sometimes the client-supplied contents, of the
buffer mapped at Irp->MdlAddress.
For every TDI transport, QueryType can be set to one of the following
system-defined values:
-
TDI_QUERY_ADDRESS_INFO
-
Requests the transport to return information about a particular local-node
address, formatted as a TDI_ADDRESS_INFO structure, in the client-supplied
buffer mapped at MdlAddress.
IrpSp->FileObject must point to a file object representing the
address or to a connection endpoint already associated with the address for
which to return the information.
-
TDI_QUERY_CONNECTION_INFO
-
Requests the transport to return information about a particular connection,
formatted as a TDI_CONNECTION_INFO structure, in the client-supplied buffer
mapped at MdlAddress.
IrpSp->FileObject must point to a file object representing the
connection for which to return the information.
-
TDI_QUERY_BROADCAST_ADDRESS
-
Requests the transport to return a broadcast address, formatted as a
TRANSPORT_ADDRESS structure, in the client-supplied buffer mapped at MdlAddress.
IrpSp->FileObject must point to a file object representing a control
channel.
-
TDI_QUERY_NETWORK_ADDRESS
-
Requests the transport to return a local-node address, formatted as a
TRANSPORT_ADDRESS structure, in the client-supplied buffer mapped at MdlAddress.
IrpSp->FileObject must point to a file object representing a control
channel.
-
TDI_QUERY_DATA_LINK_ADDRESS
-
Requests the transport to return the datalink address, formatted as a
TRANSPORT_ADDRESS structure, in the client-supplied buffer mapped at MdlAddress.
IrpSp->FileObject must point to a file object representing a control
channel.
-
TDI_QUERY_PROVIDER_INFO or TDI_QUERY_PROVIDER_INFORMATION
-
Requests the transport to return information about its own capabilities,
formatted as a TDI_PROVIDER_INFO structure, in the client-supplied buffer
mapped at MdlAddress.
IrpSp->FileObject must point to a file object representing a control
channel.
-
TDI_QUERY_PROVIDER_STATISTICS
-
Requests the transport to return information about its resource usage,
formatted as a TDI_PROVIDER_STATISTICS structure, in the client-supplied
buffer mapped at MdlAddress.
IrpSp->FileObject must point to a file object representing a control
channel.
-
TDI_QUERY_DATAGRAM_INFO
-
Requests the transport to return information about its limits on size and
number of datagrams, formatted as a TDI_DATAGRAM_INFO structure, in the
client-supplied buffer mapped at MdlAddress.
IrpSp->FileObject must point to a file object representing a control
channel. A transport also can support this query on open transport addresses
at the discretion of the transport writer.
-
TDI_QUERY_MAX_DATAGRAM_INFO
-
Requests the transport to return information about its limit on datagram size,
formatted as a TDI_MAX_DATAGRAM_INFO structure, in the client-supplied buffer
mapped at MdlAddress.
IrpSp->FileObject must point to a file object representing a control
channel. A transport also can support this query on open transport addresses
at the discretion of the transport writer.
In addition to the preceding queries, which every TDI transport must support,
a particular transport might support others. For example, NetBIOS transports
also must respond to three additional system-defined TDI_QUERY_XXX, as
described later (see Comments).
-
MdlAddress
-
Points to an MDL, possibly the initial MDL in a chain of MDLs, mapping a
client-supplied buffer containing whatever client-supplied contents are
required to carry out the request. The input contents and format of this
buffer depend on the given QueryType.
Comments
For any NetBIOS transport, QueryType also can specify one of the
following:
-
TDI_QUERY_FIND_NAME
-
Requests the NetBIOS transport to return the information, formatted as
FIND_NAME_HEADER followed by FIND_NAME_BUFFER structures, in the
client-supplied buffer mapped at MdlAddress.
-
TDI_QUERY_SESSION_STATUS
-
Requests the transport to return the information, formatted as SESSION_HEADER
followed by SESSION_BUFFER structures, in the client-supplied buffer mapped at
MdlAddress.
-
TDI_QUERY_ADAPTER_STATUS
-
Requests the transport to return the information, formatted as an
ADAPTER_STATUS structure, in the client-supplied buffer mapped at MdlAddress.
For more information about the preceding NetBIOS-specific structures, see the
Win32 SDK.
TdiBuildQueryInformation is the macro a client uses to fill in this
IRP.
See Also
TDI_ADDRESS_INFO, TDI_CONNECTION_INFO,
TDI_CONNECTION_INFORMATION,
TDI_DATAGRAM_INFO, TdiDispatchInternalDeviceControl,
TDI_MAX_DATAGRAM_INFO, TDI_PROVIDER_INFO,
TDI_PROVIDER_STATISTICS, TdiBuildQueryInformation,
TRANSPORT_ADDRESS