Share via


ldap_create_page_control (Windows Embedded CE 6.0)

1/6/2010

This function creates a simple control for paging results.

Syntax

ULONG ldap_create_page_control(
  LDAP* ExternalHandle,
  ULONG PageSize,
  struct berval* Cookie,
  UCHAR IsCritical,
  LDAPControl** Control
);

Parameters

  • ExternalHandle
    [in] Session handle.
  • PageSize
    [in] 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] Tells the server whether this control is critical to the search.
  • Control
    [out] Pointer to the newly created control.

Return Value

The following table shows the possible return values.

Value Description

LDAP_SUCCESS

The call was completed successfully.

LDAP_UNAVAILABLE_CRIT_EXTENSION

The control is critical and the server does not support the control.

Remarks

This function creates a simple paged-results control. The control allows 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 you want returned in a single page. If you want the server to return results normally, and it cannot support this control, set the IsCritical parameter to FALSE.

When this function 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 the ldap_parse_result function to retrieve the first page of results.

Call the ldap_control_free function when the control is no longer needed.

Requirements

Header winldap.h
Library wldap32.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

LDAP Search Functions
ldap_control_free
ldap_parse_page_control
ldap_parse_result
ldap_search_ext
ldap_search_ext_s