Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function converts a user-friendly name to a distinguished name.

Syntax

ULONG ldap_ufn2dn(
  UNICODE PTCHAR 
ufn,
  UNICODE PTCHAR* 
pDn
);

Parameters

ufn

[in] Pointer to a null-terminated string containing the user-friendly name to be converted.

pDn

[out] Pointer to a variable that receives a pointer to a null-terminated string containing the resulting distinguished name.

If the pDnparameter comes back as non-NULL, you should free it when you are done with a call to the ldap_memfreefunction.

Return Value

If this function succeeds, the return value is LDAP_SUCCESS.

If this function fails, it returns an error code. See the LDAP_RETCODEenumeration for a list of possible return values.

Remarks

This 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," this function 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.

Requirements

Header winldap.h
Library wldap32.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also