winsock ipx improvements

Roderick Colenbrander thunderbird2k at gmx.net
Sat Jul 12 08:59:07 CDT 2003


Hi,

The following three patches improve wine's winsock ipx support. With these 
patches various games work now using IPX. For example C&C Red Alert (v 3.x) 
and Tiberian Sun, I expect other games to work too (Red Alert II ...).

First I'll start describing all patches. The patch wsnwlink.h.diff adds a new 
header to wine which is needed for the winsock improvements.

The patch called winsock.diff adds various new ipx stuff (IPX_PTYPE, 
IPX_ADDRESS ..) to the winsock dll. One new feature (IPX_PTYPE) needs a patch 
to the wineserver.

Inside the functions WS_getsockopt/WS_setsockopt the option IPX_PTYPE was 
missing. On windows this option can get/set the ipx packet type. The unix way 
to change the packet type is to change one of the members of the unix 
sockaddr_ipx structure. The winsock sockaddr_ipx structure lacks this member. 
:( Just adding the variable can't be done ofcourse since this structure is 
part of the official winsock api's. Mike McCormack advised me to add a 
wineserver call to get/set the packet type value. This new wineserver call 
can be found in wineserver.diff. I'm using the new call in 3 different places 
inside winsock: in WS_getsockopt, WS_setsockopt and in WS2_send.

There is one thing I don't like about my work. That part is quite hacky and 
because of this I didn't clean it up since it will likely be rejected. Inside 
ws2_send the winsock sockaddr structure is converted to its unix equivalent 
before sending the data by ws_sockaddr_ws2u. The packet type needs to be set 
to a variable of the unix sockaddr_ipx structure. Because of this I need my 
new wineserver call. The problem more is that my call needs the socket and I 
only have the fd. I tried using wine_server_fd_to_handle but I don't think 
that is the correct function to convert the fd back to the socket/handle. 
(didn't get good results) In the end I added the socket as a hack to the 
prototype of the function. Because I don't think it is the correct way, I 
didn't clean this part up. I hope we can find a more correct solution.

ChangeLog:
- implement getsockopt/setsockopt's IPX_PTYPE, IPX_ADDRESS and 
IPX_MAD_ADAPATER_NUM

Roderick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winsock.diff
Type: text/x-diff
Size: 4687 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20030712/af6051b8/winsock.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wsnwlink.h.diff
Type: text/x-diff
Size: 1772 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20030712/af6051b8/wsnwlink.h.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wineserver.diff
Type: text/x-diff
Size: 6217 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20030712/af6051b8/wineserver.bin


More information about the wine-patches mailing list