$iResult = DllCall("iphlpapi.dll", "dword", "GetIfTable", "ptr", 0, "ulong*", 0, "int", 1)
$tBinary = DllStructCreate("ubyte[" & $iResult[2] & "]")
$pBinary = DllStructGetPtr($tBinary)
$iResult = DllCall("iphlpapi.dll", "dword", "GetIfTable", "ptr", $pBinary, "ulong*", $iResult[2],
"int", 1)
$tNum = DllStructCreate("ulong", $pBinary)
$iNum = DllStructGetData($tNum, 1)
$pBinary += 4
Local $sIfIndices = ""
For $i = 1 to $iNum
$tBuffer = DllStructCreate("wchar[256];dword[5];byte[8];dword[16];char[256]", $pBinary)
$pBinary += DllStructGetSize($tBuffer)
If DllStructGetData($tBuffer, 2, 2) = 23 Then
$sIfIndices = "," & DllStructGetData($tBuffer, 2, 1) & ","
ExitLoop
ElseIf DllStructGetData($tBuffer, 2, 2) = 6 And DllStructGetData($tBuffer, 4, 2) = 5 Then
$sIfIndices &= "," & DllStructGetData($tBuffer, 2, 1) & ","
EndIf
Next
$iResult = DllCall("iphlpapi.dll", "dword", "GetAdaptersInfo", "ptr", 0, "ulong*", 0)
$tBinary = DllStructCreate("ubyte[" & $iResult[2] & "]")
$pBinary = DllStructGetPtr($tBinary)
$iResult = DllCall("iphlpapi.dll", "dword", "GetAdaptersInfo", "ptr", $pBinary, "ulong*", $iResult
[2])
$sBuffer = "ptr;dword;char[260];char[132];uint;byte[8];dword;uint[2];ptr;ptr;char[16];char[16];dword"
While $pBinary <> 0
$tBuffer = DllStructCreate($sBuffer, $pBinary)
$pBinary = DllStructGetData($tBuffer, 1)
If StringInStr($sIfIndices, "," & DllStructGetData($tBuffer, 7) & ",") Then
Msgbox(0, DllStructGetData($tBuffer, 11), DllStructGetData($tBuffer, 4))
EndIf
WEnd