Kitutz / rainmeter

Automatically exported from code.google.com/p/rainmeter
0 stars 0 forks source link

SYSINFO IP_ADDRESS malfunctions with multiple cards #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. install on any machine with multiple TCP/IP interfaces
2. connect via one interface only
3. connect via another interface only

What is the expected output? What do you see instead?
the IP of the currently active connection should be returned, instead, the 
IP of the first interface (whether active or not) is returned... yielding 
0.0.0.0 if conection is via another interface

What version of the product are you using? On what operating system?
.14 on Windows XP SP3

Please provide any additional information below. If the problem is a 
related to some config option attaching a example is always a good idea. 
Try to keep it as simple as possible and make sure that it is a fully 
working Rainmeter config (i.e. it includes all graphics too).

This is an issue with SysInfo.dll, specifically the lines

[code]
case IP_ADDRESS:
                 if (NO_ERROR == GetIpAddrTable((PMIB_IPADDRTABLE)buffer, 
&len, FALSE))
                 {
                         PMIB_IPADDRTABLE ipTable = (PMIB_IPADDRTABLE)
buffer;
                         if (data < ipTable->dwNumEntries)
                         {
                                 DWORD ip = ipTable->table[data].dwAddr;
                                 wsprintf(buffer, L"%i.%i.%i.%i", ip%256, 
(ip>>8)%256, (ip>>16)%256, (ip>>24)%256);
                                 return buffer;
                         }
                 }
                 break; 
[/code]

Original issue reported on code.google.com by gscho...@gmail.com on 3 Mar 2009 at 2:23

GoogleCodeExporter commented 8 years ago
You need to use the '''SysInfoData''' to choose the interface. Currently there 
is no
functionality to choose the active interface automatically.

Original comment by kimmo.pekkola on 10 Mar 2009 at 5:15

GoogleCodeExporter commented 8 years ago
Will set this up so an id of 0-999 with give the nth installed interface and
1000-1999 will give the nth active interface.

Original comment by brian.to...@gmail.com on 13 Apr 2009 at 5:34

GoogleCodeExporter commented 8 years ago
r38 commits the changes for this

Original comment by brian.to...@gmail.com on 13 Apr 2009 at 5:45