Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/ws2_32/socket.c | 1 + dlls/ws2_32/tests/sock.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index b3dab22ae6e..50ea15c5b0e 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -3363,6 +3363,7 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol, CloseHandle(handle); return INVALID_SOCKET; } + WSASetLastError(0); return ret;
done: diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 2bb219d7c0e..eadc47a8ea6 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -2418,7 +2418,7 @@ static void test_WSASocket(void) { SetLastError( 0xdeadbeef ); sock = WSASocketA( tests[i].family, tests[i].type, tests[i].protocol, NULL, 0, 0 ); - todo_wine_if (!tests[i].error || i == 7) + todo_wine_if (i == 7) ok(WSAGetLastError() == tests[i].error, "Test %u: got wrong error %u\n", i, WSAGetLastError()); if (tests[i].error) {
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/ws2_32/socket.c | 2 +- dlls/ws2_32/tests/sock.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 50ea15c5b0e..2db441bee3c 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1068,7 +1068,7 @@ int WINAPI bind( SOCKET s, const struct sockaddr *addr, int len )
if (!addr) { - SetLastError( WSAEAFNOSUPPORT ); + SetLastError( WSAEFAULT ); return -1; }
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index eadc47a8ea6..63f8149f160 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -10794,7 +10794,18 @@ static void test_bind(void) WSASetLastError(0xdeadbeef); ret = bind(s, NULL, 0); ok(ret == -1, "expected failure\n"); - todo_wine ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError()); + ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError()); + + WSASetLastError(0xdeadbeef); + ret = bind(s, NULL, sizeof(addr)); + ok(ret == -1, "expected failure\n"); + ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError()); + + addr.sa_family = AF_INET; + WSASetLastError(0xdeadbeef); + ret = bind(s, &addr, 0); + ok(ret == -1, "expected failure\n"); + ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError());
addr.sa_family = 0xdead; WSASetLastError(0xdeadbeef);
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=100260
Your paranoid android.
=== debiant2 (32 bit report) ===
ws2_32: afd.c:339: Test failed: got flags 0x43 afd.c:345: Test failed: got flags 0x41
Signed-off-by: Zebediah Figura zfigura@codeweavers.com