Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

ldap_compare_s function

Use the ldap_compare_s function to determine whether an attribute for a given entry holds a known value.

Syntax


ULONG ldap_compare_s(
  _In_  LDAP *ld,
  _In_  PCHAR dn,
  _In_  PCHAR attr,
  _In_  PCHAR value
);

Parameters

ld [in]

The session handle.

dn [in]

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

attr [in]

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

value [in]

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

Return value

If the 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 the function fails, it returns an error code. See Return Values for more information.

Remarks

The ldap_compare_s function initiates a synchronous compare operation, comparing the value of an attribute to a known string value. Use ldap_compare_ext_s if you need to compare binary values. Use ldap_compare or ldap_compare_ext to carry out an asynchronous compare operation.

Multithreading: Calls to ldap_compare_s are thread-safe.

Note  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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winldap.h

Library

Wldap32.lib

DLL

Wldap32.dll

Unicode and ANSI names

ldap_compare_sW (Unicode) and ldap_compare_sA (ANSI)

See also

Functions
ldap_bind
ldap_compare
ldap_compare_ext
ldap_compare_ext_s
ldap_simple_bind
Return Values

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.