mIRC Home    About    Download    Register    News    Help

Print Thread
#185878 15/09/07 02:50 PM
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
I'm not 100% sure if it's the code I'm using that's causing it, but I do not think so.

Code:
alias wmiget {
  var %com = cominfo, %com2 = cominfo2, %com3 = cominfo3
  if ($com(%com)) { .comclose %com }
  if ($com(%com2)) { .comclose %com2 }
  if ($com(%com3)) { .comclose %com3 }
  .comopen %com WbemScripting.SWbemLocator
  var %x = $com(%com,ConnectServer,3,dispatch* %com2), %x = $com(%com2,ExecQuery,3,bstr*,select $prop from $1,dispatch* %com3), %x = $comval(%com3,$iif($2,$2,1),$prop)
  if ($com(%com)) { .comclose %com }
  if ($com(%com2)) { .comclose %com2 }
  if ($com(%com3)) { .comclose %com3 }
  return %x
}


Then if I try:
//say $wmiget(Win32_PerfRawData_Tcpip_NetworkInterface).BytesReceivedPersec
for example, it seems to work, but when that values seems to go over a certain value(2^31 I think, since it seems to be a signed int) it overflows, and starts going negative, anything to be done?

Joined: Dec 2002
Posts: 3,840
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 3,840
I have tested out your code and it seems to be fine, however the return value from WMI for this call is an I4 value, which is a signed 32bit integer. As far as I can tell, mIRC is correctly using the value that the WMI is passing back. It appears that WMI should be returning the value as an I8 or as text but it isn't.


Link Copied to Clipboard