EN
Il contenuto non è disponibile nella lingua di destinazione, ma solo in inglese.

WSCEnableNSProvider32 function

The WSCEnableNSProvider32 function enables or disables a specified 32-bit namespace provider. It is intended to give the end-user the ability to change the state of the namespace providers.

Note  This call is a strictly 32-bit version of WSCEnableNSProvider for use on 64-bit computers. It is provided to allow 64-bit processes to access the 32-bit catalogs.

Syntax


int WSPAPI WSCEnableNSProvider32(
  _In_  LPGUID lpProviderId,
  _In_  BOOL fEnable
);

Parameters

lpProviderId [in]

A pointer to a globally unique identifier (GUID) for the namespace provider.

fEnable [in]

A Boolean value that, if TRUE, the namespace provider is set to the active state. If FALSE, the namespace provider is disabled and will not be available for query operations or service registration.

Return value

If no error occurs, the WSCEnableNSProvider32 function 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 codeMeaning
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 WSCEnableNSProvider32 function is intended to be used to change the state of the namespace providers. An independent software vendor (ISV) should not normally de-activate another ISV's namespace provider in order to activate its own. The choice should be left to the user.

WSCEnableNSProvider32 is a strictly 32-bit version of WSCEnableNSProvider. On a 64-bit computer, all calls not specifically 32-bit (for example, all functions that do not end in "32") operate on the native 64-bit catalog. Processes that execute on a 64-bit computer must use the specific 32-bit function calls to operate on a strictly 32-bit catalog and preserve compatibility. The definitions and semantics of the specific 32-bit calls are the same as their native counterparts.

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

The WSCEnableNSProvider32 function can only be called by a user logged on as a member of the Administrators group. If WSCEnableNSProvider32 is called by a user that is not a member of the Administrators group, the function call will fail.

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.

Requirements

Minimum supported client

Windows Vista, Windows XP Professional x64 Edition [desktop apps only]

Minimum supported server

Windows Server 2008, Windows Server 2003 x64 Edition [desktop apps only]

Header

Ws2spi.h

Library

Ws2_32.lib

DLL

Ws2_32.dll

See also

WSCEnableNSProvider
WSCEnumProtocols32
WSCInstallNameSpace32
WSCUnInstallNameSpace32
WSCWriteNameSpaceOrder32

 

 

Aggiunte alla community

AGGIUNGI
Mostra:
© 2014 Microsoft