ws2_32/tests: Add hostent struct tests for gethostbyname

Bruno Jesus 00cpxxx at gmail.com
Sat Apr 7 17:45:04 CDT 2012


Add tests required for bug 3962.

Some applications like the game Ragnarok uses non-standard ways to
read the ip address returned in hostent structure. Instead of reading
the IP list (h_addr_list) they jump straight to the point where the IP
should be in the windows structure if no aliases exist for the
hostname.

In the general case the first IP address must always be right after
the aliases list pointers. As a matter of example if hostent is in
0x2000, h_aliases must be in 0x2010 and the first IP must be in
0x2014. Four bytes are consumed in the h_aliases for each alias, since
there are no alias only a null item is counted (list terminator).

This rule is valid for >= XP, the patch has broken statements for
older OS's (that work the opposite way: ips first, aliases later). It
was tested in win98 and the usual testbot machines.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ws2_32-tests-update-gethostbyname-tests.patch
Type: application/octet-stream
Size: 1899 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20120407/3928714c/attachment.obj>


More information about the wine-patches mailing list