Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function sets options on connection blocks.

Syntax

ULONG ldap_set_option(
  LDAP* 
ld,
  int 
option,
  void* 
invalue
);

Parameters

ld

[in] Session handle.

option

[in] Name of the session option being set. For more information, see Session Options.

invalue

[in] Pointer to the value that the option is to be given. The actual type of this parameter depends on the setting of the option parameter. The constants LDAP_OPT_ON and LDAP_OPT_OFF can be given for options that have on or off settings.

Return Value

If this function succeeds, the return value is LDAP_SUCCESS.

If this function fails, it returns an error code. See the LDAP_RETCODEenumeration for a list of possible return values.

Remarks

Call this function to access the LDAPstructure that represents an LDAP session. Do not attempt to modify the LDAP data structure directly.

To enable signing/sealing, you have to turn on one of the following options prior to calling ldap_bind_s.

Copy Code
#define LDAP_OPT_SIGN	0x95
#define LDAP_OPT_ENCRYPT   0x96

To turn off signing/sealing, you have to close the connection by calling the ldap_unbindfunction on the connection handle.

In a multithreading environment, calls to ldap_set_optionare not thread-safe because it affects the connection as a whole.

Requirements

Header winldap.h
Library wldap32.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also