ldap_compare_sW function (winldap.h)
Use the ldap_compare_s function to determine whether an attribute for a given entry holds a known value.
Syntax
WINLDAPAPI ULONG LDAPAPI ldap_compare_sW(
[in] LDAP *ld,
[in] const PWSTR dn,
[in] const PWSTR attr,
[in] PWSTR 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, 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
The winldap.h header defines ldap_compare_s as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
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 |