Alex Henrie : ws2_32: Clear last error in WSASocketW.

Alexandre Julliard julliard at winehq.org
Mon Oct 18 16:16:29 CDT 2021


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

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Sun Oct 17 23:45:28 2021 -0600

ws2_32: Clear last error in WSASocketW.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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)
         {




More information about the wine-cvs mailing list