ldap_addW function (winldap.h)
The ldap_add function initiates an asynchronous add operation to a directory tree. For an add operation to succeed, the parent of the entry added must exist, or the parent must be empty (equal to the distinguished name of the root).
WINLDAPAPI ULONG LDAPAPI ldap_addW( LDAP *ld, PWSTR dn, LDAPModW *  attrs );
The session handle.
A pointer to a null-terminated string that contains the distinguished name of the entry to add.
An array of pointers to LDAPMod structures. Each structure specifies a single attribute.
If the function succeeds, the message ID of the add operation is returned.
Before calling ldap_add, 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.
As an asynchronous function, ldap_add returns a message ID for the operation. Call ldap_result with the message ID to get the result of the operation. To cancel an asynchronous add operation before it has been completed, call ldap_abandon.
Multithreading: Calls to ldap_add are thread-safe, provided that LdapGetLastError is used to retrieve the actual session error code when the function call returns the -1 failure code.
The winldap.h header defines ldap_add 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|