Platform SDK: Active Directory, ADSI, and Directory Services |
The ldap_search_st function searches the LDAP directory and returns a requested set of attributes for each entry matched. The function is identical to ldap_search_s, except that it takes an additional parameter that specifies a local time-out for the search.
ULONG ldap_search_st( LDAP* ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly, struct l_timeval* timeout, 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_st function initiates a synchronous search operation. The scope of the search is determined by the value of the scope parameter, as shown in the following table.
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. |
Two options in the LDAP structure also determine how the search is performed: LDAP_OPT_SIZELIMIT, and LDAP_OPT_DEREF. The timeout parameter in ldap_search_st overrides the LDAP_OPT_TIMELIMIT in the Session Options.
Upon completion of the search operation, ldap_search_st returns to the caller. Use ldap_search or ldap_search_ext if you prefer to have the operation carried out asynchronously.
Multithreading: Calls to ldap_search_st 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, ldap_search, ldap_search_s, ldap_search_ext, Session Options, Return Values