$tagRasConn = "dword dwSize;hWnd hRasConn;char szEntryName[257];" & _
"char szDeviceType[17];char szDeviceName[129];" & _
"char szPhoneBook[261];dword dwSubEntry;int GuidEntry;" & _
"dword dwFlags;int Luid;int GuidCorrelationId"
$tRasConn = DllStructCreate($tagRasConn)
DllStructSetData($tRasConn, "dwSize", DllStructGetSize($tRasConn))
$ptRasConn = DllStructGetPtr($tRasConn)
$lpCb = DllStructCreate("byte")
DllStructSetData($lpCb, 1, DllStructGetSize($tRasConn))
$pRes = DllStructCreate("ulong")
$res = DllCall("RasAPI32.Dll", "dword", "RasEnumConnections", _
"ptr", $ptRasConn, _
"dword*", DllStructGetPtr($lpCb), _
"dword*", DllStructGetPtr($pRes))
$hRasConn = DllStructGetData($tRasConn, "hRasConn")
$tagRasStats = "dword dwSize;dword dwBytesXmited;dword dwBytesRcved;" & _
"dword dwFramesXmited;dword dwFramesRcved;dword dwCrcErr;" & _
"dword dwTimeoutErr;dword dwAlignmentErr;dword dwHardwareOverRunErr;" & _
"dword dwFramingErr;dword dwBufferOverRunErr;dword dwCompressionRatioIn;" & _
"dword dwCompressionRatioOut;dword dwBps;dword dwConnectDuration"
$tRasStats = DllStructCreate($tagRasStats)
DllStructSetData($tRasStats, "dwSize", DllStructGetSize($tRasStats))
$ptRasStats = DllStructGetPtr($tRasStats)
$GetStatistics = DllCall("RasAPI32.Dll", "dword", "RasGetConnectionStatistics", _
"hWnd", $hRasConn, "ptr", $ptRasStats)
msgBox(0, DllStructGetData($tRasConn, "szEntryName"), "Speed:" & DllStructGetData($tRasStats, "dwBps") / 1000000)
|