Directory Services

DsCrackUnquotedMangledRdn

The DsCrackUnquotedMangledRdn function unmangles (unencodes) a given relative distinguished name and returns both the decoded GUID and the mangling type used.

BOOL DsCrackUnquotedMangledRdn(
  LPCTSTR pszRDN,
  DWORD cchRDN,
  GUID* pGuid,
  DS_MANGLE_FOR* peDsMangleFor
);

Parameters

pszRDN
[in] Pointer to a string that contains the relative distinguished name (RDN) to translate. This string length is specified by the cchRDN parameter, so this string is not required to be null-terminated. This string must be in unquoted form. For more information about unquoted relative distinguished names, see DsUnquoteRdnValue.
cchRDN
[in] Contains the length, in characters, of the pszRDN string.
pGuid
[out, optional] Pointer to GUID value that receives the GUID of the unmangled relative distinguished name. This parameter can be NULL.
peDsMangleFor
[out, optional] Pointer to a DS_MANGLE_FOR value that receives the type of mangling used in the mangled relative distinguished name. This parameter can be NULL.

Return Values

This function returns TRUE if the relative distinguished name is mangled or FALSE otherwise. If this function returns FALSE, neither pGuid or peDsMangleFor receive any data.

Remarks

This function attempts to decode (unmangle) an RDN that has been previously mangled due to a deletion or a naming conflict. If the relative distinguished name is mangled, the function returns TRUE and retrieves the GUID and mangle type, if requested. If the relative distinguished name is not mangled, the function returns FALSE.

Requirements

Client: Included in Windows XP.
Server: Included in Windows Server 2003.
Unicode: Implemented as Unicode and ANSI versions.
Header: Declared in Ntdsapi.h.
Library: Use Ntdsapi.lib.

See Also

DS_MANGLE_FOR, DsIsMangledDn, DsIsMangledRdnValue, DsUnquoteRdnValue, Domain Controller and Replication Management Functions