WSCEnableNSProvider

The WSCEnableNSProvider function changes the state of a given name space provider. It is intended give the end-user the ability to change the state of the name space providers with the control panel applet.

int WSCEnableNSProvider (
  LPGUID lpProviderId,   
  BOOL fEnable           
);
 

Parameters

lpProviderId
[in] The locally unique identifier for this provider.
fEnable
[in] A Boolean value that, if TRUE, the provider is set to the active state. If FALSE, the provider is disabled and will not be available for query operations or service registration.

Remarks

The name space configuration functions do not affect applications that are already running. Newly installed name space providers will not be visible to applications nor will the changes in a name space provider's activation state. Applications launched after the call to WSCEnableNSProvider will see the changes.

The WSCEnableNSProvider function is intended to be used by the control panel applet to change the state of the providers. An ISV should not just blindly de-activate another ISV's provider in order to activate its own. The choice should be left to the user.

Return Values

If no error occurs, the WSCEnableNSProvider function returns NO_ERROR (zero). Otherwise, it returns SOCKET_ERROR and must set the appropriate error code using SetLastError.

Error Codes

WSAEINVAL The specified name space provider ID is invalid.

QuickInfo

  Windows NT: Yes
  Windows: Yes
  Windows CE: Unsupported.
  Header: Declared in ws2spi.h.
  Import Library: Link with ws2_32.lib.