Commit 3795484e authored by Bernhard Übelacker's avatar Bernhard Übelacker Committed by Alexandre Julliard

ws2_32: Add stub implementation for WSCGetProviderInfo.

parent ef23e618
...@@ -9002,6 +9002,27 @@ INT WINAPI WSCEnableNSProvider( LPGUID provider, BOOL enable ) ...@@ -9002,6 +9002,27 @@ INT WINAPI WSCEnableNSProvider( LPGUID provider, BOOL enable )
} }
/*********************************************************************** /***********************************************************************
* 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) * WSCGetProviderPath (WS2_32.86)
*/ */
INT WINAPI WSCGetProviderPath( LPGUID provider, LPWSTR path, LPINT len, LPINT errcode ) INT WINAPI WSCGetProviderPath( LPGUID provider, LPWSTR path, LPINT len, LPINT errcode )
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <windows.h> #include <windows.h>
#include <winternl.h> #include <winternl.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <ws2spi.h>
#include <wsipx.h> #include <wsipx.h>
#include <wsnwlink.h> #include <wsnwlink.h>
#include <mswsock.h> #include <mswsock.h>
...@@ -84,6 +85,7 @@ static int (WINAPI *pWSALookupServiceNextW)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSET ...@@ -84,6 +85,7 @@ static int (WINAPI *pWSALookupServiceNextW)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSET
static int (WINAPI *pWSAEnumNameSpaceProvidersA)(LPDWORD,LPWSANAMESPACE_INFOA); static int (WINAPI *pWSAEnumNameSpaceProvidersA)(LPDWORD,LPWSANAMESPACE_INFOA);
static int (WINAPI *pWSAEnumNameSpaceProvidersW)(LPDWORD,LPWSANAMESPACE_INFOW); static int (WINAPI *pWSAEnumNameSpaceProvidersW)(LPDWORD,LPWSANAMESPACE_INFOW);
static int (WINAPI *pWSAPoll)(WSAPOLLFD *,ULONG,INT); 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 */ /* Function pointers from iphlpapi */
static DWORD (WINAPI *pGetAdaptersInfo)(PIP_ADAPTER_INFO,PULONG); static DWORD (WINAPI *pGetAdaptersInfo)(PIP_ADAPTER_INFO,PULONG);
...@@ -1300,6 +1302,7 @@ static void Init (void) ...@@ -1300,6 +1302,7 @@ static void Init (void)
pWSAEnumNameSpaceProvidersA = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersA"); pWSAEnumNameSpaceProvidersA = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersA");
pWSAEnumNameSpaceProvidersW = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersW"); pWSAEnumNameSpaceProvidersW = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersW");
pWSAPoll = (void *)GetProcAddress(hws2_32, "WSAPoll"); pWSAPoll = (void *)GetProcAddress(hws2_32, "WSAPoll");
pWSCGetProviderInfo = (void *)GetProcAddress(hws2_32, "WSCGetProviderInfo");
hiphlpapi = LoadLibraryA("iphlpapi.dll"); hiphlpapi = LoadLibraryA("iphlpapi.dll");
if (hiphlpapi) if (hiphlpapi)
...@@ -11597,6 +11600,48 @@ static void test_iocp(void) ...@@ -11597,6 +11600,48 @@ static void test_iocp(void)
closesocket(dst); 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 ) START_TEST( sock )
{ {
int i; int i;
...@@ -11681,6 +11726,8 @@ START_TEST( sock ) ...@@ -11681,6 +11726,8 @@ START_TEST( sock )
test_completion_port(); test_completion_port();
test_address_list_query(); 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 */ /* this is an io heavy test, do it at the end so the kernel doesn't start dropping packets */
test_send(); test_send();
test_synchronous_WSAIoctl(); test_synchronous_WSAIoctl();
......
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
@ stdcall WSCDeinstallProvider(ptr ptr) @ stdcall WSCDeinstallProvider(ptr ptr)
@ stdcall WSCEnableNSProvider(ptr long) @ stdcall WSCEnableNSProvider(ptr long)
@ stdcall WSCEnumProtocols(ptr ptr ptr ptr) @ stdcall WSCEnumProtocols(ptr ptr ptr ptr)
@ stdcall WSCGetProviderInfo(ptr long ptr ptr long ptr)
@ stdcall WSCGetProviderPath(ptr ptr ptr ptr) @ stdcall WSCGetProviderPath(ptr ptr ptr ptr)
@ stdcall WSCInstallNameSpace(wstr wstr long long ptr) @ stdcall WSCInstallNameSpace(wstr wstr long long ptr)
@ stdcall WSCInstallProvider(ptr wstr ptr long ptr) @ stdcall WSCInstallProvider(ptr wstr ptr long ptr)
......
...@@ -33,12 +33,19 @@ extern "C" { ...@@ -33,12 +33,19 @@ extern "C" {
typedef BOOL (WINAPI *LPWPUPOSTMESSAGE)(HWND,UINT,WPARAM,LPARAM); 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); WSAEVENT WINAPI WPUCompleteOverlappedRequest(SOCKET,LPWSAOVERLAPPED,DWORD,DWORD,LPINT);
INT WINAPI WSCInstallProvider(const LPGUID,LPCWSTR,const LPWSAPROTOCOL_INFOW, INT WINAPI WSCInstallProvider(const LPGUID,LPCWSTR,const LPWSAPROTOCOL_INFOW,
DWORD,LPINT); DWORD,LPINT);
INT WINAPI WSCDeinstallProvider(LPGUID,LPINT); INT WINAPI WSCDeinstallProvider(LPGUID,LPINT);
INT WINAPI WSCEnableNSProvider(LPGUID,BOOL); INT WINAPI WSCEnableNSProvider(LPGUID,BOOL);
INT WINAPI WSCEnumProtocols(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD,LPINT); 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 WSCGetProviderPath(LPGUID,LPWSTR,LPINT,LPINT);
INT WINAPI WSCInstallNameSpace(LPWSTR,LPWSTR,DWORD,DWORD,LPGUID); INT WINAPI WSCInstallNameSpace(LPWSTR,LPWSTR,DWORD,DWORD,LPGUID);
INT WINAPI WSCSetApplicationCategory(LPCWSTR,DWORD,LPCWSTR,DWORD,DWORD,DWORD*,LPINT); INT WINAPI WSCSetApplicationCategory(LPCWSTR,DWORD,LPCWSTR,DWORD,DWORD,DWORD*,LPINT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment