GetTcpStatisticsEx2 function

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

The GetTcpStatisticsEx2 function retrieves the Transmission Control Protocol (TCP) statistics for the current computer. The GetTcpStatisticsEx2 function differs from the GetTcpStatisticsEx function in that it uses a new output structure that contains 64-bit counters, rather than 32-bit counters.

Syntax


DWORD GetTcpStatisticsEx(
  _Out_ PMIB_TCPSTATS2 pStats,
  _In_  DWORD          dwFamily
);

Parameters

pStats [out]

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

dwFamily [in]

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

ValueMeaning
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 codeDescription
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 10, version 1709 [desktop apps only]

Minimum supported server

Windows Server 2016 [desktop apps only]

Header

Iphlpapi.h

Library

Iphlpapi.lib

DLL

Iphlpapi.dll

See also

IP Helper Start Page
IP Helper Function Reference

 

 

Show: