Advertisement
4_2005-2006 Windows API Call/ Explanation #161304

DUN (Dial-Up Networking) Statistics

Dial up networking (or RAS) statistics' availability differs depending on the windows platform. In windows 95 and 98 you can access the statistics via the Dyn_Data section of the registry. For windows NT you have to use one of the performance monitoring techniques, and for windows 2000 you probably can use the performance monitoring techniques also, but you can use the new RAS methods. If you think that is code can be voted then please rate this... http://munim.cjb.net

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Function VBGetRasStats95(clsVBRasStats As VBRasStats95) As Long
  Dim hKey As Long, rtn As Long, lngLen As Long, lResult As Long
  
  On Error GoTo StatErrorHandler
  lResult = RegOpenKeyEx(HKEY_DYN_DATA, "PerfStats\StatData", _
                     0&, KEY_READ, hKey)
  With clsVBRasStats
   lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\Buffer", _
              0&, ByVal 0&, .BufferOverrunErr, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\BytesRecvd", _
              0&, ByVal 0&, .BytesRcved, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\BytesXmit", _
              0&, ByVal 0&, .BytesXmited, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\ConnectSpeed", _
              0&, ByVal 0&, .ConnectSpeed, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\CRC", _
              0&, ByVal 0&, .CrcErr, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\Alignment", _
              0&, ByVal 0&, .AlignmentErr, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\FramesRecvd", _
              0&, ByVal 0&, .FramesRcved, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\FramesXmit", _
              0&, ByVal 0&, .FramesXmited, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\Framing", _
              0&, ByVal 0&, .FramingErr, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\Overrun ", _
              0&, ByVal 0&, .HardwareOverrunErr, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\Runts", _
              0&, ByVal 0&, .Runts, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\Timeout", _
              0&, ByVal 0&, .TimeoutErr, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\TotalBytesRecvd", _
              0&, ByVal 0&, .TotalBytesRcved, lngLen)
   lResult = lResult Or rtn: lngLen = 4
   rtn = RegQueryValue(hKey, "Dial-Up Adapter\TotalBytesXmit", _
              0&, ByVal 0&, .TotalBytesXmited, lngLen)
   lResult = lResult Or rtn
  End With
StatErrorHandler:
  RegCloseKey hKey
  VBGetRasStats95 = lResult
End Function
Original Comments (3)
Recovered from Wayback Machine