ldap_add_sW function (winldap.h)
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.
WINLDAPAPI ULONG LDAPAPI ldap_add_sW( [in] LDAP *ld, [in] PWSTR dn, [in] LDAPModW *  attrs );
The session handle.
A pointer to a null-terminated string that contains the distinguished name of the entry to add.
A null-terminated array of pointers to LDAPMod structures. Each structure specifies a single attribute. See Remarks for more information.
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.
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.
The winldap.h header defines ldap_add_s as an alias which 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 not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|