WSCGetProviderPath32 函式 (ws2spi.h)

WSCGetProviderPath32函式會擷取指定之 32 位提供者的 DLL 路徑。

注意 此呼叫是嚴格 32 位版本的 WSCGetProviderPath ,可用於 64 位平臺上。 它提供來允許 64 位進程存取 32 位目錄。

 

語法

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

參數

[in] lpProviderId

提供者的本機唯一識別碼。 此值是使用 WSCEnumProtocols32取得。

[out] lpszProviderDllPath

傳回提供者 DLL 路徑字串之緩衝區的指標。 路徑是 Null 終止的字串,而且任何內嵌的環境字串,例如 %SystemRoot%,尚未展開。

[in, out] lpProviderDllPathLen

以字元為單位的 lpszProviderDllPath 參數所指向的緩衝區大小。

[out] lpErrno

錯誤碼的指標。

傳回值

如果沒有發生錯誤, WSCGetProviderPath32 會傳回零。 否則,它會傳回SOCKET_ERROR。 lpErrno提供特定的錯誤碼。

錯誤碼 意義
WSAEINVAL
lpProviderId參數未指定有效的提供者。
WSAEFAULT
lpszProviderDllPathlpErrno參數不在使用者位址空間的有效部分,或lpProviderDllPathLen太小。

備註

WSCGetProviderPath32 是嚴格 32 位版本的 WSCGetProviderPath。 在 64 位電腦上,所有呼叫並非特別 32 位 (,例如,不會以 「32 ) 」 結尾的所有函式都會在原生 64 位目錄上運作。 在 64 位電腦上執行的處理常式必須使用特定的 32 位函式呼叫,以在嚴格 32 位目錄上運作,並保留相容性。 特定 32 位呼叫的定義和語意與其原生對應專案相同。

WSCGetProviderPath32函式會擷取指定提供者的 DLL 路徑。 DLL 路徑可以包含內嵌的環境字串,例如 %SystemRoot%,因此應該在與 Windows LoadLibrary 函式搭配使用之前進行擴充。 如需詳細資訊,請參閱 LoadLibrary

規格需求

   
最低支援的用戶端 Windows Vista、Windows XP Professional x64 Edition [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008、Windows Server 2003 x64 Edition [僅限桌面應用程式]
目標平台 Windows
標頭 ws2spi.h
程式庫 Ws2_32.lib
Dll Ws2_32.dll

另請參閱

WSCEnumProtocols32

WSCInstallProvider64_32