Platform SDK: Windows Sockets |
In order for a name space provider to be accessible through Windows Sockets it must be properly installed on the system and registered with Windows Sockets. When a name space provider is installed by invoking a vendor's installation program, configuration information must be added to a configuration database to give the Ws2_32.dll required information regarding the service provider. The Ws2_32.dll exports WSCInstallNameSpace for the vendor's installation program to use. This function is used to supply relevant information about the to-be-installed service provider. This information includes:
Symmetrically, the Ws2_32.dll also provides a function, WSCUnInstallNameSpace, for a vendor's deinstallation program to remove all the relevant information from the configuration database. The exact location and format of this configuration information is private to the Ws2_32.dll, and can only be manipulated by the above-mentioned functions.
At any point, an NSP is considered to be either active or inactive, with this setting controlled through the WSCEnableNSProvider function. Name space providers that are inactive continue to show up when enumerated through WSAEnumNameSpaceProviders, but the Ws2_32.dll will not route any query or service registration operations to these providers. This capability can be useful in situations where more than one of the installed name space providers can support a given name space.
When multiple name space providers are referenced in a single API function, the order in which the order in which the queries and registration operations are routed to name space providers is unspecified. The order is unrelated to the order in which name space providers are installed. There are two ways to control which name space providers are used to resolve a name query. First, the name space configuration function, WSCEnableNSProvider can be used to enable and disable name spaces in a machine-wide, persistent way. Second, applications can direct an individual query to a particular provider by specifying that provider's identifying GUID as part of the query.