ldap_compare_ext_sW function (winldap.h)

Use the ldap_compare_ext_s function to determine if an attribute, for a given entry, holds a known value.

Syntax

WINLDAPAPI ULONG LDAPAPI ldap_compare_ext_sW(
  [in] LDAP          *ld,
  [in] const PWSTR   dn,
  [in] const PWSTR   Attr,
  [in] const PWSTR   Value,
  [in] berval        *Data,
  [in] PLDAPControlW *ServerControls,
  [in] PLDAPControlW *ClientControls
);

Parameters

[in] ld

The session handle.

[in] dn

A pointer to a null-terminated string that contains the distinguished name of the entry to compare.

[in] Attr

A pointer to a null-terminated string that contains the attribute to compare.

[in] Value

A pointer to a null-terminated string that contains the string attribute value to be compared to the attribute value. Set to NULL if not used.

[in] Data

The berval attribute value to be compared to the attribute value. Set to NULL if not used.

[in] ServerControls

Optional. A list of LDAP server controls. Set to NULL if not used.

[in] ClientControls

Optional. A list of LDAP client controls. Set to NULL if not used.

Return value

If the function succeeds, and the attribute and known values match, LDAP_COMPARE_TRUE is returned; if the values do not match, LDAP_COMPARE_FALSE is returned.

If the function fails, an error code is returned. For more information, see Return Values.

Remarks

The ldap_compare_ext_s function initiates a synchronous compare operation, comparing the value of an attribute to a known value. The parameters and effects of ldap_compare_ext_s subsume those of ldap_compare_s. The extended routine includes additional parameters to support client and server controls, and comparison of binary values.

Use the Value parameter for comparing string values or use the Data parameter for comparing raw binary data. Set the unused parameter to NULL. If neither parameter is NULL, the compare operation will use the value in the Data parameter.

Multithreading: Calls to ldap_compare_ext_s are thread-safe.

Note

The winldap.h header defines ldap_compare_ext_s as an alias that 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 is 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
Target Platform Windows
Header winldap.h
Library Wldap32.lib
DLL Wldap32.dll

See also

Extended Controls

Functions

Return Values

Using Controls

berval

ldap_compare_s