TdiBuildQueryInformation macro

TdiBuildQueryInformation sets up an internal device control IRP for a TDI_QUERY_INFORMATION request to the underlying transport in which the local-node client has already opened a file object representing an address, a connection endpoint, or a control channel.

Syntax

VOID TdiBuildQueryInformation(
  [in] PIRP           Irp,
  [in] PDEVICE_OBJECT DevObj,
  [in] PFILE_OBJECT   FileObj,
  [in] PVOID          CompRoutine,
  [in] PVOID          Contxt,
  [in] UINT           QType,
  [in] PMDL           MdlAddr
);

Parameters

  • Irp [in]
    Pointer to a client-supplied IRP, either originating in a higher level network component or allocated with TdiBuildInternalDeviceControlIrp.

  • DevObj [in]
    Pointer to the device object created by the underlying TDI transport driver.

  • FileObj [in]
    Pointer to a file object representing an address, connection endpoint, or control channel.

  • CompRoutine [in]
    Specifies the entry point of a client-supplied IoCompletion routine or NULL. The I/O manager calls this routine when the given IRP is completed, unless the client sets this parameter to NULL.

  • Contxt [in]
    Pointer to a client-determined context. This client-supplied pointer is passed in to the IoCompletion routine when it is called with the completed IRP. Contxt is NULL if CompRoutine is NULL.

  • QType [in]
    Specifies what the client is querying. This parameter can be transport-defined or one of the following system-defined values, for which all transports support queries:

    • TDI_QUERY_ADDRESS_INFO
      Specifies that the transport should return the information, formatted as a TDI_ADDRESS_INFO structure, in the client-supplied buffer mapped at MdlAddr.

      FileObj must point to an open file object representing a transport address or a connection endpoint already associated with a transport address.

    • TDI_QUERY_CONNECTION_INFO
      Specifies that the transport should return the information, formatted as a TDI_CONNECTION_INFO structure, in the client-supplied buffer mapped at MdlAddr.

      FileObj must point to an open file object representing a connection endpoint.

    • TDI_QUERY_BROADCAST_ADDRESS
      Specifies that the transport should return the information, formatted as a TRANSPORT_ADDRESS structure, in the client-supplied buffer mapped at MdlAddr.

      FileObject must point to an open file object representing a control channel.

    • TDI_QUERY_NETWORK_ADDRESS
      Specifies that the transport should return the information, formatted as a TRANSPORT_ADDRESS structure, in the client-supplied buffer mapped at MdlAddr.

      FileObj must point to an open file object representing a control channel.

    • TDI_QUERY_DATA_LINK_ADDRESS
      Specifies that the transport should return the information, formatted as a TRANSPORT_ADDRESS structure, in the client-supplied buffer mapped at MdlAddr.

      FileObj must point to an open file object representing a control channel.

    • TDI_QUERY_PROVIDER_INFO
      Specifies that the transport should return the information, formatted as a TDI_PROVIDER_INFO structure, in the client-supplied buffer mapped at MdlAddr.

      FileObj must point to an open file object representing a control channel.

    • TDI_QUERY_PROVIDER_STATISTICS
      Specifies that the transport should return the information, formatted as a TDI_PROVIDER_STATISTICS structure, in the client-supplied buffer mapped at MdlAddr.

      FileObj must point to an open file object representing a control channel.

    • TDI_QUERY_DATAGRAM_INFO
      Specifies that the transport should return the information, formatted as a TDI_DATAGRAM_INFO structure, in the client-supplied buffer mapped at MdlAddr.

      FileObj usually points to an open file object representing a control channel. If the underlying transport supports it, FileObj can point to an open file object representing an address.

    • TDI_QUERY_MAX_DATAGRAM_INFO
      Specifies that the transport should return the information, formatted as a TDI_MAX_DATAGRAM_INFO structure, in the client-supplied buffer mapped at MdlAddr.

      FileObj usually points to an open file object representing a control channel. If the underlying transport supports it, FileObj can point to an open file object representing an address.

    The underlying transport can support additional types of query-information requests at the discretion of the driver writer. Such a transport must define TDI_QUERY_XXX codes in which the most significant bit is set.

    In addition to the preceding, clients of a NetBIOS transport can specify the following for QType:

    • TDI_QUERY_FIND_NAME
      Specifies that the transport should return the information, formatted as FIND_NAME_HEADER followed by FIND_NAME_BUFFER structures, in the client-supplied buffer mapped at MdlAddr.

      FileObj must point to an open file object representing a control channel.

    • TDI_QUERY_SESSION_STATUS
      Specifies that the transport should return the information, formatted as SESSION_HEADER followed by SESSION_BUFFER structures, in the client-supplied buffer mapped at MdlAddr.

      FileObj must point to an open file object representing a control channel.

    • TDI_QUERY_ADAPTER_STATUS
      Specifies that the transport should return the information, formatted as an ADAPTER_STATUS structure, in the client-supplied buffer mapped at MdlAddr.

      FileObj must point to an open file object representing a control channel.

    For more information about the preceding structures, see the Microsoft Windows SDK.

  • MdlAddr [in]
    Pointer to an MDL mapping a client-supplied buffer containing any necessary request-specific information set up by the client. The transport returns the requested information in this buffer, formatted according to the given QType.

Return value

None

Remarks

TdiBuildQueryInformation sets IRP_MJ_INTERNAL_DEVICE_CONTROL as the MajorFunction and TDI_QUERY_INFORMATION as the MinorFunction codes in the transport's I/O stack location of the given IRP.

A TDI client can use the query request to ask its underlying transport for information, such as connection-status information, a broadcast address it can use, or the features of the transport such as its size limits for sends, datagrams, and user-connect data.

The client can query information about an address, a connection endpoint, or a control channel, depending on the specified QType. The client must supply a FileObj pointer to TdiBuildQueryInformation to an open file object that is appropriate to the given QType. Otherwise, the underlying transport cannot satisfy its query request.

Because TdiBuildQueryInformation sets the RequestConnectionInformation member of the TDI_REQUEST_KERNEL_QUERY_INFORMATION structure to NULL, a client of a NetBIOS transport cannot use TdiBuildQueryInformation with query type TDI_QUERY_FIND_NAME. To set up an IRP for a TDI_QUERY_INFORMATION request using TDI_QUERY_FIND_NAME, a client of a NetBIOS transport can use code similar to the code for TdiBuildQueryInformation but must specify a pointer to a TDI_CONNECTION_INFORMATION structure for RequestConnectionInformation.

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)

See also

TDI_ADDRESS_INFO

TdiBuildInternalDeviceControlIrp

TDI_CONNECTION_INFO

TDI_DATAGRAM_INFO

TDI_MAX_DATAGRAM_INFO

TDI_PROVIDER_INFO

TDI_PROVIDER_STATISTICS

TDI_QUERY_INFORMATION

TRANSPORT_ADDRESS

 

 

Send comments about this topic to Microsoft