SetTcpEntry (Compact 2013)

3/26/2014

This function sets the state of a TCP connection.

Syntax

DWORD SetTcpEntry(
  PMIB_TCPROW pTcpRow 
);

Parameters

  • pTcpRow
    [in] Pointer to a MIB_TCPROW structure identifying the TCP connection to modify and specifying the new state for the TCP connection. The caller must specify values for all the members in this structure.

Return Value

The function returns NO_ERROR (zero) if the function is successful.

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

Return code

Description

ERROR_ACCESS_DENIED

Access is denied.

ERROR_INVALID_PARAMETER

An input parameter is invalid, no action was taken. This error is returned if the pTcpRow parameter is NULL or the Row member in the MIB_TCPROW structure pointed to by the pTcpRow parameter is not set to MIB_TCP_STATE_DELETE_TCB.

ERROR_NOT_SUPPORTED

The IPv4 transport is not configured on the local device.

Other

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

Remarks

This function operates only on active connections. Therefore, the only state to which a TCP connection can be set is MIB_TCP_STATE_ESTAB.

Requirements

Header

iphlpapi.h

Library

Iphlpapi.lib

See Also

Reference

IP Helper Functions
MIB_TCPROW