WSAQuerySet

typedef struct _WSAQuerySetW {
    DWORD           dwSize;
    LPWSTR          lpszServiceInstanceName;
    LPGUID          lpServiceClassId;
    LPWSAVERSION    lpVersion;
    LPWSTR          lpszComment;
    DWORD           dwNameSpace;
    LPGUID          lpNSProviderId;
    LPWSTR          lpszContext;
    DWORD           dwNumberOfProtocols;
    LPAFPROTOCOLS   lpafpProtocols;
    LPWSTR          lpszQueryString;
    DWORD           dwNumberOfCsAddrs;
    LPCSADDR_INFO   lpcsaBuffer;
    DWORD           dwOutputFlags;
    LPBLOB          lpBlob;
} WSAQUERYSETW, *PWSAQUERYSETW, *LPWSAQUERYSETW;

Parameters

dwSize
Must be set to sizeof(WSAQUERYSET). This is a versioning mechanism.
dwOutputflags
Ignored for queries.
lpszServiceInstanceName
(Optional) Referenced string contains service name. The semantics for wildcarding within the string are not defined, but can be supported by certain name space providers.
lpServiceClassId
(Required) The GUID corresponding to the service class.
lpVersion
(Optional) References desired version number and provides version comparison semantics (that is, version must match exactly, or version must be not less than the value supplied).
lpszComment
Ignored for queries.
dwNameSpace1
Identifier of a single name space in which to constrain the search, or NS_ALL to include all name spaces.
lpNSProviderId
(Optional) References the GUID of a specific name space provider, and limits the query to this provider only.
lpszContext
(Optional) Specifies the starting point of the query in a hierarchical name space.
dwNumberOfProtocols
Size of the protocol constraint array, can be zero.
lpafpProtocols
(Optional) References an array of AFPROTOCOLS structure. Only services that utilize these protocols will be returned.
lpszQueryString
(Optional) Some namespaces (such as whois++) support enriched SQL like queries that are contained in a simple text string. This parameter is used to specify that string.
dwNumberOfCsAddrs
Ignored for queries.
lpcsaBuffer
Ignored for queries.
lpBlob
(Optional) This is a pointer to a provider-specific entity.

1    See the Important note below

Important In most instances, applications interested in only a particular transport protocol should constrain their query by address family and protocol rather than by name space. This would allow an application that needs to locate a TCP/IP service, for example, to have its query processed by all available name spaces such as the local hosts file, DNS, and NIS.