EN
此内容没有您的语言版本,但有英语版本。

WSCInstallNameSpaceEx function

The WSCInstallNameSpaceEx function installs a namespace provider. For providers that are able to support multiple namespaces, this function must be called for each namespace supported, and a unique provider identifier must be supplied each time.

Syntax


int WSAAPI WSCInstallNameSpaceEx(
  _In_  LPWSTR lpszIdentifier,
  _In_  LPWSTR lpszPathName,
  _In_  DWORD dwNameSpace,
  _In_  DWORD dwVersion,
  _In_  LPGUID lpProviderId,
  _In_  LPBLOB lpProviderInfo
);

Parameters

lpszIdentifier [in]

A pointer to a string that identifies the provider associated with the globally unique identifier (GUID) passed in the lpProviderId parameter.

lpszPathName [in]

A pointer to a Unicode string that contains the load path to the provider DLL. This string observes the usual rules for path resolution and can contain embedded environment strings (such as %SystemRoot%). Such environment strings are expanded when the Ws2_32.dll must subsequently load the provider DLL on behalf of an application. After any embedded environment strings are expanded, the Ws2_32.dll passes the resulting string to the LoadLibrary function which loads the provider into memory. For more information, see LoadLibrary.

dwNameSpace [in]

The namespace supported by this provider.

dwVersion [in]

The version number of the provider.

lpProviderId [in]

A pointer to a GUID for the provider. This GUID should be generated by Uuidgen.exe.

lpProviderInfo [in]

A provider-specific data blob associated with namespace entry.

Return value

If no error occurs, the WSCInstallNameSpaceEx 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
WSAEACCES

The calling routine does not have sufficient privileges to install a namespace.

WSAEINVAL

One or more of the arguments are invalid.

WSANO_RECOVERY

A nonrecoverable error occurred. This error is returned under several conditions including the following: the provider is already installed, the user lacks the administrative privileges required to write to the Winsock registry, or a failure occurred when creating or installing a catalog entry.

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 WSCInstallNameSpaceEx will see the changes.

The provider-specific data blob associated with namespace entry passed in the lpProviderInfo parameter can be queried using the WSAEnumNameSpaceProvidersEx function.

Currently, the only namespace provider included with Windows that uses the lpProviderInfo parameter is the NS_EMAIL provider. The format of the buffer pointed to by the lpProviderInfo parameter for an NS_EMAIL namespace provider is a NAPI_PROVIDER_INSTALLATION_BLOB structure.

The WSCInstallNameSpaceEx function can only be called by a user logged on as a member of the Administrators group. If WSCInstallNameSpaceEx 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 [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Ws2spi.h

Library

Ws2_32.lib

DLL

Ws2_32.dll

See also

NAPI_PROVIDER_INSTALLATION_BLOB
WSAEnumNameSpaceProviders
WSAEnumNameSpaceProvidersEx
WSCInstallNameSpace
WSCInstallNameSpaceEx32
WSCUnInstallNameSpace

 

 

社区附加资源

添加
显示:
© 2014 Microsoft