ldap_get_dnW function (winldap.h)

The ldap_get_dn function retrieves the distinguished name for a given entry.

Syntax

WINLDAPAPI PWCHAR LDAPAPI ldap_get_dnW(
  [in] LDAP        *ld,
  [in] LDAPMessage *entry
);

Parameters

[in] ld

The session handle.

[in] entry

The entry whose distinguished name is to be retrieved.

Return value

If the function succeeds, it returns the distinguished name as a pointer to a null-terminated character string.

If the function fails, it returns NULL and sets the session error parameters in the LDAP data structure.

Remarks

The ldap_get_dn function retrieves the distinguished name for an entry that was returned by ldap_first_entry, or ldap_next_entry. When the returned name is no longer needed, free the string by calling ldap_memfree.

Note

The winldap.h header defines ldap_get_dn as an alias that 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 is 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

LDAP

ldap_first_entry

ldap_memfree

ldap_next_entry