ldap_modify (Compact 2013)

3/26/2014

This function changes an existing entry.

Syntax

ULONG ldap_modify(
  LDAP* ld,
  UNICODE PTCHAR dn,
  LDAPMod* mods[]
);

Parameters

  • ld
    [in] Session handle.
  • dn
    [in] Name of the entry to modify.
  • mods
    [in] Null-terminated array of modifications to make to the entry.

Return Value

If this function succeeds, it returns the message identifier of the modify operation.

If this function fails, it returns -1 and sets the session error parameters in the LDAP data structure.

Remarks

This function initiates an asynchronous operation to modify an existing entry. If values are being added to or replaced in the entry, the function creates the attribute, if necessary. If values are being deleted, and no values remain, the function removes the attribute. All modifications are performed in the order in which they are listed.

As an asynchronous function, this function returns a message identifier for the operation. Call ldap_result with the message identifier to get the result of the operation. To cancel an asynchronous operation before it has completed, call ldap_abandon.

If you prefer to have the function return the results directly, use the synchronous routine ldap_modify_s. Use ldap_modify_ext or ldap_modify_ext_s if you need support for LDAP 3 servers and client controls.

In a multithreading environment, calls to ldap_modify are not thread-safe because the function returns a message identifier, rather than the return code. To determine whether the call returned an error value, you have to retrieve the return code from the connection block. It is possible for another thread to overwrite the return code before you retrieve it. Use ldap_modify_ext, ldap_modify_s, or ldap_modify_ext_s, all of which are thread-safe.

When connecting to an LDAP 2 server, the application must perform a bind operation by calling one of the ldap_bind or ldap_simple_bind routines before attempting any other operations.

Requirements

Header

winldap.h

Library

wldap32.lib

See Also

Reference

LDAP Directory Entry Functions
LDAP
ldap_abandon
ldap_bind
ldap_modify_ext
ldap_modify_ext_s
ldap_modify_s
ldap_result
ldap_simple_bind