WSCUnInstallNameSpace function (ws2spi.h)

The WSCUnInstallNameSpace function uninstalls the indicated name-space provider.

Syntax

INT WSCUnInstallNameSpace(
  [in] LPGUID lpProviderId
);

Parameters

[in] lpProviderId

A pointer to a globally unique identifier (GUID) for the name-space provider to be uninstalled.

Return value

If no error occurs, WSCUnInstallNameSpace returns NO_ERROR (zero). Otherwise, it returns SOCKET_ERROR if the function fails, and you must retrieve the appropriate error code using the WSAGetLastError function.

Error code Meaning
WSAEFAULT
The lpProviderId parameter points to memory that is not in a valid part of the user address space.
WSAEINVAL
The specified namespace–provider identifier is invalid.
WSASYSCALLFAILURE
A system call that should never fail has failed.
WSA_NOT_ENOUGH_MEMORY
Insufficient memory was available. This error is returned when there is insufficient memory to allocate a new catalog entry.

Remarks

The namespace 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 WSCUnInstallNameSpace will see the changes.

On success, WSCUnInstallNameSpace will attempt to alert all interested applications that have registered for notification of the change by calling WSAProviderConfigChange.

The WSCUnInstallNameSpace function can only be called by a user logged on as a member of the Administrators group. If WSCUnInstallNameSpace is called by a user that is not a member of the Administrators group, the function call will fail and WSANO_RECOVERY is returned in the lpErrno parameter.

For computers running on Windows Vista or Windows Server 2008, this function can also fail because of user account control (UAC). If an application that contains this function is executed by a user logged on as a member of the Administrators group other than the built-in Administrator, this call will fail unless the application has been marked in the manifest file with a requestedExecutionLevel set to requireAdministrator. If the application on Windows Vista or Windows Server 2008 lacks this manifest file, a user logged on as a member of the Administrators group other than the built-in Administrator must then be executing the application in an enhanced shell as the built-in Administrator (RunAs administrator) for this function to succeed.

The caller of this function must remove any additional files or service provider–specific configuration information that is required to completely uninstall the service provider.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ws2spi.h
Library Ws2_32.lib
DLL Ws2_32.dll

See also

WSAProviderConfigChange

WSCDeinstallProvider

WSCEnumProtocols

WSCInstallNameSpace

WSCUnInstallNameSpace32