NWDSERegisterForEvent

Registers a function to be used as a callback when a specific eDirectory event occurs.

Local Servers:blocking
Remote Servers:N/A
Classification:4.x, 5.x, 6.x
Platform:NLM
Service:eDirectory Event

Syntax

    #include <nwdsdsa.h> 
    #include <nwdsevnt.h> 
     
    N_EXTERN_LIBRARY (NWDSCCODE) NWDSERegisterForEvent  ( 
       nint      priority,  
       nuint32   type,  
       nint      (*handler) ( 
            nuint32   type,  
            nuint     size,  
            nptr     *data));
    

Parameters

priority
(IN) Specifies the state the eDirectory event will be in when it is reported (see Section 5.1, Event Priorities).
type
(IN) Specifies the type of the event for which the callback is being registered (see Section 5.2, Event Types).
handler
(IN) Points to a function to be used as a callback when the event specified by type occurs.

Return Values

0x0000

Successful

Negative Value

Negative values indicate errors. For error values, see NDS Return Values (NDK: Novell eDirectory Core Services).

Remarks

The handler parameter is a pointer to a function that is to be called when the specified eDirectory event occurs. The function is defined as follows:

type
(IN) Identifies the type of the event that has occurred. (See the type parameter above.
size
(IN) Specifies the size of the data that is returned for the event.
data
(IN) Points to the location of the data that contains information related to the event. See Section 5.2, Event Types for a list of the events and the structures associated with them.

The value returned by the callback must be 0 for success and any other value for failure. If the callback returns a nonzero value during a EP_INLINE priority event, the event will be aborted. The callback’s return values for the EP_JOURNAL and EP_WORK priority events are ignored.

WARNING:Your application must not modify the data at the location pointed to by data. Multiple callbacks can be registered for each event, and all of the callbacks receive that same data. When a callback returns, the information pointed to by data is passed into the next callback, if one is registered. Changing the information pointed to by data can produce unpredictable behavior in other callbacks. If you are going to modify the information pointed to by data, make a local copy of the information.

The callbacks are run on threads that do not have CLIB context. If you are using functions that need CLIB context, you must establish the context by calling SetThreadGroupID (NLM Threads Management).

See Also

NWDSEUnRegisterForEvent, NWDSERegisterForEventWithResult