Platform SDK: Active Directory, ADSI, and Directory Services

ldap_ufn2dn

The ldap_ufn2dn function converts a user-friendly name to a distinguished name.

ULONG ldap_ufn2dn (
  PCHAR ufn,
  PCHAR* pDn
);

Parameters

ufn
[in] The user friendly name that needs to be converted.
pDn
[out] The distinguished name to apply to the ufn.

Return Values

If the function succeeds, the return value is LDAP_SUCCESS.

If the function fails, it returns an error code. See Return Values for more information.

Remarks

The ldap_ufn2dn function attempts to normalize a user-specified name to a distinguished name. For example, consider an LDAP directory format for a common name of "Lastname, Firstname." Given a directory name of "Jane Doe," lday_ufn2dn will attempt to normalize this to "Doe, Jane." The function follows RFC 1781 (add CN= if not present, add OU= if none present, and so on). If it runs into any problems at all while normalizing, the function returns a copy of what was passed. It then allocates the output string from the LDAP memory pool. If the pDn parameter comes back as non-NULL, you should free it when you're done with a call to 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_memfree, Return Values