分享

ldap

 yespon 2016-09-06

The ldap_search_ext_s function synchronously searches the LDAP directory and returns a requested set of attributes for each matched entry.

Syntax

No code example is currently available or this language may not be supported.

Parameters

ld [in]

Session handle.

base [in]

Pointer to a null-terminated string that contains the distinguished name of the entry at which to start the search.

scope [in]

Specifies one of the following values to indicate the search scope.

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.

filter [in]

Pointer to a null-terminated string that specifies the search filter. For more information, see Search Filter Syntax.

attrs [in]

A null-terminated array of pointers to null-terminated strings indicating which attributes to return for each matching entry. Pass NULL to retrieve all available attributes.

attrsonly [in]

Boolean value that should be zero if both attribute types and values are to be returned, nonzero if only types are required.

ServerControls [in]

A list of LDAP server controls.

ClientControls [in]

A list of client controls.

timeout [in]

Specifies both the local search time-out value, in seconds, and the operation time limit that is sent to the server within the search request.

SizeLimit [in]

A limit on the number of entries to return from the search. A value of zero indicates no limit.

res [out]

Contains the results of the search upon completion of the call. Can also contain partial results or extended data when the function call fails with an error code. Free returned results with a call to ldap_msgfree when no longer required by the application.

Return value

If the function succeeds, the return value is LDAP_SUCCESS.

If the function fails, it returns an error code, however ldap_search_ext_s can fail and can still allocate pMsg. For example, both LDAP_PARTIAL_RESULTS and LDAP_REFERRAL error code will allocate pMsg. For more information, see the following code example. For more information, see Return Values.

Remarks

The ldap_search_ext_s function initiates a synchronous search operation. The parameters and effects of ldap_search_ext_s include 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.

Use the ldap_set_option function with the ld session handle to set the LDAP_OPT_DEREF option that determine how the search is performed. For more information, see Session Options. 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 to have the operation performed asynchronously.

Multithreading: Calls to ldap_search_ext_s are thread-safe.

The following code example shows how to free pMsg in the event that ldap_search_ext_s fails.

No code example is currently available or this language may not be supported.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Winldap.h

Library

Wldap32.lib

DLL

Wldap32.dll

Unicode and ANSI names

ldap_search_ext_sW (Unicode) and ldap_search_ext_sA (ANSI)

See also

Extended Controls
Using Controls
Functions
LDAP
ldap_msgfree
ldap_search
ldap_search_s
ldap_search_st
ldap_search_ext
Return Values
Session Options

 

 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多