http://bugs.winehq.org/show_bug.cgi?id=6326
Summary: [PATCH] GetAdaptersInfo returns wrong value for IpMask Product: Wine Version: 0.9.21. Platform: All OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-net AssignedTo: wine-bugs@winehq.org ReportedBy: sveit@earthlink.net
It incorrectly returns "1.0.0.0" which is derived from dwBCastAddr. The following patch fixes the problem:
*** dlls/iphlpapi/iphlpapi_main.c.orig 2006-09-13 14:10:25.000000000 -0500 --- dlls/iphlpapi/iphlpapi_main.c 2006-09-28 09:16:52.000000000 -0500 *************** *** 722,728 **** if (firstIPAddr) { toIPAddressString(ipAddrTable->table[i].dwAddr, ptr->IpAddressList.IpAddress.String); ! toIPAddressString(ipAddrTable->table[i].dwBCastAddr, ptr->IpAddressList.IpMask.String); firstIPAddr = FALSE; } --- 722,728 ---- if (firstIPAddr) { toIPAddressString(ipAddrTable->table[i].dwAddr, ptr->IpAddressList.IpAddress.String); ! toIPAddressString(ipAddrTable->table[i].dwMask, ptr->IpAddressList.IpMask.String); firstIPAddr = FALSE; } *************** *** 731,737 **** currentIPAddr = nextIPAddr; toIPAddressString(ipAddrTable->table[i].dwAddr, currentIPAddr->IpAddress.String); ! toIPAddressString(ipAddrTable->table[i].dwBCastAddr, currentIPAddr->IpMask.String); nextIPAddr++; } --- 731,737 ---- currentIPAddr = nextIPAddr; toIPAddressString(ipAddrTable->table[i].dwAddr, currentIPAddr->IpAddress.String); ! toIPAddressString(ipAddrTable->table[i].dwMask, currentIPAddr->IpMask.String); nextIPAddr++; }