WSCDeinstallProvider function (ws2spi.h)

The WSCDeinstallProvider function removes the specified transport provider from the system configuration database.

Syntax

int WSCDeinstallProvider(
  [in]  LPGUID lpProviderId,
  [out] LPINT  lpErrno
);

Parameters

[in] lpProviderId

A pointer to a globally unique identifier (GUID) for the provider. This value is stored within each WSAProtocol_Info structure.

[out] lpErrno

A pointer to the error code if the function fails.

Return value

If no error occurs, WSCDeinstallProvider returns zero. Otherwise, it returns SOCKET_ERROR, and a specific error code is available in lpErrno.

Error code Meaning
WSAEINVAL
The lpProviderId parameter does not specify a valid provider.
WSAEFAULT
The lpErrno parameter is not in a valid part of the user address space.
WSANO_RECOVERY
A nonrecoverable error occurred. This error is returned under several conditions including the following: the user lacks the administrative privileges required to write to the Windows Sockets registry, or a failure occurred when opening a catalog entry.
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 WSCDeinstallProvider function removes the common Windows Sockets 2 configuration information for the specified provider. After this routine completes successfully, the configuration information stored in the registry will be changed. However, any Ws2_32.dll instances currently in memory will not be able to recognize this change.

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

The WSCDeinstallProvider function can only be called by a user logged on as a member of the Administrators group. If WSCDeinstallProvider 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 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 needed 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

WSCEnumProtocols

WSCInstallProvider