From d596fa18593b00d963c22311f58369b49e1097a6 Mon Sep 17 00:00:00 2001 From: Mike Kaplinskiy Date: Sun, 15 Aug 2010 12:42:17 -0400 Subject: [PATCH] ws2_32: Implement SO_UPDATE_CONNECT_CONTEXT. --- dlls/ws2_32/socket.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index f129b08be91..39c1d2a09c5 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)