Callback invocation sequence

If a search is successful, Client-Library invokes the directory callback with numentries as the total number of entries to be examined. If the search finds no entries, numentries is 0. If the search finds one or more entries, numentries gives the number of unexamined entries including the current entry.

The application examines all the entries simply by returning CS_CONTINUE from the callback each time Client-Library invokes the callback. ct_ds_lookup invokes the callback repeatedly until one of the following conditions is satisfied:

If asynchronous network I/O is in effect for the connection, all invocations of the directory callback occur before Client-Library invokes the application’s completion callback.

If synchronous network I/O is in effect for the connection, all invocations of the directory callback occur before ct_ds_lookup returns.