Export (0) Print
Expand All
Expand Minimize

ldap_result function

The ldap_result function obtains the result of an asynchronous operation.

Syntax


ULONG ldap_result(
  _In_   LDAP *ld,
  _In_   ULONG msgid,
  _In_   ULONG all,
  _In_   struct l_timeval *timeout,
  _Out_  LDAPMessage **res
);

Parameters

ld [in]

The session handle.

msgid [in]

The message ID of the operation, or the constant LDAP_RES_ANY if any result is required.

all [in]

Specifies how many messages are retrieved in a single call to ldap_result. 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 [in]

A timeout that specifies how long, in seconds, to wait for results to be returned. A NULL value causes ldap_result to block until results are available. A timeout value of zero seconds specifies a polling behavior.

res [out]

Contains the result(s) of the operation. Any results returned should be freed with a call to ldap_msgfree once they are no longer required by the application.

Return value

If the function succeeds, it returns one of the following values to indicate the type of the first result in the res parameter. If the time-out expires, the function returns 0.

If the function fails, it returns –1 and sets the session error parameters in the LDAP data structure.

LDAP_RES_ADD (0x69L)
LDAP_RES_BIND (0x61L)
LDAP_RES_COMPARE (0x6fL)
LDAP_RES_DELETE (0x6bL)
LDAP_RES_EXTENDED (0x78L)
LDAP_RES_MODIFY (0x67L)
LDAP_RES_MODRDN (0x6dL)
LDAP_RES_REFERRAL (0x73L)
LDAP_RES_SEARCH_ENTRY (0x64L)
LDAP_RES_SEARCH_RESULT (0x65L)

Remarks

The ldap_result function retrieves the result of a previous, asynchronously initiated operation. Be aware that, depending on the way it is called, ldap_result may actually return a list or "chain" of messages.

For connectionless LDAP, you must pass both an LDAP connection handle and a message ID to ensure that you get the correct results. The LDAP run time continues to send the request until it receives a response.

Multithreading: Calls to ldap_result are thread safe.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winldap.h

Library

Wldap32.lib

DLL

Wldap32.dll

See also

Functions
ldap_msgfree

 

 

Show:
© 2014 Microsoft