Platform SDK: Active Directory, ADSI, and Directory Services

ldap_modify_s

The ldap_modify_s function changes an existing entry.

ULONG ldap_modify_s(
  LDAP* ld,
  PCHAR dn,
  LDAPMod* mods[]
);

Parameters

ld
[in] The session handle.
dn
[in] The name of the entry to modify.
mods
[in] A null-terminated array of modifications to make to the entry.

Return Values

If the function succeeds, the return value is LDAP_SUCCESS.

If the function fails, it returns an error code. See Return Values for more information.

Remarks

The ldap_modify_s function initiates a synchronous 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, the function removes the attribute if no values remain. All modifications are performed in the order in which they are listed.

Multithreading: Calls to ldap_modify_s are thread-safe.

Note  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

  Windows NT/2000: Requires Windows NT 4.0 SP4 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Winldap.h.
  Library: Use Wldap32.lib.
  Unicode: Declared as Unicode and ANSI prototypes.

See Also

Functions, ldap_modify, ldap_modify_ext, ldap_modify_s, ldap_result, Modifying a Directory Entry, Return Values