Platform SDK: Active Directory, ADSI, and Directory Services

ldap_get_dn

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

PCHAR ldap_get_dn(
  LDAP* ld,
  LDAPMessage* entry 
);

Parameters

ld
[in] The session handle.
entry
[in] The entry whose distinguished name is to be retrieved.

Return Values

If the function succeeds, it returns the distinguished name as a 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.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP4 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Winldap.h.
  Library: Use Wldap32.lib.
  Unicode: Declared as Unicode and ANSI prototypes.

See Also

Functions, LDAP, ldap_first_entry, ldap_memfree, ldap_next_entry