Platform SDK: Active Directory, ADSI, and Directory Services

ldap_search_init_page

The ldap_search_init_page function initializes a search block for a simple paged-results search. This function is supported in LDAP 3.

PLDAPSearch ldap_search_init_page(
  PLDAP ExternalHandle,
  PCHAR DistinguishedName,
  ULONG ScopeOfSearch,
  PCHAR SearchFilter,
  PCHAR AttributeList[],
  ULONG AttributesOnly,
  PLDAPControl* ServerControls,
  PLDAPControl* ClientControls,
  ULONG PageTimeLimit,
  ULONG TotalSizeLimit,
  PLDAPSortKey* SortKeys
);

Parameters

ExternalHandle
[in] The session handle.
DistinguishedName
[in] The distinguished name of the entry at which to start the search.
ScopeOfSearch
[in] The scope of the search. See Remarks for a description.
SearchFilter
[in] The search filter.
AttributeList
[in] A null-terminated array of strings indicating which attributes to return for each matching entry. Pass NULL to retrieve all available attributes.
AttributesOnly
[in] A boolean value that should be zero if both attribute types and values are to be returned, nonzero if only types are wanted.
ServerControls
[in] A list of LDAP server controls.
ClientControls
[in] A list of client controls.
PageTimeLimit
[in] The amount of time the client will wait for the server to return a page.
TotalSizeLimit
[in] The maximum number of entries the client will accept.
SortKeys
[in] Pointer to an LDAPSortKey structure, which specifies the attribute type, the ordering rule, and the direction for the search.

Return Values

If the function succeeds, it returns a pointer to an LDAPSearch structure.

If the function fails, the return value is NULL. Use LdapGetLastError or GetLastError to retrieve the error code.

Remarks

Call ldap_search_init to begin a paged-results search. When the function returns, use the returned handle to call.

To determine whether a server supports paged-results searches, check the supportedControl property off of the root for an object identifier (OID) of 1.2.840.113556.1.4.319.

Requirements

  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.

See Also

Functions, GetLastError, LdapGetLastError LDAPSearch ldap_search_abandon_page LDAPSortKey