ldap_simple_bind_sW function (winldap.h)
The ldap_simple_bind_s function synchronously authenticates a client to a server, using a plaintext password.
Syntax
WINLDAPAPI ULONG LDAPAPI ldap_simple_bind_sW(
[in] LDAP *ld,
[in] PWSTR dn,
[in] PWSTR passwd
);
Parameters
[in] ld
The session handle.
[in] dn
The name of the user to bind as. The bind operation uses the dn and passwd parameters to authenticate the user.
[in] passwd
The password of the user specified in the dn parameter.
Return value
If the function succeeds, the return value is LDAP_SUCCESS.
If the function fails, it returns an error code. For more information, see Return Values.
Remarks
The ldap_simple_bind_s function initiates a simple synchronous bind operation to authenticate a client to an LDAP server. Subsequent bind calls can be used to reauthenticate using the same connection.
Upon completion of the bind operation, ldap_simple_bind_s returns to the caller. Use ldap_simple_bind if you prefer to have the operation carried out asynchronously. Be aware that if an LDAP 2 server is contacted, do not attempt other operations over the connection until the bind call has completed successfully.
Multithreading: Bind calls are unsafe because they apply to the connection as a whole. Use caution if threads share connections, and try to thread binds with other operations.
Note
The winldap.h header defines ldap_simple_bind_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 |