ldap_delete function
The ldap_delete function deletes an entry from the directory tree.
Syntax
ULONG ldap_delete( _In_ LDAP *ld, _In_ PCHAR dn );
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.
Return value
If the function succeeds, it returns the message ID of the delete operation.
If the function fails, the return value is –1 and the function sets the session error parameters in the LDAP data structure. To retrieve this value, use LdapGetLastError.
Remarks
Call ldap_delete to remove a leaf entry from the directory tree. Be aware that LDAP does not support deletion of entire subtrees in a single operation. As an asynchronous function, ldap_delete 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 delete operation before it has completed, call ldap_abandon.
To have the function return the results directly, use the synchronous routine ldap_delete_s. Use ldap_delete_ext or ldap_delete_ext_s to enable support for LDAP 3 server and client controls.
Multithreading: Calls to ldap_delete are thread-safe, provided that LdapGetLastError is used to retrieve the actual session error code when the function call returns the -1 failure code.
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 any other operations.
Requirements
|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | ldap_deleteW (Unicode) and ldap_deleteA (ANSI) |
See also
- Functions
- ldap_abandon
- ldap_bind
- ldap_delete_ext
- ldap_delete_ext_s
- ldap_delete_s
- ldap_result
- ldap_simple_bind
- LDAP
- Modifying a Directory Entry
Send comments about this topic to Microsoft
Build date: 10/26/2012