WSCGetProviderPath function (ws2spi.h)

The WSCGetProviderPath function retrieves the DLL path for the specified provider.

Syntax

int WSCGetProviderPath(
  [in]      LPGUID lpProviderId,
  [out]     WCHAR  *lpszProviderDllPath,
  [in, out] LPINT  lpProviderDllPathLen,
  [out]     LPINT  lpErrno
);

Parameters

[in] lpProviderId

A pointer to a globally unique identifier (GUID) for the provider. This value is obtained by using WSCEnumProtocols.

[out] lpszProviderDllPath

A pointer to a buffer into which the provider DLL's path string is returned. The path is a null-terminated string and any embedded environment strings, such as %SystemRoot%, have not been expanded.

[in, out] lpProviderDllPathLen

The size, in characters, of the buffer pointed to by the lpszProviderDllPath parameter.

[out] lpErrno

A pointer to the error code if the function fails.

Return value

If no error occurs, WSCGetProviderPath returns zero. Otherwise, it returns SOCKET_ERROR. The specific error code is available in lpErrno.

Error code Meaning
WSAEINVAL
The lpProviderId parameter does not specify a valid provider.
WSAEFAULT
The lpszProviderDllPath or lpErrno parameter is not in a valid part of the user address space, or lpProviderDllPathLen is too small.

Remarks

The WSCGetProviderPath function retrieves the DLL path for the specified provider. The DLL path can contain embedded environment strings, such as %SystemRoot%, and thus should be expanded prior to being used with the Windows LoadLibrary function. For more information, see LoadLibrary.

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

WSCEnumProtocols

WSCInstallProvider