Adds an object to the eDirectory tree.
#include <nwnet.h> or #include <nwdsdsa.h> N_EXTERN_LIBRARY (NWDSCCODE) NWDSAddObject ( NWDSContextHandle context, pnstr8 objectName, pnint_ptr iterationHandle, nbool8 more, pBuf_T objectInfo);
uses netwin32 Function NWDSAddObject (context : NWDSContextHandle; objectName : pnstr8; iterationHandle : pnint_ptr; more : nbool8; objectInfo : pBuf_T ) : NWDSCCODE;
(IN) Specifies the NDS context for the request.
(IN) Points to the name of the object to be added.
(IN) Points to the iteration number. This should be set to NO_MORE_ITERATIONS initially.
(IN) Specifies whether additional information will be returned:
(IN) Points to a request buffer containing the attribute values for the new object.
These are common return value.
0x0000 0000 |
SUCCESSFUL |
0x8996 |
SERVER_OUT_OF_MEMORY |
0x89E2 |
TOO_FEW_FRAGMENTS |
0x89E3 |
TOO_MANY_FRAGMENTS |
0x89E4 |
PROTOCOL_VIOLATION |
0x89E5 |
SIZE_LIMIT_EXCEEDED |
0x89FD |
UNKNOWN_REQUEST |
0x89FD |
INVALID_PACKET_LENGTH |
0x89FE |
BAD_PACKET |
0x89FF |
Failure not related to eDirectory |
nonzero value |
Nonzero values indicate errors. See |
For NWDSAddObject to succeed, the new object’s immediate superior must already exist.
For information on setting the NDS context for the context parameter, see Section 1.1, Context Handles.
The objectName parameter identifies the name of the object to be added. For example,
CN=Elmer Fudd.OU=Looney Tunes.O=Acme.C=US.
The object can be an alias entry.
NOTE:If the iterationHandle parameter is set to 0 initially, NWDSAddObject will ignore the value and process the request as if -1 was passed.
If the more parameter is set to nonzero, NWDSAddObject will perform the necessary steps to iteratively call itself.
In order to iteratively call NWDSAddObject, the DS.NLM file must support the iteration feature or ERR_BUFFER_FULL will be returned.
All of an object’s mandatory attributes must be supplied for NWDSAddObject to succeed. For example, Object Class is a mandatory attribute for any object that is added. This is the base class of the object.
While eDirectory ensures that new objects conform to the eDirectory schema, if an alias is being created for an existing object, no check is made to ensure the alias’s Aliased Object Name attribute points to a valid object. This check occurs on the server when the aliased object name is translated to a local ID.
NWDSAddObject never dereferences aliases. The setting of the context flag associated with DCV_DEREF_ALIASES in the context field associated with DCK_FLAGS is ignored.
For more information, see Section 1.6, Add Object Requests.
For step-by-step instructions, see Adding an eDirectory Object.
For sample code, see ndsadd1.c.