ldap_delete_sW function (winldap.h)

The ldap_delete_s function is a synchronous operation that removes a leaf entry from the directory tree.

Syntax

WINLDAPAPI ULONG LDAPAPI ldap_delete_sW(
  [in] LDAP        *ld,
  [in] const PWSTR dn
);

Parameters

[in] ld

The session handle.

[in] dn

A pointer to a null-terminated string that contains the distinguished name of the entry to delete.

Return value

If the function succeeds, the return value is LDAP_SUCCESS.

If the function fails, it returns an error code. For more information, see Return Values.

Remarks

Call ldap_delete_s 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 a synchronous operation, ldap_delete_s does not return until the operation is compete. Use ldap_delete or ldap_delete_ext to perform the delete operation asynchronously.

Multithreading: The ldap_delete_s function is 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 any other operations.
 

Note

The winldap.h header defines ldap_delete_s 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.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header winldap.h
Library Wldap32.lib
DLL Wldap32.dll

See also

Functions

Modifying a Directory Entry

Return Values

ldap_bind

ldap_delete

ldap_delete_ext

ldap_simple_bind