The SetIpForwardEntry function modifies an existing route in the local computer's IP routing table.

DWORD SetIpForwardEntry(
PMIB_IPFORWARDROW pRoute // pointer to route information );


  • pRoute
    Pointer to a MIB_IPFORWARDROW structure that specifies the new information for the existing route. The caller must specify PROTO_IP_NETMGMT for the dwForwardProto member of this structure. The caller must also specify values for the dwForwardIfIndex, dwForwardDest, dwForwardMask, dwForwardNextHop, and dwForwardPolicy members of the structure.

Return Values

If the function succeeds, the return value is NO_ERROR.

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

Value Description
ERROR_INVALID_PARAMETER The pRoute parameter is NULL, or SetIpFowardEntry is unable to read from the memory pointed to by pRoute, or one of the members of the MIB_IPFORWARDROW structure is invalid.
ERROR_NOT_SUPPORTED The IP transport is not configured on the local computer.
Other Use FormatMessage to obtain the message string for the returned error.


To create a new route in the IP routing table, use theCreateIpForwardEntry function.

The caller should not specify a routing protocol, such as PROTO_IP_OSPF, for the dwForwardProto member of the MIB_IPFORWARDROW structure. Routing protocol identifiers are used to identify route information received through the specified routing protocol only. For example, PROTO_IP_OSPF is used to identify route information received through the OSPF routing protocol only.

The dwForwardPolicy member of the MIB_IPFORWARDROW structure is currently unused. The caller should specify zero for this member.


Runs On Versions Defined in Include Link to
Windows CE OS 3.0 and later Iphlpapi.h   Iphlpapi.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CreateIpForwardEntry, DeleteIpForwardEntry, FormatMessage, MIB_IPFORWARDROW

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.