ldap_compare_ext_s (Compact 2013)

3/26/2014

This function determines whether an attribute for a given entry holds a known value.

Syntax

ULONG ldap_compare_ext_s(
  LDAP* ld,
  UNICODE PTCHAR dn,
  UNICODE PTCHAR Attr,
  UNICODE PTCHAR Value, 
  struct berval* Data,
  LDAPControl** ServerControls,
  LDAPControl** ClientControls
);

Parameters

  • ld
    [in] Session handle.
  • dn
    [in] Distinguished name of the entry to compare.
  • Attr
    [in] Attribute to compare.
  • Value
    [in] String attribute value to be compared to the attribute value. If it is not null, the data must be null.
  • Data
    [in] The berval attribute value to be compared to the attribute value. If it is not null, the value must be null.
  • ServerControls
    [in] List of LDAP server controls.
  • ClientControls
    [in] List of LDAP client controls.

Return Value

If this function succeeds, and the attribute and known values match, the return value is LDAP_COMPARE_TRUE. If the values do not match, the return value is LDAP_COMPARE_FALSE.

If this function fails, it returns an error code. See the LDAP_RETCODE enumeration for a list of possible return values.

Remarks

This function initiates a synchronous compare operation, comparing the value of an attribute to a known value. The parameters and effects of this function include those of the ldap_compare_s function. The extended routine includes additional parameters to support client and server controls and the 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.

In a multithreading environment, calls to this function are thread-safe.

Requirements

Header

winldap.h

Library

wldap32.lib

See Also

Reference

LDAP Directory Entry Functions
LDAP_RETCODE
berval
ldap_compare_s