Поделиться через


GetTcpTable2 (Compact 2013)

3/26/2014

This function retrieves the IPv4 TCP connection table.

Syntax

ULONG WINAPI GetTcpTable2(
  __out    PMIB_TCPTABLE2 TcpTable,
  __inout  PULONG SizePointer,
  __in     BOOL Order
);

Parameters

  • TcpTable
    A pointer to a buffer that receives the TCP connection table as a MIB_TCPTABLE2 structure.
  • SizePointer
    On input, specifies the size of the buffer pointed to by the TcpTable parameter.

    On output, if the buffer is not large enough to hold the returned connection table, the function sets this parameter equal to the required buffer size.

  • Order
    A value that specifies whether the TCP connection table should be sorted. If this parameter is TRUE, the table is sorted in the order of:

    1. Local IP address
    2. Local port
    3. Remote IP address
    4. Remote port

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_INSUFFICIENT_BUFFER

The buffer pointed to by the TcpTable parameter is not large enough. The required size is returned in the PULONG variable pointed to by the SizePointer parameter.

This error is also returned if the pTcpTable parameter is NULL.

ERROR_INVALID_PARAMETER

The SizePointer parameter is NULL, or GetTcpTable2 is unable to write to the memory pointed to by the SizePointer parameter.

ERROR_NOT_SUPPORTED

This function is not supported on the operating system that is used on the local system.

Other

Use FormatMessage to obtain the message string for the returned error.

Remarks

The GetTcpTable2 function is an increased version of the GetTcpTable function that also retrieves information on the TCP offload state of the TCP connection.

See Also

Reference

IP Helper Functions
GetExtendedTcpTable
GetOwnerModuleFromTcpEntry
GetTcp6Table
GetTcpStatistics
GetTcpStatisticsEx
GetTcpTable
MIB_TCP6ROW2
MIB_TCP6TABLE
MIB_TCP6TABLE_OWNER_MODULE
MIB_TCP6TABLE_OWNER_PID
MIB_TCP6TABLE2
MIB_TCPROW
MIB_TCPROW_OWNER_MODULE
MIB_TCPROW_OWNER_PID
MIB_TCPROW2
MIB_TCPTABLE
MIB_TCPTABLE_OWNER_MODULE
MIB_TCPTABLE_OWNER_PID
MIB_TCPTABLE2
SetTcpEntry