Platform SDK: Active Directory, ADSI, and Directory Services |
The ldap_search_ext_s function searches the LDAP directory and returns a requested set of attributes for each entry matched.
ULONG ldap_search_ext_s( LDAP* ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly, PLDAPControl* ServerControls, PLDAPControl* ClientControls, struct l_timeval* timeout, ULONG SizeLimit, LDAPMessage** res );
If the function succeeds, the return value is LDAP_SUCCESS.
If the function fails, it returns an error code. See Return Values for more information.
The ldap_search_ext_s function initiates a synchronous search operation. The parameters and effects of ldap_search_ext_s subsume those of ldap_search_s. The extended routine includes additional parameters to support client and server controls, and to specify size and time limits for each search operation.
The scope of the search is determined by the value of the scope parameter, as follows:
Scope Constant | Meaning |
---|---|
LDAP_SCOPE_BASE | Search the base entry only. |
LDAP_SCOPE_ONELEVEL | Search all entries in the first level below the base entry, excluding the base entry. |
LDAP_SCOPE_SUBTREE | Search the base entry and all entries in the tree below the base. |
The LDAP_OPT_DEREF option in the Session Options also determines how the search is performed. Two other search options, LDAP_OPT_SIZELIMIT and LDAP_OPT_TIMELIMIT, are ignored in favor of the SizeLimit and TimeLimit option parameters in this function.
Upon completion of the search operation, ldap_search_ext_s returns to the caller. Use ldap_search_ext if you prefer to have the operation carried out asynchronously.
Multithreading: Calls to ldap_search_ext_s are thread-safe.
Windows NT/2000: Requires Windows NT 4.0 SP4 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in Winldap.h.
Library: Use Wldap32.lib.
Unicode: Declared as Unicode and ANSI prototypes.
Functions, ldap_search_ext, ldap_search_s, Return Values, Session Options