Zebediah Figura : ws2_32: Do not translate STATUS_INVALID_PARAMETER to WSAEFAULT.

Alexandre Julliard julliard at winehq.org
Thu Jul 22 16:28:18 CDT 2021


Module: wine
Branch: master
Commit: 2c582b683d3fad478c437b54f648fdffc3d00b80
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2c582b683d3fad478c437b54f648fdffc3d00b80

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Jul 21 20:34:52 2021 -0500

ws2_32: Do not translate STATUS_INVALID_PARAMETER to WSAEFAULT.

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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;
 }
 




More information about the wine-cvs mailing list