Platform SDK: Windows Sockets

WSCEnableNSProvider

The WSCEnableNSProvider function changes the state of a given name-space provider. It is intended to give the end user the ability to change the state of the name-space providers through Control Panel.

int WSCEnableNSProvider (
  LPGUID    lpProviderId,   
  BOOL      fEnable           
);

Parameters

lpProviderId
[in] Locally unique identifier for this provider.
fEnable
[in] 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.

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.

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 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.

Error Codes

Error code Meaning
WSAEINVAL The specified name-space–provider identifier is invalid.

Requirements

  Version: Requires Windows Sockets 2.0.
  Header: Declared in Ws2spi.h.
  Library: Use Ws2_32.lib.