http://bugs.winehq.org/show_bug.cgi?id=23970
--- Comment #7 from Mike Kaplinskiy mike.kaplinskiy@gmail.com 2010-08-12 22:51:00 --- Wow I didn't think someone would intentionally misuse the API. Shame on me. MSDN clearly states and windows thoroughly enforces that ConnectEx can only be called on _bound_ sockets. Eve doesn't bind it's socket that it uses so the call fails on windows, but it succeeds on wine and leads to some crazy behavior that they probably didn't even test on windows yet.
Could you see if adding something like:
union generic_unix_sockaddr uaddr; unsigned int uaddrlen = sizeof(uaddr);
if (getsockname(fd, &uaddr.addr, &uaddrlen) != 0) { release_sock_fd(s, fd); SetLastError(wsaErrno()); return FALSE; } else if (!is_sockaddr_bound(&uaddr.addr, uaddrlen)) { release_sock_fd(s, fd); SetLastError(WSAEINVAL); return FALSE; }
instead of the FIXME comment inside WS2_ConnectEx helps? I don't have a git instance nearby to give you a diff, sorry. I'll give a proper patch on the weekend if noone else will.