Directory Services

ldap_delete_ext

The ldap_delete_ext function is an extended routine that removes a leaf entry from the directory tree.

ULONG ldap_delete_ext(
  LDAP* ld,
  PCHAR dn,
  PLDAPControl* ServerControls,
  PLDAPControl* ClientControls,
  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 delete.
ServerControls
[in] Optional. List of LDAP server controls. Set this paramater to NULL if not used.
ClientControls
[in] Optional. List of client controls. Set this paramater to NULL if not used.
MessageNumber
[out] The message ID for the request.

Return Values

If the function succeeds, LDAP_SUCCESS is returned.

If the function fails, an error code is returned. For more information, see Return Values.

Remarks

The ldap_delete_ext function removes a leaf entry from the directory tree. LDAP does not support deletion of entire subtrees in a single operation, however there is an extended control, LDAP_SERVER_TREE_DELETE_OID, that does provide for this.

The parameters and effects of ldap_delete_ext include those of ldap_delete. The extended routine includes additional parameters to support client and server controls and thread safety.

If the operation succeeds, ldap_delete_ext passes the message ID to the caller as a parameter when the operation returns successfully. To get the result of the operation, call ldap_result with the message ID.

To have the function return the results directly, use the synchronous routine ldap_delete_ext_s.

Multithreading: Calls to ldap_delete_ext are thread-safe.

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Unicode: Implemented as Unicode and ANSI versions on all platforms.
Header: Declared in Winldap.h.
Library: Use Wldap32.lib.

See Also

Extended Controls, Using Controls, Functions, ldap_delete, ldap_delete_ext_s, ldap_result, Modifying a Directory Entry, Return Values