Mike Kaplinskiy : ws2_32: Implement SO_UPDATE_CONNECT_CONTEXT.

Alexandre Julliard julliard at winehq.org
Mon Aug 16 12:24:58 CDT 2010


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

Author: Mike Kaplinskiy <mike.kaplinskiy at gmail.com>
Date:   Sun Aug 15 12:42:17 2010 -0400

ws2_32: Implement SO_UPDATE_CONNECT_CONTEXT.

---

 dlls/ws2_32/socket.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index f129b08..39c1d2a 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -3496,7 +3496,7 @@ int WINAPI WS_sendto(SOCKET s, const char *buf, int len, int flags,
  *		setsockopt		(WS2_32.21)
  */
 int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
-                                  const char *optval, int optlen)
+                         const char *optval, int optlen)
 {
     int fd;
     int woptval;
@@ -3507,7 +3507,7 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
           s, level, optname, optval, optlen);
 
     /* some broken apps pass the value directly instead of a pointer to it */
-    if(IS_INTRESOURCE(optval))
+    if(optlen && IS_INTRESOURCE(optval))
     {
         SetLastError(WSAEFAULT);
         return SOCKET_ERROR;
@@ -3585,6 +3585,12 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
             TRACE("Ignoring SO_EXCLUSIVEADDRUSE, is always set.\n");
             return 0;
 
+        /* After a ConnectEx call succeeds, the socket can't be used with half of the
+         * normal winsock functions on windows. We don't have that problem. */
+        case WS_SO_UPDATE_CONNECT_CONTEXT:
+            TRACE("Ignoring SO_UPDATE_CONNECT_CONTEXT, since our sockets are normal");
+            return 0;
+
         /* SO_OPENTYPE does not require a valid socket handle. */
         case WS_SO_OPENTYPE:
             if (!optlen || optlen < sizeof(int) || !optval)




More information about the wine-cvs mailing list