Platform SDK: Active Directory, ADSI, and Directory Services

Searching a Directory

Searches are by far the most common directory activity. The LDAP API lets you use a wide variety of search criteria and result-retrieval methods to find directory information. As with other LDAP operations, you can choose to perform a search synchronously or asynchronously. Extensions to the base LDAP API let you add sorting criteria and other extensions to your search request. Finally, there are three settings in the LDAP structure that affect the way searching occurs:

The ldap_search and ldap_search_s functions are the original (LDAP 2) asynchronous and synchronous search functions. If you want to specify a local timeout for a synchronous search, use ldap_search_st. The extended functions ldap_search_ext and ldap_search_ext_s support LDAP 3 server controls and client controls, and allow you to specify varying size and time limits for each search operation.

For more information, see Synchronous vs. Asynchronous Calls, ldap_search_init_page, and ldap_search_abandon_page.