RtmRegisterClient

[This is preliminary documentation and subject to change.]

The RtmRegisterClient function registers a client as a handler of the specified protocol. It establishes a route change notification mechanism for the client, and sets protocol options.

HANDLE RtmRegisterClient(
  DWORD ProtocolFamily,      // identifier of protocol family
  DWORD RoutingProtocol,     // identifier of routing protocol
  HANDLE ChangeEvent,        // event to signal when best routes change
  DWORD Flags                // flags to indicate special handling of 
                             // routing protocol
);
 

Parameters

ProtocolFamily
The protocol family of the routing protocol to register.
RoutingProtocol
The routing protocol identifier, same as used when registering with the router manager (see RegisterProtocol).
ChangeEvent
The Routing Table Manager (RTM) will signal this event when the best route to any network in the table changes. See RtmDequeueRouteChangeMessage for more information about route change notification.

This parameter is optional. If the caller specifies NULL for this parameter, the RTM will not notify the client of changes in best route status.

Flags
Miscellaneous options for special handling of the routing protocol. The following value is currently supported.
Flags Values
RTM_PROTOCOL_SINGLE_ROUTE The RTM will only keep one route per destination network for the routing protocol, that is, the RTM will replace route entries that have the same destination network numbers instead of adding new ones.

Return Values

On successful return, a HANDLE value that identifies the client in subsequent calls to the RTM.

A NULL handle indicates that the RTM was unable to register the client. Call GetLastError to obtain the reason for the failure.

ERROR_CLIENT_ALREADY_EXISTS
Another client has already registered to handle the specified protocol.
ERROR_INVALID_PARAMETER
The specified protocol family is not supported or the Flags parameter is invalid.
ERROR_NO_SYSTEM_RESOURCES
Insufficient resources to carry out the operation.
ERROR_NOT_ENOUGH_MEMORY
Insufficient memory to allocate data structures for the client.

QuickInfo

  Windows NT: Use version 5.0 and later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in rtm.h.
  Import Library: Link with rtm.lib.

See Also

GetLastError, RegisterProtocol, RTM Protocol Family Identifiers, RtmDequeueRouteChangeMessage, RtmDeregisterClient