This patch attempts to clean up the ws_sockaddr_ipx to sockaddr_ipx conversions (and vice versa). I would really like if people could try this out: I don't have a working IPX network here. At least my very rudimentary tests indicate that this should still work for the TCP/IP case.
More details on the patch: * all ws_sockaddr structures must be considered to have a potentially different layout from their Unix counterparts. Sure for now we just borrow the Unix structs anyway but even sockaddr_in does not have the exact same fields on FreeBSD and Linux (although the binary layout is the same). And hopefully we will not borrow the Unix structs for long anyway. FreeBSD testing is another aspect I would appreciate help with (sin_len worries me). * the ws_sockaddr_ipx fields did not match those used by windows. Also ws_sockaddr_ipx was declared in the wrong header. * all conversions are now done in two functions: ws_sockaddr_ws2u and ws_sockaddr_u2ws. If there is a conversion to do then these are the only two places that should be affected. SUPPORTED_PF returns whether a given protocol family is supported or not. * the sockaddr* pointers may point to structures that are more than 16 bytes, typically 28 bytes for IP v6. I tried to take this into account, I hope I did not mess up (but I'm not sure Wine would support TCP/IP v6 anyway). * I modified WSOCK32_accept to call WSOCK32_getpeername thus avoiding the conversion issue entirely in WSOCK32_accept. * all other functions that were doing such conversions were modified to use the above functions. I also tried to make the error handling code more consistent wrt. WSAENOTSOCK, WSAEAFNOSUPPORT, etc. * removed ugly casts in the traces
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ "Utilisateur" (nom commun) : Mot utilisé par les informaticiens en lieu et place d'"idiot".