Share via


ldap_create_sort_control (Compact 2013)

3/26/2014

This function formats a list of sort keys into a search control.

Syntax

ULONG ldap_create_sort_control(
  LDAP* ExternalHandle,
  LDAPSortKey** SortKeys,
  UCHAR IsCritical,
  LDAPControl** Control
);

Parameters

  • ExternalHandle
    [in] Session handle.
  • SortKeys
    [in] Pointer to an array of LDAPSortKey structures. Each structure in the array specifies the name of an attribute to use as a sort key, the matching rule for that key, and whether the sort order is ascending or descending.
  • IsCritical
    [in] Tells the server whether this control is critical to the search. 0 ==> False, !0 ==> True.
  • Control
    [out] Pointer to the newly created control.

Return Value

The following table shows the possible return values.

Value

Description

LDAP_SUCCESS

The call completed successfully.

LDAP_UNAVAILABLE_CRIT_EXTENSION

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

Remarks

This function creates a simple sort control. Such a control is useful when the LDAP client has limited functionality and cannot sort results, yet needs them sorted.

The sort controls allow a server to return a result code for the sorting of the results that is independent of the result code returned for the search operation.

To free the control when it is no longer needed, call the ldap_control_free function.

Requirements

Header

winldap.h

Library

wldap32.lib

See Also

Reference

LDAP Search Functions
ldap_control_free
LDAPSortKey