Registers a handler with the current process event thread. The handler is called when an event is received by the thread which matches the flags registered with the handler.
The handler is called with a parameter pointing to an EVENTINFO structure.
DWORD RegisterRtEventHandler( DWORD dwEventFlags, EVENTHANDLER pHandler );
typedef void (*EVENTHANDLER)(LPEVENTINFO pEventInfo);
dwEventFlags
pHandler
A non-zero handle value to be used when unregistering the handler. If the call fails then 0 is returned.
The event handler feature may be used in place of an explicit call to RtNotifyEvent. The first call to RegisterRtEventHandler causes an event thread to be created which in turn calls RtNotifyEvent. On return from that call it walks the list of registered handlers and calls those which match the event type just received. The call will fail if another thread has already called RtNotifyEvent, or if the maximum number of handlers has been registered. Currently the maximum is 16 (per process). The priority of the event thread defaults to 140 and may be changed before or after creating the thread by calling SetRtEventHandlerPriority.
Call UnregisterRtEventHandler to deactivate the handler.
This method is particularly useful when DSM events need to be processed in an RSL where is is not known whether the parent process also needs to process DSM events.
E_OK 0x0000
E_CONTEXT
E_LIMIT
E_PARAM
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 6.0 | intime/rt/include/rtdsm.h | rt.h | rt.lib |