Kai Blin : ws2_32: Win NT4 does not zero the sockaddr_in structure on getsockname.

Alexandre Julliard julliard at winehq.org
Thu Sep 11 08:01:27 CDT 2008


Module: wine
Branch: master
Commit: 93f1d4874345286c61afc619ae4b9f6b6e0e9e0d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=93f1d4874345286c61afc619ae4b9f6b6e0e9e0d

Author: Kai Blin <kai.blin at gmail.com>
Date:   Thu Sep 11 14:23:37 2008 +0200

ws2_32: Win NT4 does not zero the sockaddr_in structure on getsockname.

All other versions of windows do, and this makes native dplay traces
much more readable, which is why Wine implements this as well. Mark
NT4 as broken, to make sure Wine doesn't regress.

---

 dlls/ws2_32/tests/sock.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 0643d00..01399b1 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -1858,6 +1858,7 @@ static void test_getsockname(void)
     int sa_set_len = sizeof(struct sockaddr_in);
     int sa_get_len = sa_set_len;
     static const unsigned char null_padding[] = {0,0,0,0,0,0,0,0};
+    int ret;
 
     if(WSAStartup(MAKEWORD(2,0), &wsa)){
         trace("Winsock failed: %d. Aborting test\n", WSAGetLastError());
@@ -1900,7 +1901,8 @@ static void test_getsockname(void)
         return;
     }
 
-    ok(memcmp(sa_get.sin_zero, null_padding, 8) == 0,
+    ret = memcmp(sa_get.sin_zero, null_padding, 8);
+    ok(ret == 0 || broken(ret != 0), /* NT4 */
             "getsockname did not zero the sockaddr_in structure\n");
 
     closesocket(sock);




More information about the wine-cvs mailing list