|This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.|
This function searches the LDAP directory and returns a requested set of attributes for each entry matched.
ULONG ldap_search_s( LDAP* ld, UNICODE PTCHAR base, ULONG scope, UNICODE PTCHAR filter, UNICODE PTCHAR attrs, ULONG attrsonly, LDAPMessage** res );
[in] Session handle.
[in] Distinguished name of the entry at which to start the search.
[in] Specifies a value to indicate the scope of the search. The following table shows the possible values.
Searches the base entry only.
Searches all entries in the first level below the base entry, excluding the base entry.
Searches the base entry and all entries in the tree below the base.
[in] Pointer to a null-terminated string that specifies the search filter.
[in] Null-terminated array of strings indicating the attributes to return for each matching entry. Pass NULL to retrieve all available attributes.
[in] Boolean value that should be zero if both attribute types and values are to be returned and nonzero if only types are wanted.
[out] Contains the results of the search upon completion of the call.
If this function succeeds, the return value is LDAP_SUCCESS.
If this function fails, it returns an error code; however, this function can fail and can still allocate pMsg. See the example below for handling this behavior. See the LDAP_RETCODEenumeration for a list of possible return values.
This function initiates a synchronous search operation.
You can use the ldap_set_optionfunction with the ldsession handle to set the LDAP_OPT_SIZELIMIT, LDAP_OPT_TIMELIMIT, and LDAP_OPT_DEREF options that determine how the search is performed.
Upon completion of the search operation, ldap_search_sreturns to the caller. Use ldap_searchif you prefer to have the operation carried out asynchronously.
In a multithreading environment, calls to ldap_search_sare thread-safe.
|Windows Embedded CE||Windows CE .NET 4.0 and later|
|Windows Mobile||Windows Mobile Version 5.0 and later|