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

ldap_compare_ext function

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

Syntax


ULONG ldap_compare_ext(
  _In_   LDAP *ld,
  _In_   PCHAR dn,
  _In_   PCHAR Attr,
  _In_   PCHAR Value,
  _In_   struct berval *Data,
  _In_   PLDAPControl *ServerControls,
  _In_   PLDAPControl *ClientControls,
  _Out_  ULONG *MessageNumber
);

Parameters

ld [in]

The session handle.

dn [in]

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

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 be compared to the attribute value.

Data [in]

The berval attribute value to be compared to the attribute value.

ServerControls [in]

Optional. A list of LDAP server controls. This parameter should be set to NULL if not used.

ClientControls [in]

Optional. A list of client controls. This parameter should be set to NULL if not used.

MessageNumber [out]

The message ID for the compare operation.

Return value

If the function succeeds, LDAP_SUCCESS is returned.

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

Remarks

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

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.

If successful, ldap_compare_ext passes back the message ID for the operation in the MessageNumber parameter. Call ldap_result with the message ID to obtain the result of the compare. To have the function return the compare result directly, use the synchronous extended compare function ldap_compare_ext_s.

Multithreading: Calls to ldap_compare_ext are thread-safe.

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_extW (Unicode) and ldap_compare_extA (ANSI)

See also

Extended Controls
Using Controls
Functions
berval
ldap_compare
ldap_compare_ext_s
ldap_result
Return Values

 

 

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