[pkg-wine-party] [SCM] Debian Wine packaging branch, lenny, updated. wine-1.0.0-1-126-gccc5cbd

Alexandre Julliard julliard at winehq.org
Thu Oct 30 14:44:04 UTC 2008


The following commit has been merged in the lenny branch:
commit 488ab26a836026c74cc1e35a19b80d76fe9ebd8b
Author: Daniel Santos <daniel.santos at pobox.com>
Date:   Thu Jul 17 13:52:51 2008 -0500

    ws2_32: WSASendTo() should clear last error on success.
    (cherry picked from commit b54b282a4f89da3809ae0e166a096bc0ebd6d52b)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 889f88f..31be2b9 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -2756,6 +2756,7 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
         }
         else NtQueueApcThread( GetCurrentThread(), (PNTAPCFUNC)ws2_async_apc,
                                (ULONG_PTR)wsa, (ULONG_PTR)iosb, 0 );
+        WSASetLastError(0);
         return 0;
     }
 
@@ -2820,6 +2821,7 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
     TRACE(" -> %i bytes\n", *lpNumberOfBytesSent);
 
     release_sock_fd( s, fd );
+    WSASetLastError(0);
     return 0;
 
 error:
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 8ee5c37..6ba6667 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -2078,6 +2078,34 @@ end:
         closesocket(v6);
 }
 
+static void test_WSASendTo(void)
+{
+    SOCKET s;
+    struct sockaddr_in addr;
+    char buf[12] = "hello world";
+    WSABUF data_buf;
+    DWORD bytesSent;
+
+    addr.sin_family = AF_INET;
+    addr.sin_port = htons(139);
+    addr.sin_addr.s_addr = inet_addr("127.0.0.1");
+    data_buf.len = sizeof(buf);
+    data_buf.buf = buf;
+
+    if( (s = socket(AF_INET, SOCK_DGRAM, 0)) == INVALID_SOCKET) {
+        ok(0, "socket() failed error: %d\n", WSAGetLastError());
+        return;
+    }
+
+    WSASetLastError(12345);
+    if(WSASendTo(s, &data_buf, 1, &bytesSent, 0, (struct sockaddr*)&addr, sizeof(addr), NULL, NULL)) {
+        ok(0, "WSASendTo() failed error: %d\n", WSAGetLastError());
+        return;
+    }
+    ok(!WSAGetLastError(), "WSAGetLastError() should return zero after "
+            "a successful call to WSASendTo()\n");
+}
+
 /**************** Main program  ***************/
 
 START_TEST( sock )
@@ -2117,6 +2145,8 @@ START_TEST( sock )
     test_send();
     test_write_events();
 
+    test_WSASendTo();
+
     test_ipv6only();
 
     Exit();

-- 
Debian Wine packaging



More information about the pkg-wine-party mailing list