Const $tagMIB_IFROW = "wchar wszName[256];dword dwIndex;" & _
"dword dwType;dword dwMtu;" & _
"dword dwSpeed;dword dwPhysAddrLen;" & _
"byte PhysAddr[8];dword dwAdminStatus;" & _
"dword dwOperStatus;dword dwLastChange;" & _
"dword dwInOctets;dword dwInUcastPkts;" & _
"dword dwInNUcastPkts;dword dwInDiscards;" & _
"dword dwInErrors;dword dwInUnknownProtos;" & _
"dword dwOutOctets;dword dwOutUcastPkts;" & _
"dword dwOutNUcastPkts;dword dwOutDiscards;" & _
"dword dwOutErrors;dword dwOutQLen;" & _
"dword dwDescrLen;byte Descr[256]"
$tResult = _GetIfEntry(1)
Msgbox(0, @error, DllStructGetData($tResult, "dwType"))
Func _GetIfEntry($iIndex)
Local $tMIBIFROW, $iResult
$tMIBIFROW = DllStructCreate($tagMIB_IFROW)
DllStructSetData($tMIBIFROW, 2, $iIndex)
$iResult = DllCall("Iphlpapi.dll", "dword", "GetIfEntry", _
"ptr", DllStructGetPtr($tMIBIFROW))
Return SetError($iResult[0], 0, $tMIBIFROW)
EndFunc ;==>_GetIfEntry
|