From: Dmitry Timoshkov dmitry@baikal.ru
recv() doesn't have it, and the whole idea of local socket cache seems a little bit fragile, especially wrt duplicated handles.
Wine-Bug: http://bugs.winehq.org/show_bug.cgi?id=58122 Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/ws2_32/socket.c | 6 ------ dlls/ws2_32/tests/sock.c | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 3a412b00c1e..f27dfa12302 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1026,12 +1026,6 @@ static int WS2_sendto( SOCKET s, WSABUF *buffers, DWORD buffer_count, DWORD *ret "addr_len %d, overlapped %p, completion %p\n", s, buffers, buffer_count, flags, addr, addr_len, overlapped, completion );
- if (!socket_list_find( s )) - { - SetLastError( WSAENOTSOCK ); - return -1; - } - if (!overlapped && !ret_size) { SetLastError( WSAEFAULT ); diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index f8d86950f3c..cdf3cb9d89d 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -7564,6 +7564,7 @@ static void test_WSASendMsg(void) ret = pWSASendMsg(INVALID_SOCKET, &msg, 0, NULL, NULL, NULL); ok(ret == SOCKET_ERROR, "WSASendMsg should have failed\n"); err = WSAGetLastError(); + todo_wine ok(err == WSAENOTSOCK, "expected 10038, got %ld instead\n", err);
WSASetLastError(0xdeadbeef); @@ -7723,8 +7724,9 @@ static void test_WSASendTo(void)
WSASetLastError(12345); ret = WSASendTo(INVALID_SOCKET, &data_buf, 1, NULL, 0, (struct sockaddr*)&addr, sizeof(addr), NULL, NULL); - ok(ret == SOCKET_ERROR && WSAGetLastError() == WSAENOTSOCK, - "WSASendTo() failed: %d/%d\n", ret, WSAGetLastError()); + ok(ret == SOCKET_ERROR, "WSASendTo() should fail\n"); + todo_wine + ok(WSAGetLastError() == WSAENOTSOCK, "got %d\n", WSAGetLastError());
len = sizeof(ret_addr); ret = getsockname(s, (struct sockaddr *)&ret_addr, &len);