#include <nwnet.h> or #include <nwdsname.h>NWDSCCODE N_API NWDSCanonicalizeName (NWDSContextHandle context, pnstr8 objectName, pnstr8 canonName);
The canonical form of a name includes the full path of the name (a complete name) with the naming attribute type specification for each naming component. Standard naming attribute type abbreviations are used where available. In addition, multiple white spaces are removed from the name.
For example, if the input is
CN=Elmer Fudd
and the name context is
OU=Looney Toons.O=Acme
the canonicalized name is
CN=Elmer Fudd.OU=Looney Toons.O=Acme
The canonicalized name will always contain types, regardless of the setting of the context flag associated with DCV_TYPELESS_NAMES.
objectName supplies the abbreviated form of a Directory name. The name can be typed or typeless. It can also be truncated. It is assumed that a truncated name is relative to the naming path supplied by the specified context.
canonName receives the canonical form of the name. The caller must allocate space for the canonicalized name. The size of the allocated memory is ((MAX_DN_CHARS)+1)*sizeof(character size) where character size is 1 for single-byte characters, and 2 for double-byte characters (Unicode is double byte). One character is used for NULL termination.
Directory