[Wine-patches] ws2_32: Add hack for Sentinel SuperPro Server.

Alexander Morozov =?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Пт Мар 27 17:55:03 MSK 2009


----------- следующая часть -----------
From 2d0cb26561b1b9119506d6386f06911a334bdb98 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Fri, 27 Mar 2009 17:48:34 +0300
Subject: [PATCH] ws2_32: Add hack for Sentinel SuperPro Server.

---
 dlls/ws2_32/socket.c |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index bf0b7c6..c9d9a4e 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1451,20 +1451,31 @@ int WINAPI WS_bind(SOCKET s, const struct WS_sockaddr* name, int namelen)
                 }
                 if (bind(fd, &uaddr.addr, uaddrlen) < 0)
                 {
-                    int loc_errno = errno;
-                    WARN("\tfailure - errno = %i\n", errno);
-                    errno = loc_errno;
-                    switch (errno)
+                    if (name->sa_family == WS_AF_IPX)
                     {
-                    case EBADF:
-                        SetLastError(WSAENOTSOCK);
-                        break;
-                    case EADDRNOTAVAIL:
-                        SetLastError(WSAEINVAL);
-                        break;
-                    default:
-                        SetLastError(wsaErrno());
-                        break;
+                        struct sockaddr_ipx *sipx = &uaddr;
+                        sipx->sipx_port = 0;
+                        WARN("IPX: trying to bind to another port.\n");
+                        if (bind(fd, &uaddr.addr, uaddrlen) >= 0)
+                            res = 0;
+                    }
+                    if (res)
+                    {
+                        int loc_errno = errno;
+                        WARN("\tfailure - errno = %i\n", errno);
+                        errno = loc_errno;
+                        switch (errno)
+                        {
+                        case EBADF:
+                            SetLastError(WSAENOTSOCK);
+                            break;
+                        case EADDRNOTAVAIL:
+                            SetLastError(WSAEINVAL);
+                            break;
+                        default:
+                            SetLastError(wsaErrno());
+                            break;
+                        }
                     }
                 }
                 else
-- 
1.6.1.3.GIT



Подробная информация о списке рассылки Wine-patches