Platform SDK: Active Directory, ADSI, and Directory Services

ldap_get_next_page

The ldap_get_next_page function returns the next page in a sequence of asynchronous paged search results. This function is available in LDAP 3 and later.

ULONG ldap_get_next_page(
  PLDAP ExternalHandle,
  PLDAPSearch SearchHandle,
  ULONG PageSize,
  ULONG* MessageNumber
);

Parameters

ExternalHandle
[in] The session handle.
SearchHandle
[in] Handle to the search block.
PageSize
[in] The number of entries to return in a single page.
MessageNumber
[out] The message ID for the request.

Return Values

If the function succeeds, it returns the message ID of the operation.

If the function fails, it returns –1 and sets the session error parameters in the LDAP data structure.

Remarks

The ldap_get_next_page function is part of the interface for simple, asynchronous paging of search results. Use the search handle returned from an initial call to ldap_search_init_page and specify, in the PageSize parameter, the number of entries to be returned in a page. Set PageSize to zero to abandon a search.

Note that after each call to ldap_get_next_page, you must call ldap_get_paged_count for each set of results returned from the server. This allows the LDAP run time to save off the cookie that the server passed back to maintain the state of the search. Other than calling ldap_get_paged_count, the results you get back from ldap_get_next_page can be treated as any other search result, and should be freed when you're done by calling ldap_msgfree.

If you prefer to retrieve paged search results synchronously, use ldap_get_next_page_s.

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.

See Also

Functions, LDAP, ldap_get_next_page_s, ldap_get_paged_count, ldap_msgfree, ldap_search_init_page