ldap_compareA function (winldap.h)
Use the ldap_compare function to determine whether an attribute for a given entry holds a known value.
Syntax
WINLDAPAPI ULONG LDAPAPI ldap_compareA(
[in] LDAP *ld,
[in] const PSTR dn,
[in] const PSTR attr,
[in] PSTR value
);
Parameters
[in] ld
The session handle.
[in] dn
A pointer to a null-terminated string that contains the distinguished name of the entry.
[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 compare to the attribute value.
Return value
If the function succeeds, the message ID of the compare operation is returned.
If the function fails, it returns –1 and sets the session error parameters in the LDAP structure. This error can then be retrieved using LdapGetLastError.
Remarks
The ldap_compare function initiates an asynchronous compare operation, comparing the value of an attribute to a known string value. Use ldap_compare_ext or ldap_compare_ext_s to compare binary values. Use ldap_compare_s or ldap_compare_ext_s to perform a synchronous compare operation.
As an asynchronous function, ldap_compare returns a message ID for the operation. Call ldap_result with the message ID to get the result of the operation. To cancel an asynchronous operation before it has been completed, call ldap_abandon.
To have the function return the results directly, use the synchronous routine ldap_compare_s. Use ldap_compare_ext or ldap_compare_ext_s to enable support for LDAP 3 server and client controls.
Multithreading: Calls to ldap_compare are thread-safe, provided that LdapGetLastError is used to get the actual session error code when the function call returns the -1 failure code.
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 |