Edit

Share via


LDAPSortKeyA structure (winldap.h)

The LDAPSortKey structure stores sorting criteria for use by sort controls.

Syntax

typedef struct ldapsortkeyA {
  PCHAR   sk_attrtype;
  PCHAR   sk_matchruleoid;
  BOOLEAN sk_reverseorder;
} LDAPSortKeyA, *PLDAPSortKeyA;

Members

sk_attrtype

Pointer to a null-terminated string that specifies the name of the attribute to use as a sort key. Use multiple LDAPSortKey structures to specify multiple sort keys. Be aware that Active Directory supports only a single sort key.

sk_matchruleoid

Pointer to a null-terminated string that specifies the object identifier of the matching rule for the sort. Should be set to NULL if you do not want to explicitly specify a matching rule for the sort. Specifying an explicitly set matching rule is supported only by Windows Server 2003.

sk_reverseorder

If TRUE, specifies that the sort be ordered from lowest to highest. If FALSE, the sort order is from highest to lowest.

Remarks

The ldap_create_sort_control and ldap_search_init_page functions use this structure to specify how results should be sorted before being returned to the client.

Note

The winldap.h header defines LDAPSortKey as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Header winldap.h

See also

Data Structures

LDAP_SERVER_SORT_OID

Using Controls

ldap_create_sort_control

ldap_search_init_page