GetTcpStatisticsEx function

The GetTcpStatisticsEx function retrieves the Transmission Control Protocol (TCP) statistics for the current computer. The GetTcpStatisticsEx function differs from the GetTcpStatistics function in that GetTcpStatisticsEx also supports the Internet Protocol version 6 (IPv6) protocol family.

Syntax

IPHLPAPI_DLL_LINKAGE ULONG GetTcpStatisticsEx(
  PMIB_TCPSTATS Statistics,
  ULONG         Family
);

Parameters

Statistics

A pointer to a MIB_TCPSTATS structure that receives the TCP statistics for the local computer.

Family

The protocol family for which to retrieve statistics. This parameter must be one of the following values:

Value Meaning
AF_INET
Internet Protocol version 4 (IPv4).
AF_INET6
Internet Protocol version 6 (IPv6).

Return Value

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is one of the following error codes.

Return code Description
ERROR_INVALID_PARAMETER
The pStats parameter is NULL or does not point to valid memory, or the dwFamily parameter is not a valid value.
ERROR_NOT_SUPPORTED
This function is not supported on the operating system on which the function call was made.
Other
Use FormatMessage to obtain the message string for the returned error.

Requirements

   
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header iphlpapi.h
Library Iphlpapi.lib
DLL Iphlpapi.dll

See Also

GetIpStatisticsEx

GetTcpStatistics

GetUdpStatisticsEx

IP Helper Function Reference

IP Helper Start Page

MIB_TCPSTATS