ws2_32: Add stub implementation for WSCGetProviderInfo.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48765
Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Bernhard Übelacker 2020-03-19 22:32:16 +01:00 committed by Alexandre Julliard
parent ef23e618a0
commit 3795484e81
4 changed files with 76 additions and 0 deletions

View File

@ -9001,6 +9001,27 @@ INT WINAPI WSCEnableNSProvider( LPGUID provider, BOOL enable )
return 0;
}
/***********************************************************************
* WSCGetProviderInfo
*/
INT WINAPI WSCGetProviderInfo( LPGUID provider, WSC_PROVIDER_INFO_TYPE info_type,
PBYTE info, size_t* len, DWORD flags, LPINT errcode )
{
FIXME( "(%s 0x%08x %p %p 0x%08x %p) Stub!\n",
debugstr_guid(provider), info_type, info, len, flags, errcode );
if (!errcode)
return SOCKET_ERROR;
if (!provider) {
*errcode = WSAEFAULT;
return SOCKET_ERROR;
}
*errcode = WSANO_RECOVERY;
return SOCKET_ERROR;
}
/***********************************************************************
* WSCGetProviderPath (WS2_32.86)
*/

View File

@ -27,6 +27,7 @@
#include <windows.h>
#include <winternl.h>
#include <ws2tcpip.h>
#include <ws2spi.h>
#include <wsipx.h>
#include <wsnwlink.h>
#include <mswsock.h>
@ -84,6 +85,7 @@ static int (WINAPI *pWSALookupServiceNextW)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSET
static int (WINAPI *pWSAEnumNameSpaceProvidersA)(LPDWORD,LPWSANAMESPACE_INFOA);
static int (WINAPI *pWSAEnumNameSpaceProvidersW)(LPDWORD,LPWSANAMESPACE_INFOW);
static int (WINAPI *pWSAPoll)(WSAPOLLFD *,ULONG,INT);
static int (WINAPI *pWSCGetProviderInfo)(LPGUID,WSC_PROVIDER_INFO_TYPE,PBYTE,size_t*,DWORD,LPINT);
/* Function pointers from iphlpapi */
static DWORD (WINAPI *pGetAdaptersInfo)(PIP_ADAPTER_INFO,PULONG);
@ -1300,6 +1302,7 @@ static void Init (void)
pWSAEnumNameSpaceProvidersA = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersA");
pWSAEnumNameSpaceProvidersW = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersW");
pWSAPoll = (void *)GetProcAddress(hws2_32, "WSAPoll");
pWSCGetProviderInfo = (void *)GetProcAddress(hws2_32, "WSCGetProviderInfo");
hiphlpapi = LoadLibraryA("iphlpapi.dll");
if (hiphlpapi)
@ -11597,6 +11600,48 @@ static void test_iocp(void)
closesocket(dst);
}
static void test_WSCGetProviderInfo(void)
{
int ret;
int errcode;
GUID provider = {};
char info[1];
size_t len = 0;
if (!pWSCGetProviderInfo) {
skip("WSCGetProviderInfo is not available.\n");
return;
}
ret = pWSCGetProviderInfo(NULL, -1, NULL, NULL, 0, NULL);
ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret);
errcode = 0xdeadbeef;
ret = pWSCGetProviderInfo(NULL, ProviderInfoLspCategories, (PBYTE)&info, &len, 0, &errcode);
ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret);
ok(errcode == WSAEFAULT, "got %d, expected WSAEFAULT\n", errcode);
errcode = 0xdeadbeef;
ret = pWSCGetProviderInfo(&provider, -1, (PBYTE)&info, &len, 0, &errcode);
ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret);
ok(errcode == WSANO_RECOVERY, "got %d, expected WSANO_RECOVERY\n", errcode);
errcode = 0xdeadbeef;
ret = pWSCGetProviderInfo(&provider, ProviderInfoLspCategories, NULL, &len, 0, &errcode);
ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret);
ok(errcode == WSANO_RECOVERY, "got %d, expected WSANO_RECOVERY\n", errcode);
errcode = 0xdeadbeef;
ret = pWSCGetProviderInfo(&provider, ProviderInfoLspCategories, (PBYTE)&info, NULL, 0, &errcode);
ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret);
ok(errcode == WSANO_RECOVERY, "got %d, expected WSANO_RECOVERY\n", errcode);
errcode = 0xdeadbeef;
ret = pWSCGetProviderInfo(&provider, ProviderInfoLspCategories, (PBYTE)&info, &len, 0, &errcode);
ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret);
ok(errcode == WSANO_RECOVERY, "got %d, expected WSANO_RECOVERY\n", errcode);
}
START_TEST( sock )
{
int i;
@ -11681,6 +11726,8 @@ START_TEST( sock )
test_completion_port();
test_address_list_query();
test_WSCGetProviderInfo();
/* this is an io heavy test, do it at the end so the kernel doesn't start dropping packets */
test_send();
test_synchronous_WSAIoctl();

View File

@ -117,6 +117,7 @@
@ stdcall WSCDeinstallProvider(ptr ptr)
@ stdcall WSCEnableNSProvider(ptr long)
@ stdcall WSCEnumProtocols(ptr ptr ptr ptr)
@ stdcall WSCGetProviderInfo(ptr long ptr ptr long ptr)
@ stdcall WSCGetProviderPath(ptr ptr ptr ptr)
@ stdcall WSCInstallNameSpace(wstr wstr long long ptr)
@ stdcall WSCInstallProvider(ptr wstr ptr long ptr)

View File

@ -33,12 +33,19 @@ extern "C" {
typedef BOOL (WINAPI *LPWPUPOSTMESSAGE)(HWND,UINT,WPARAM,LPARAM);
typedef enum _WSC_PROVIDER_INFO_TYPE
{
ProviderInfoLspCategories,
ProviderInfoAudit,
} WSC_PROVIDER_INFO_TYPE;
WSAEVENT WINAPI WPUCompleteOverlappedRequest(SOCKET,LPWSAOVERLAPPED,DWORD,DWORD,LPINT);
INT WINAPI WSCInstallProvider(const LPGUID,LPCWSTR,const LPWSAPROTOCOL_INFOW,
DWORD,LPINT);
INT WINAPI WSCDeinstallProvider(LPGUID,LPINT);
INT WINAPI WSCEnableNSProvider(LPGUID,BOOL);
INT WINAPI WSCEnumProtocols(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD,LPINT);
INT WINAPI WSCGetProviderInfo(LPGUID,WSC_PROVIDER_INFO_TYPE,PBYTE,size_t*,DWORD,LPINT);
INT WINAPI WSCGetProviderPath(LPGUID,LPWSTR,LPINT,LPINT);
INT WINAPI WSCInstallNameSpace(LPWSTR,LPWSTR,DWORD,DWORD,LPGUID);
INT WINAPI WSCSetApplicationCategory(LPCWSTR,DWORD,LPCWSTR,DWORD,DWORD,DWORD*,LPINT);