Export (0) Print
Expand All
Expand Minimize

ldap_add_ext function

The ldap_add_ext function initiates an asynchronous add operation to a tree. The parent of the entry added must 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(
  _In_   LDAP *ld,
  _In_   PCHAR dn,
  _In_   LDAPMod *attrs[],
  _In_   PLDAPControl *ServerControls,
  _In_   PLDAPControl *ClientControls,
  _Out_  ULONG *MessageNumber
);

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. For more information, see the Remarks section.

ServerControls [in]

List of LDAP server controls.

ClientControls [in]

List of client controls.

MessageNumber [out]

The message ID for the request.

Return value

If the function succeeds, LDAP_SUCCESS is returned.

If the function fails, an error code is returned. For more information, see Error Handling.

Remarks

The parameters and effects of ldap_add_ext includes those of ldap_add. The extended routine includes additional parameters to support client and server controls and thread safety.

Before calling ldap_add_ext, create an entry by specifying its attributes in LDAPMod structures. Set the mod_op field of each structure to LDAP_MOD_ADD, and set the mod_type and mod_vals fields as appropriate for your entry.

If the operation succeeds, ldap_add_ext passes the message ID to the caller as a parameter. Call ldap_result with the message ID to get the result of the operation.

To have the results returned directly, use the synchronous function ldap_add_ext_s.

Multithreaded: Calls to ldap_add_ext 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 other operations.

ServerControls and ClientControls are optional and should be set to NULL if not used.

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_extW (Unicode) and ldap_add_extA (ANSI)

See also

Extended Controls
Using Controls
Error Handling
Functions
ldap_add
ldap_add_ext_s
ldap_bind
ldap_result
ldap_simple_bind
LDAPMod
Modifying a Directory Entry

 

 

Show:
© 2014 Microsoft