RtmCreateNextHopEnum function (rtmv2.h)

The RtmCreateNextHopEnum enumerates the next hops in the next-hop list.


DWORD RtmCreateNextHopEnum(
  [in]  RTM_ENTITY_HANDLE RtmRegHandle,
  [in]  RTM_ENUM_FLAGS    EnumFlags,
  [in]  PRTM_NET_ADDRESS  NetAddress,
  [out] PRTM_ENUM_HANDLE  RtmEnumHandle


[in] RtmRegHandle

Handle to the client obtained from a previous call to RtmRegisterEntity.

[in] EnumFlags

Specifies which next hops to include in the enumeration. The following flags are used.

Constant Meaning
Enumerate next hops starting at the specified address/mask length (such as 10/8). The enumeration continues to the end of the next hop list.
Enumerate next hops in the specified range specified by the address/mask length (such as 10/8).
Enumerate next hops starting at 0/0. Specify NULL for NetAddress.

[in] NetAddress

Pointer to an RTM_NET_ADDRESS structure that contains the starting address of the enumeration. Specify NULL if EnumFlags contains RTM_ENUM_START.

[out] RtmEnumHandle

On input, RtmEnumHandle is a pointer to NULL.

On output, RtmEnumHandle receives a pointer to a handle to the enumeration. Use this handle in all subsequent calls to RtmGetEnumNextHops, RtmReleaseNextHops, and RtmDeleteEnumHandle.

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.

Value Meaning
A parameter contains incorrect information.
There is not enough memory to complete this operation.


If EnumFlags contains RTM_ENUM_RANGE, use NetAddress to specify the range of the routing table to enumerate. For example, if a client sets NetAddress to 10/8, next hops in the range to are returned.

When the enumeration handle is no longer required, release it by calling RtmDeleteEnumHandle.


Minimum supported client None supported
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header rtmv2.h
Library Rtm.lib
DLL Rtm.dll

See also