---
name: "ldap_encode_sort_controlW"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/ldap_encode_sort_controlW"
---

# ldap\_encode\_sort\_controlW(3w)

## NAME

**ldap\_encode\_sort\_controlW** (WLDAP32.@)

## SYNOPSIS

ULONG CDECL  ldap\_encode\_sort\_controlW\
  (\
   WLDAP32\_LDAP\*  *ld*,\
   PLDAPSortKeyW\* *sortkeys*,\
   PLDAPControlW  *control*,\
   BOOLEAN        *critical*\
  )

## DESCRIPTION

Create a *control* for server sorted search results.

## PARAMS

*ld* **\[In\]**  Pointer to an **LDAP** context.

sortkey **\[In\]**  Array of LDAPSortKey structures, each specifying an attribute to use as a sort key, a matching rule and the sort order (ascending or descending).

*critical* **\[In\]**  Tells the server this *control* is *critical* to the search operation.

*control* **\[Out\]**  LDAPControl created.

## RETURNS

**Success:** **LDAP\_SUCCESS**

**Failure:** An **LDAP** error code.

## NOTES

This function is obsolete. Use its equivalent ldap\_create\_sort\_control instead.

## IMPLEMENTATION

Declared in **"winldap\_private.h"**.

Implemented in **"dlls/wldap32/control.c"**.
