Share via


ldap_compare_s (Compact 2013)

3/26/2014

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

Syntax

ULONG ldap_compare_s(
  LDAP* ld,
  UNICODE PTCHAR dn,
  UNICODE PTCHAR attr,
  UNICODE PTCHAR value
);

Parameters

  • ld
    [in] Session handle.
  • dn
    [in] Distinguished name of the entry.
  • attr
    [in] Attribute to compare.
  • value
    [in] String attribute value to compare to the attribute value.

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 string value. Use the ldap_compare_ext_s function if you need to compare binary values. Use ldap_compare or ldap_compare_ext to carry out an asynchronous compare operation.

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

When connecting to an LDAP 2 server, the application must perform a bind operation, (by calling one of the ldap_bind or ldap_simple_bind routines) before attempting any other operations.

Requirements

Header

winldap.h

Library

wldap32.lib

See Also

Reference

LDAP Directory Entry Functions
LDAP_RETCODE
ldap_bind
ldap_compare
ldap_compare_ext
ldap_compare_ext_s
ldap_simple_bind