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

A name service query involves a series of calls: NSPLookupServiceBegin, followed by one or more calls to NSPLookupServiceNextand ending with a call to NSPLookupServiceEnd. NSPLookupServiceBegintakes a WSAQUERYSETstructure as input in order to define the query parameters along with a set of flags to provide additional control over the search operation. It returns a query handle that is used in the subsequent calls to NSPLookupServiceNextand NSPLookupServiceEnd.

The namespace SPI client invokes NSPLookupServiceNextto obtain query results, with results supplied in a client-supplied WSAQUERYSETbuffer. The client continues to call NSPLookupServiceNextuntil 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 NSPLookupServiceEnd. The NSPLookupServiceEndfunction can also be used to cancel a currently pending NSPLookupServiceNextwhen called from another thread.

In Winsock, conflicting error codes are defined for WSAENOMORE (10102) and WSA_E_NO_MORE (10110). The error code WSAENOMORE will be removed in a future version and only WSA_E_NO_MORE will remain. Namespace providers should switch to using the WSA_E_NO_MORE error code as soon as possible to maintain compatibility with the widest possible range of applications.

See Also