Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Winsock provides the following functions to perform name space query operations:

The WSAEnumNameSpaceProvidersfunction allows an application to discover which namespaces are accessible through Winsock name resolution facilities. It also allows an application to determine whether a given namespace is supported by more than one namespace provider, and to discover the provider identifier for any particular namespace provider. Using a provider identifier, the application can restrict a query operation to a specified namespace provider.

Winsock namespace query operations involve a series of calls: WSALookupServiceBegin, followed by one or more calls to WSALookupServiceNextand ending with a call to WSALookupServiceEnd. WSALookupServiceBegintakes a WSAQUERYSETstructure as input to define the query parameters along with a set of flags to provide additional control over the search operation. It returns a query handle which is used in the subsequent calls to WSALookupServiceNextand WSALookupServiceEnd.

The application invokes WSALookupServiceNextto obtain query results, with results supplied in an application-supplied WSAQUERYSETbuffer. The application continues to call WSALookupServiceNextuntil the error code WSA_E_NO_MORE is returned indicating that all results have been retrieved. The search is then terminated by a call to WSALookupServiceEnd. The WSALookupServiceEndfunction can also be used to cancel a currently pending WSALookupServiceNextwhen called from another thread.

See Also