mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
-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:
parent
68b4a260c7
commit
2f96eeed10
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user