DnsServiceBrowse function (windns.h)

Used to initiate a DNS-SD discovery for services running on the local network.

Syntax

DNS_STATUS DnsServiceBrowse(
  PDNS_SERVICE_BROWSE_REQUEST pRequest,
  PDNS_SERVICE_CANCEL         pCancel
);

Parameters

pRequest

A pointer to a DNS_SERVICE_BROWSE_REQUEST structure that contains the browse request information.

pCancel

A pointer to a DNS_SERVICE_CANCEL structure that can be used to cancel a pending asynchronous browsing operation. This handle must remain valid until the query is canceled.

Return value

If successful, returns DNS_REQUEST_PENDING; otherwise, returns the appropriate DNS-specific error code as defined in Winerror.h. For extended error information, call GetLastError.

Remarks

This function is asynchronous. As services are being discovered, the browse callback will be invoked for each result.

Requirements

Requirement Value
Minimum supported client Windows 10 [desktop apps only]
Target Platform Windows
Header windns.h
Library dnsapi.lib
DLL dnsapi.dll