Export (0) Print
Expand All
Expand Minimize
0 out of 3 rated this helpful - Rate this topic

ldap_search_init_page function

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

Syntax


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

Parameters

ExternalHandle [in]

The session handle.

DistinguishedName [in]

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

ScopeOfSearch [in]

A data type that specifies one of the following values to indicate the scope of the search.

ValueMeaning
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.

 

SearchFilter [in]

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

AttributeList [in]

A null-terminated array of null-terminated 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 to be returned.

ServerControls [in]

A list of LDAP server controls.

ClientControls [in]

A list of client controls.

PageTimeLimit [in]

The time value, in seconds, that the client will wait for the server to return a page.

TotalSizeLimit [in]

The maximum number of entries the client will accept. The TotalSizeLimit value affects only the individual pages within the paged search (not the overall paged search). So if TotalSizeLimit is greater than page size, then TotalSizeLimit will have no effect.

SortKeys [in]

A pointer to an LDAPSortKey structure, which specifies the attribute type, the ordering rule, and the direction for the search.

Return value

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.

Call the ldap_search_abandon_page to free the returned structure.

Remarks

The ldap_search_init_page function creates an LDAPSearch structure for managing paged searches and returns a handle to the structure. The ldap_get_next_page, ldap_get_next_page_s, and ldap_get_paged_count functions require this search handle as a parameter. When the paged search is completed, call ldap_search_abandon_page to free this structure and its handle.

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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winldap.h

Library

Wldap32.lib

DLL

Wldap32.dll

Unicode and ANSI names

ldap_search_init_pageW (Unicode) and ldap_search_init_pageA (ANSI)

See also

Functions
GetLastError
LdapGetLastError
LDAPSearch
ldap_get_next_page
ldap_get_next_page_s
ldap_search_abandon_page
LDAPSortKey

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.