ldap_result (Compact 2013)
3/26/2014
This function obtains the result of an asynchronous operation.
Syntax
ULONG ldap_result(
LDAP* ld,
ULONG msgid,
ULONG all,
LDAP_TIMEVAL* timeout,
LDAPMessage** res
);
Parameters
- ld
[in] Session handle.
- msgid
[in] Message identifier of the operation, or the constant LDAP_RES_ANY if any result is desired.
- all
[in] Specifies how many messages will be retrieved in a single call to this function. This parameter only has meaning for search results. Pass the constant LDAP_MSG_ONE (0x00) to retrieve one message at a time. Pass LDAP_MSG_ALL (0x01) to request that all results of a search be received before returning all results in a single chain. Pass LDAP_MSG_RECEIVED (0x02) to indicate that all results retrieved so far should be returned in the result chain.
- timeout
[out] A time-out specifying how long to wait (in seconds) for results to be returned. A NULL value causes this function to block until results are available. A time-out value of 0 seconds specifies a polling behavior.
- res
[out] Contains the results of the operation.
Return Value
If this function succeeds, it returns one a value to indicate the type of the first result in the res parameter. The following table shows the possible return values.
Return value |
---|
LDAP_RES_ADD |
LDAP_RES_BIND |
LDAP_RES_COMPARE |
LDAP_RES_DELETE |
LDAP_RES_EXTENDED |
LDAP_RES_MODDN |
LDAP_RES_MODIFY |
LDAP_RES_SEARCH_ENTRY |
LDAP_RES_SEARCH_REFERENCE |
LDAP_RES_SEARCH_RESULT |
If the time-out expires, this function returns 0.
If this function fails, it returns -1 and sets the session error parameters in the LDAP data structure.
Remarks
This function retrieves the result of a previous, asynchronously initiated operation.
Note
Depending on the way it is called, this function may actually return a list or "chain" of messages.
For connectionless LDAP, you must pass both an LDAP connection handle and a message identifier to ensure that you get the correct results. The LDAP run time continues to send the request until it receives a response.
In a multithreading environment, calls to this function are thread-safe.
Requirements
Header |
winldap.h |
Library |
wldap32.lib |