-Fixed issue 7 by adding extended range of data for IP_ADDRESS in SysInfo.dll. 0-999 works as before and selects the installed interface. 1000-1999 will select only the active interfaces.

This commit is contained in:
Brian Todoroff 2009-04-13 05:45:08 +00:00
parent 68b4a260c7
commit 2f96eeed10

View File

@ -301,13 +301,30 @@ LPCTSTR GetString(UINT id, UINT flags)
if (NO_ERROR == GetIpAddrTable((PMIB_IPADDRTABLE)buffer, &len, FALSE)) if (NO_ERROR == GetIpAddrTable((PMIB_IPADDRTABLE)buffer, &len, FALSE))
{ {
PMIB_IPADDRTABLE ipTable = (PMIB_IPADDRTABLE)buffer; PMIB_IPADDRTABLE ipTable = (PMIB_IPADDRTABLE)buffer;
if (data < ipTable->dwNumEntries) if (data >= 1000)
{
data = data-999;
for(UINT i=0; i<ipTable->dwNumEntries; i++)
{
if((ipTable->table[i].wType)&MIB_IPADDR_DISCONNECTED) continue;
data--;
if(data==0)
{
DWORD ip = ipTable->table[i].dwAddr;
wsprintf(buffer, L"%i.%i.%i.%i", ip%256, (ip>>8)%256, (ip>>16)%256, (ip>>24)%256);
return buffer;
}
}
}
else if (data < ipTable->dwNumEntries)
{ {
DWORD ip = ipTable->table[data].dwAddr; DWORD ip = ipTable->table[data].dwAddr;
wsprintf(buffer, L"%i.%i.%i.%i", ip%256, (ip>>8)%256, (ip>>16)%256, (ip>>24)%256); wsprintf(buffer, L"%i.%i.%i.%i", ip%256, (ip>>8)%256, (ip>>16)%256, (ip>>24)%256);
return buffer; return buffer;
} }
} }
wsprintf(buffer, L"");
return buffer;
break; break;
case NET_MASK: case NET_MASK: