Export (0) Print
Expand All
Expand Minimize

ldap_add_s function

The ldap_add_s function initiates a synchronous add operation that adds an entry to a tree. The parent of the entry being added must already exist or the parent must be empty (equal to the root distinguished name) for an add operation to succeed.

Syntax


ULONG ldap_add_s(
  _In_  LDAP *ld,
  _In_  PCHAR dn,
  _In_  LDAPMod *attrs[]
);

Parameters

ld [in]

The session handle.

dn [in]

A pointer to a null-terminated string that contains the distinguished name of the entry to add.

attrs [in]

An array of pointers to LDAPMod structures. Each structure specifies a single attribute. See Remarks for more information.

Return value

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

Before calling ldap_add_s. you must create an entry by specifying its attributes in LDAPMod structures. Set the mod_op member of each structure to LDAP_MOD_ADD, and set the mod_type and mod_vals members as appropriate for your entry. See Modifying a Directory Entry for more information.

Upon completion of the add operation, ldap_add_s returns to the caller. Use ldap_add if you prefer to have the operation carried out asynchronously.

Multithreading: Calls to ldap_add_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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winldap.h

Library

Wldap32.lib

DLL

Wldap32.dll

Unicode and ANSI names

ldap_add_sW (Unicode) and ldap_add_sA (ANSI)

See also

Functions
ldap_add
ldap_bind
ldap_simple_bind
LDAPMod
Modifying a Directory Entry
Return Values

 

 

Show:
© 2014 Microsoft