RasGetLinkStatistics function (ras.h)

The RasGetLinkStatistics function retrieves accumulated statistics for the specified link in a RAS multilink connection.


DWORD RasGetLinkStatistics(
  [in]      HRASCONN  hRasConn,
  [in]      DWORD     dwSubEntry,
  [in, out] RAS_STATS *lpStatistics


[in] hRasConn

Handle to the connection. Use RasDial or RasEnumConnections to obtain this handle.

[in] dwSubEntry

Specifies the subentry that corresponds to the link for which to retrieve statistics.

[in, out] lpStatistics

Pointer to the RAS_STATS structure that, on output, receives the statistics.

On input, the dwSize member of this structure specifies the size of RAS_STATS. Use sizeof(RAS_STATS) to obtain this size.

This parameter cannot be NULL.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the following error codes or a value from Routing and Remote Access Error Codes or Winerror.h.

Value Meaning
At least one of the following is true: the hRasConn parameter is zero, the dwSubEntry parameter is zero, the lpStatistics parameter is NULL, or the value specified by the dwSize member of the RAS_STATS structure specifies a version of the structure that is not supported by the operating system in use.
The function could not allocate sufficient memory to complete the operation.
Use FormatMessage to retrieve the system error message that corresponds to the error code returned.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ras.h
Library Rasapi32.lib
DLL Rasapi32.dll

See also





Remote Access Service (RAS) Overview

Remote Access Service Functions