Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45801 Signed-off-by: Aaro Altonen a.altonen@hotmail.com --- dlls/ws2_32/socket.c | 17 +++++++++++++---- dlls/ws2_32/tests/sock.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index c284f595ab..700e93894d 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -9006,12 +9006,21 @@ INT WINAPI WSCEnableNSProvider( LPGUID provider, BOOL enable ) */ INT WINAPI WSCGetProviderPath( LPGUID provider, LPWSTR path, LPINT len, LPINT errcode ) { - FIXME( "(%s %p %p %p) Stub!\n", debugstr_guid(provider), path, len, errcode ); + if (!provider || !len || !path) { + if (errcode) + *errcode = WSAEFAULT; + return SOCKET_ERROR; + }
- if (!errcode || !provider || !len) return WSAEFAULT; + if (*len <= 0) { + if (errcode) + *errcode = WSAEFAULT; + return SOCKET_ERROR; + }
- *errcode = WSAEINVAL; - return SOCKET_ERROR; + FIXME("WSCGetProviderPath not implemented.\n"); + + return 0; }
/*********************************************************************** diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 60c5dfc63f..176a19bcfa 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -84,6 +84,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 *pWSCGetProviderPath)(LPGUID, LPWSTR, LPINT, LPINT);
/* Function pointers from iphlpapi */ static DWORD (WINAPI *pGetAdaptersInfo)(PIP_ADAPTER_INFO,PULONG); @@ -1300,6 +1301,7 @@ static void Init (void) pWSAEnumNameSpaceProvidersA = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersA"); pWSAEnumNameSpaceProvidersW = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersW"); pWSAPoll = (void *)GetProcAddress(hws2_32, "WSAPoll"); + pWSCGetProviderPath = (void *)GetProcAddress(hws2_32, "WSCGetProviderPath");
hiphlpapi = LoadLibraryA("iphlpapi.dll"); if (hiphlpapi) @@ -10600,6 +10602,39 @@ static void test_address_list_query(void) closesocket(s); }
+static void test_WSCGetProviderPath(void) +{ + GUID ProviderIdIP = { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0 } }; + wchar_t buffer[256]; + INT ret, err, len; + + ret = pWSCGetProviderPath(NULL, NULL, NULL, NULL); + ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); + + ret = pWSCGetProviderPath(&ProviderIdIP, NULL, NULL, NULL); + ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); + + ret = pWSCGetProviderPath(NULL, NULL, NULL, &err); + ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); + ok(err == WSAEFAULT, "Got unexpected error %d.\n", err); + + ret = pWSCGetProviderPath(&ProviderIdIP, NULL, NULL, &err); + ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); + ok(err == WSAEFAULT, "Got unexpected error %d.\n", err); + + len = -1; + ret = pWSCGetProviderPath(&ProviderIdIP, buffer, &len, &err); + ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); + ok(err == WSAEFAULT, "Got unexpected error %d.\n", err); + + /* WSCGetProviderPath() will return an error but if "ProviderIdIP" + * was valid, its path's length is written to "len" */ + len = -1; + ret = pWSCGetProviderPath(&ProviderIdIP, NULL, &len, &err); + ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); + ok(err == WSAEFAULT, "Got unexpected error %d.\n", err); +} + static DWORD WINAPI inet_ntoa_thread_proc(void *param) { ULONG addr; @@ -11681,6 +11716,8 @@ START_TEST( sock ) test_completion_port(); test_address_list_query();
+ test_WSCGetProviderPath(); + /* this is an io heavy test, do it at the end so the kernel doesn't start dropping packets */ test_send(); test_synchronous_WSAIoctl();
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65779
Your paranoid android.
=== wxppro (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w2008s64 (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w8 (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w8adm (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w864 (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w1064v1507 (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w1064v1809 (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w1064v1809_2scr (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w1064v1809_ar (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w1064v1809_he (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w1064v1809_ja (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w1064v1809_zh_CN (32 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w2008s64 (64 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w864 (64 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w1064v1507 (64 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== w1064v1809 (64 bit report) ===
ws2_32: sock.c:10628: Test failed: Got unexpected error 10022. sock.c:10635: Test failed: Got unexpected error 10022.
=== debian10 (32 bit report) ===
ws2_32: sock.c:3059: Test succeeded inside todo block: Test[2]: expected 0, got 0