SetPerTcp6ConnectionStats (6 Parameters) function [IP Helper]

The SetPerTcp6ConnectionStats function sets a value in the read-write information for an IPv6 TCP connection. This function is used to enable or disable extended statistics for an IPv6 TCP connection.

ULONG WINAPI SetPerTcp6ConnectionStats(
  PMIB_TCP6ROW Row,
  TCP_ESTATS_TYPE EstatsType,
  PUCHAR Rw,
  ULONG RwVersion,
  ULONG RwSize,
  ULONG Offset
);

Parameters

  • Row
    A pointer to a MIB_TCP6ROW structure for an IPv6 TCP connection.

  • EstatsType
    The type of extended statistics for TCP to set. This parameter determines the data and format of information that is expected in the Rw parameter.

    This parameter can be one of the values from the TCP_ESTATS_TYPE enumeration type defined in the Tcpestats.h header file.

  • Rw
    A pointer to a buffer that contains the read-write information to set. The buffer should contain a value from the TCP_BOOLEAN_OPTIONAL enumeration for each structure member that specifies how each member should be updated.

  • RwVersion
    The version of the read-write information to be set. This parameter should be set to zero for Windows Vista and Windows Server "Longhorn".

  • RwSize
    The size, in bytes, of the buffer pointed to by Rw parameter.

  • Offset
    The offset, in bytes, to the member in the structure pointed to by the Rw parameter to be set.

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 parameter is incorrect. This error is returned if the Row parameter is a NULL pointer.
ERROR_NOT_FOUND This requested entry was not found. This error is returned if the TCP connection specified in the Row parameter could not be found.
Other Use FormatMessage to obtain the message string for the returned error.

Remarks

The SetPerTcp6ConnectionStats function is defined on Windows Vista and later.

The SetPerTcp6ConnectionStats function is used to set the value of a member in the read-write information for extended statistics for an IPv6 TCP connection. The SetPerTcp6ConnectionStats function can only set the value of a single DWORD member in a structure at a time. The type and format of the structure to be set is specified by the EstatsType parameter. The Rw parameter contains a pointer to the structure being passed. The member to set in this structure is specified by the Offset parameter. So this function may need to be called multiple times if more than a single member in a structure needs to be set.

The SetPerTcp6ConnectionStats function is used to enable or disable extended statistics for the IPv6 TCP connection passed in the Row parameter. Extended statistics on a TCP connection are disabled by default.

The GetTcp6Table function is used to retrieve the IPv6 TCP connection table on the local machine. This function returns a MIB_TCP6TABLE structure that contain an array of MIB_TCP6ROW entries. The Row parameter passed to the SetPerTcp6ConnectionStats function must be an entry for an existing IPv6 TCP connection.

The only version of TCP connection statistics currently supported is version zero. So the RwVersion parameter passed to SetPerTcp6ConnectionStats should be set to 0.

Once extended statistics are enabled on a TCP connection for IPv6, an application calls the GetPerTcp6ConnectionStats function to retrieve extended statistics on the TCP connection.

The GetPerTcp6ConnectionStats function is designed to use TCP to diagnose performance problems in both the network and the application. If a network based application is performing poorly, TCP can determine if the bottleneck is in the sender, the receiver or the network itself. If the bottleneck is in the network, TCP can provide specific information about its nature.

For information on extended TCP statistics on an IPv4 connection, see the GetPerTcpConnectionStats and SetPerTcpConnectionStats functions.

Requirements

Client Requires Windows Vista.
Server Requires Windows Server "Longhorn".
Header

Declared in Iphlpapi.h.

Library

Use Iphlpapi.lib.

DLL Requires Iphlpapi.dll.

See Also

GetPerTcp6ConnectionStats
GetPerTcpConnectionStats
GetTcp6Table
MIB_TCP6ROW
MIB_TCP6TABLE
SetPerTcpConnectionStats
TCP_BOOLEAN_OPTIONAL
TCP_ESTATS_TYPE