[PATCH 3/6] ws2_32: Do not translate STATUS_INVALID_PARAMETER to WSAEFAULT.

Zebediah Figura zfigura at codeweavers.com
Wed Jul 21 20:34:52 CDT 2021


This fixes a regression introduced by 5c009c17b3a212c3f5b0034c465077c0c593daae.

WeMod WXDrive calls bind() on every local address, but with a zero
sin6_scope_id, and gets confused when this returns WSAEFAULT. Actually this is
supposed to succeed on Windows, but prior to the aforementioned commit we would
return WSAEINVAL, and the program seems to be happy with that.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51493
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/ws2_32/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 88d30cb2802..b4786e54b38 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1847,7 +1847,7 @@ int WINAPI WS_bind( SOCKET s, const struct WS_sockaddr *addr, int len )
     HeapFree( GetProcessHeap(), 0, params );
     HeapFree( GetProcessHeap(), 0, ret_addr );
 
-    SetLastError( status == STATUS_INVALID_PARAMETER ? WSAEFAULT : NtStatusToWSAError( status ) );
+    SetLastError( NtStatusToWSAError( status ) );
     return status ? -1 : 0;
 }
 
-- 
2.30.2




More information about the wine-devel mailing list