ldap_add_ext
A version of this page is also available for
4/8/2010
This function initiates an asynchronous add operation to a tree. The parent of the entry being added must already exist or the parent must be empty (equal to the distinguished name of the root) for an add operation to succeed.
Syntax
ULONG ldap_add_ext(
LDAP* ld,
UNICODE PTCHAR dn,
LDAPMod* attrs[],
LDAPControlA** ServerControls,
LDAPControlA** ClientControls,
ULONG* MessageNumber
);
Parameters
- ld
[in] Session handle.
- dn
[in] Distinguished name of the entry to add.
- attrs
[in] Null-terminated array of pointers to LDAPMod structures. Each structure specifies a single attribute. See the Remarks section for more information.
- ServerControls
[in] List of LDAP server controls.
- ClientControls
[in] List of client controls.
- MessageNumber
[out] Message identifier for the request.
Return Value
If this function succeeds, the return value is LDAP_SUCCESS.
If this function fails, it returns an error code. See the LDAP_RETCODE enumeration for a list of possible return values.
Remarks
The parameters and effects of this function include those of the ldap_add function. The extended routine includes additional parameters to support client and server controls and thread safety.
Before calling this function, 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.
If the operation succeeds, this function passes the message identifier to the caller as a parameter. Call the ldap_result function with the message identifier to get the result of the operation.
If you prefer to have the results returned directly, use the synchronous function ldap_add_ext_s.
In a multithreading environment, calls to ldap_add_ext 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 functions before attempting other operations.
Requirements
Header | winldap.h |
Library | wldap32.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Reference
ldap_add
ldap_add_ext_s
ldap_bind
ldap_result
ldap_simple_bind
LDAPMod