[This is preliminary documentation and subject to change.]
The RtmCreateEnumerationHandle function returns a handle to use with RtmEnumerateGetNextRoute to scan through all routes or a subset of routes known to the Routing Table Manager (RTM).
HANDLE RtmCreateEnumerationHandle(
  DWORD  ProtocolFamily,     // type of network (IP or IPX)
  DWORD  EnumerationFlags,   // flags that specify type of criteria
  PVOID  CriteriaRoute       // structure that holds criteria values
);
 | EnumerationFlags | Values | 
|---|---|
| RTM_ONLY_THIS_NETWORK | Enumerate only those routes that have the same network number as the RR_Network member of the structure pointed to by CriteriaRoute. | 
| RTM_ONLY_THIS_INTERFACE | Enumerate only those routes that were obtained through the interface specified by the RR_InterfaceID member of the structure pointed to by CriteriaRoute. | 
| RTM_ONLY_THIS_PROTOCOL | Enumerate only those routes that were added by the protocol handler specified by the RR_RoutingProtocol field of the structure pointed to by CriteriaRoute. | 
| RTM_ONLY_BEST_ROUTES | Enumerate only the best routes to each of the networks in the set. | 
If the function succeeds, the return value is a HANDLE to use with subsequent enumeration calls.
If the function fails, or no routes exist with the specified criteria, the return value is NULL. Call GetLastError to obtain more information:
  Windows NT:  Use version 5.0 and later.
  Windows:  Unsupported.
  Windows CE:  Unsupported.
  Header: Declared in rtm.h.
  Import Library: Link with rtm.lib.
GetLastError, RTM_IP_ROUTE, RTM_IPX_ROUTE, RtmCloseEnumerationHandle, RtmEnumerateGetNextRoute