When an application running on a client issues a NetServerEnum API call, the client sends the API call to a browser.
If this is the first time a NetServerEnum API call has been issued by an application running on the client, the client must first determine which computers are the browsers in its workgroup or domain. The client does this by sending a QueryBrowserServers directed datagram. This request is processed by the master browser for the domain and subnetwork on which the client is located. The master browser then returns a list of browsers active in the workgroup or domain being queried. The client selects the names of three browsers from the list, and then stores these names for future use. For future NetServerEnum API calls, a browser is chosen randomly from the three browser names that were saved by the client.
If the client cannot find the master browser after three attempts, the client issues a ForceElection broadcast to the domain being queried. A ForceElection broadcast forces the election of a new master browser in the domain. To indicate that the master browser could not be found, the client then returns an error (ERROR_BAD_NETPATH) to the application. For more information on browser elections, see "Determining Browser Roles," earlier in this chapter.