Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Internet activity
#12
Reviving for precision.

1) how to use a function giving result a MIB_IF_TABLE2* variable, i can't get this to work in my code


MIB_IF_TABLE2* t=ActiviteInternet
or
ActiviteInternet(MIB_IF_ROW2* r)
whatever the best



derivated from:
Function ActiviteInternet
Code:
Copy      Help
type NET_LUID_LH %Value []%Info
type MIB_IF_ROW2 NET_LUID_LH'InterfaceLuid InterfaceIndex GUID'InterfaceGuid @Alias[257] @Description[257] PhysicalAddressLength !PhysicalAddress[32] !PermanentPhysicalAddress[32] Mtu Type TunnelType MediaType PhysicalMediumType AccessType DirectionType !InterfaceAndOperStatusFlags OperStatus AdminStatus MediaConnectState GUID'NetworkGuid ConnectionType %TransmitLinkSpeed %ReceiveLinkSpeed %InOctets %InUcastPkts %InNUcastPkts %InDiscards %InErrors %InUnknownProtos %InUcastOctets %InMulticastOctets %InBroadcastOctets %OutOctets %OutUcastPkts %OutNUcastPkts %OutDiscards %OutErrors %OutUcastOctets %OutMulticastOctets %OutBroadcastOctets %OutQLen
type MIB_IF_TABLE2 NumEntries MIB_IF_ROW2'Table[1]
dll iphlpapi #GetIfTable2 MIB_IF_TABLE2**Table
dll iphlpapi #GetIfTable2Ex Level MIB_IF_TABLE2**Table
dll iphlpapi FreeMibTable !*Memory

MIB_IF_TABLE2* t
int hr=GetIfTable2(&t); if(hr) end _s.dllerror("" "" hr)

for _i 0 t.NumEntries
,MIB_IF_ROW2& r=t.Table[_i]
,if(strcmp("my-adapter" F"{&r.Description%%S}")!=0) continue
,else break
FreeMibTable t
ret r


So I could get a MIB_IF_ROW2 pointer as result, and use initialized variable for specific adapter at QM start.

2)

isn't r.ReceiveLinkSpeed supposed returning download speed (like 410 kb/s)??
does not seem to work.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)