[1/3] ws2_32/tests: Call WSACleanup only once

André Hentschel nerv at dawncrow.de
Wed Mar 5 17:27:14 CST 2014


This is the code resulting from Brunos idea and fixes a lot of crashes on native:
> There are also these weird crashes when (I guess) WSACleanup is called
> twice to test the not initialized error.

---
 dlls/ws2_32/tests/sock.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 2252245..df1d076 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -1151,11 +1151,13 @@ static void Exit (void)
     ret = WSACleanup();
     err = WSAGetLastError();
     ok ( ret == 0, "WSACleanup failed ret = %d GetLastError is %d\n", ret, err);
-    ret = WSACleanup();
-    err = WSAGetLastError();
-    ok ( (ret == SOCKET_ERROR && err ==  WSANOTINITIALISED) ||
-         broken(ret == 0),  /* WinME */
-            "WSACleanup returned %d GetLastError is %d\n", ret, err);
+    if (0) /* crashes on native */
+    {
+        ret = WSACleanup();
+        err = WSAGetLastError();
+        ok ( ret == SOCKET_ERROR && err ==  WSANOTINITIALISED,
+             "WSACleanup returned %d GetLastError is %d\n", ret, err);
+    }
 }
 
 static void StartServer (LPTHREAD_START_ROUTINE routine,
-- 
1.8.1.2





More information about the wine-patches mailing list