Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function installs a name-space provider. For providers that are able to support multiple names spaces, this function must be called once for every name space supported, and a unique provider identifier must be supplied each time.
Syntax
int WSCInstallNameSpace( LPWSTR lpszIdentifier, LPWSTR lpszPathName, DWORD dwNameSpace, DWORD dwVersion, LPGUID lpProviderId ); |
Parameters
- lpszIdentifier
-
[in] Pointer to a string that identifies the provider for use in the GUID.
- lpszPathName
-
[in] Pointer to a string that contains the path to the provider's DLL image. The string observes the usual rules for path resolution, which is that this path can contain embedded environment strings (such as %SystemRoot%). Such environment strings are expanded whenever the ws2.dll needs to subsequently load the provider DLL on behalf of an application. After any embedded environment strings are expanded, the ws2.dll passes the resulting string into the LoadLibraryfunction to load the provider into memory. For more information, see LoadLibrary.
- dwNameSpace
-
[in] Descriptor that specifies the name space supported by this provider.
- dwVersion
-
[in] Descriptor that specifies the version number of the provider.
- lpProviderId
-
[in] Unique identifier for this provider. This GUID should be generated by Uuidgen.exe .
Return Value
If no error occurs, the WSCInstallNameSpacefunction returns NO_ERROR (zero). Otherwise, it returns SOCKET_ERROR if the function fails, and it must set the appropriate error code using SetLastError.
The following table shows the possible error code.
Error value | Description |
---|---|
WSAEACCESS |
Calling routine does not have sufficient privileges to install a name space. |
WSANO_RECOVERY |
Caller application is not privileged. |
Remarks
The functions that configure a name space do not affect applications that are already running. Newly installed name-space providers will notbe visible to applications nor will the changes in a name-space provider's activation state. Applications launched after the call to this function will see the changes.
Requirements
Header | ws2spi.h |
Library | Ws2.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |