_EVENT_CALLBACK callback function (rtmv2.h)

The RTM_EVENT_CALLBACK callback is used by the routing table manager to inform a client that the specified event occurred.

Syntax

_EVENT_CALLBACK EventCallback;

DWORD EventCallback(
  RTM_ENTITY_HANDLE RtmRegHandle,
  RTM_EVENT_TYPE EventType,
  PVOID Context1,
  PVOID Context2
)
{...}

Parameters

RtmRegHandle

Handle to the client to which the routing table manager is sending the notification.

EventType

Specifies the event about which the routing table manager is notifying the client. The following values are used.

Value Meaning
RTM_ENTITY_REGISTERED
A client has just registered with the routing table manager.
RTM_ENTITY_DEREGISTERED
A client has just unregistered.
RTM_ROUTE_EXPIRED
A route has timed out.
RTM_CHANGE_NOTIFICATION
A change notification has been made.

Context1

For RTM_ENTITY_REGISTERED calls: Contains the handle to the entity that registered.

For RTM_ENTITY_DEREGISTERED calls: Contains the handle to the entity that unregistered.

For RTM_ROUTE_EXPIRED calls: Contains the handle to the route that timed out.

For RTM_CHANGE_NOTIFICATION calls: Contains the handle to the change notification.

Context2

For RTM_ENTITY_REGISTERED calls: Contains a pointer to the RTM_ENTITY_INFO structure referred to by the handle in Context1. If the client must retain this information, the client must copy it to a structure it has allocated.

For RTM_ENTITY_DEREGISTERED calls: Contains a pointer to the RTM_ENTITY_INFO structure referred to by the handle in Context1. If the client must retain this information, the client must copy it to a structure it has allocated.

For RTM_ROUTE_EXPIRED calls: Contains a pointer to the RTM_ROUTE_INFO structure referred to by the handle in Context1. If the client must retain this information, the client must copy it to a structure it has allocated.

For RTM_CHANGE_NOTIFICATION calls: Contains the notification context that was given to the client by a previous call to RtmRegisterForChangeNotification.

Return value

If the routing table manager issues an RTM_ROUTE_EXPIRED callback, and the client returns to the routing table manager the value ERROR_NOT_SUPPORTED, the routing table manager will delete the route from the routing table.

All other errors returned by the client are ignored.

Remarks

After a client has registered for change notification, the routing table manager uses this callback to keep the client informed about events.

If a client receives an RTM_EVENT_CALLBACK for the RTM_ENTITY_REGISTERED or RTM_ENTITY_DEREGISTERED events, the client must not make calls to RtmRegisterEntity, RtmDeregisterEntity, or RtmGetRegisteredEntities in the context of this callback.

If a client receives an RTM_EVENT_CALLBACK for the RTM_CHANGE_NOTIFICATION event, the client must not call RtmRegisterForChangeNotification in the context of this callback.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header rtmv2.h

See also

RTM_EVENT_TYPE

RtmRegisterEntity