Sets the default name context for a specified tree.
#include <nwnet.h> or #include <nwdsconn.h> N_EXTERN_LIBRARY (NWDSCCODE) NWDSSetDefNameContext ( NWDSContextHandle context, nuint nameContextLen pnstr8 nameContext);
#include <nwdsconn.inc> Function NWDSSetDefNameContext (context : NWDSContextHandle; nameContextLen : nuint; nameContext : pnstr8 ) : NWDSCCODE;
(IN) Specifies the NDS context for the request or NULL for the preferred tree.
(IN) Specifies the length (in bytes) of the nameContext buffer.
(IN) Points to the name context value to set as default.
0x0000 0000 |
SUCCESSFUL |
nonzero value |
Nonzero values indicate errors. See |
NWDSSetDefNameContext sets the default name context for the tree specified in the context (or if the tree name isn’t set, the preferred tree name).
NWDSSetDefNameContext differs from NWSetDefaultNameContext in that NWDSSetDefNameContext has an added parameter, context, and operates on a per tree basis. Also, NWDSSetDefNameContext can return the name context in Unicode while NWSetDefaultNameContext could return only the data in local code page format.
The default name context for the preferred tree can be set by the DEFAULT NAME CONTEXT configuration parameter, or by calling either NWDSSetDefNameContext or NWSetDefaultNameContext. The default name context for another tree (different from the preferred tree) can be set only by calling NWDSSetDefNameContext.
The default name context can be from 0 to 257 bytes long for local code page strings (including the NULL), or 0 to 514 bytes long for Unicode strings (including the 2 bytes for NULL). If the nameContext buffer is too large, an error is returned and no data is copied.
If the underlying requester does not support multiple eDirectory trees, the default name context for the default tree will be returned (that is, the tree name specified in the context will be ignored).