Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

ldap_create_page_control function

Use the ldap_create_page_control function to create a basic control for paging results. Support for controls is available effective with LDAP 3, but whether the page control is supported or not is dependent on the particular server.


ULONG ldap_create_page_control(
  _In_   PLDAP ExternalHandle,
  _In_   ULONG PageSize,
  _In_   struct berval *Cookie,
  _In_   UCHAR IsCritical,
  _Out_  PLDAPControl *Control


ExternalHandle [in]

The session handle.

PageSize [in]

The number of entries to return in each page.

Cookie [in]

Pointer to a berval structure that the server uses to determine its location in the result set. This is an opaque structure that you should not access directly. Set to NULL for the first call to ldap_create_page_control.

IsCritical [in]

Notifies the server whether this control is critical to the search.

Control [out]

Pointer to the newly created control.

Return value

Return codeDescription

The call completed successfully.



The ldap_create_page_control function creates a simple paged-results control. The control enables the client to specify the rate at which an LDAP server returns the results of a search operation. This is useful when the client has limited resources and may not be able to process the entire result set from a given LDAP query, or when the client/server connection is slow.

To create the paged-results control, specify the number of entries to be returned in a single page. To return results normally, even if it cannot support this control, set the IsCritical parameter to FALSE.

This function creates the control - it does not verify that the server supports it, and consequently, does not return LDAP_UNAVAILABLE_CRIT_EXTENSION if the server does not support the control. However, it can return other standard LDAP return values, such as LDAP_NO_MEMORY or LDAP_PARAM_ERROR.

When ldap_create_page_control returns successfully, include the newly created control to the list of server controls in a call to ldap_search_ext or to ldap_search_ext_s. When the server returns the first page of results, call ldap_parse_result to retrieve the first page of results.

Call ldap_control_free when the control is no longer required.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]







Unicode and ANSI names

ldap_create_page_controlW (Unicode) and ldap_create_page_controlA (ANSI)

See also




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