#include <nwnet.h> or #include <nwdsdsa.h>NWDSCCODE N_API NWDSListByClassAndName (NWDSContextHandle context, pnstr8 objectName, pnstr8 className, pnstr8 subordinateName, pnint32 iterationHandle, pBuf_T subordinates;)
NWDSListByClassAndName controls the list output with filters on the class and/or name.
If the context flag associated with DCV_TYPELESS_NAMES is set, the returned list of object names in the buffer will be typeless. If the flag is off, the returned list will contain typed names.
The name given for className's filter is the name of an object class, such as User, Computer, or Server.
The value given for subordinateName's filter can be one of the following:
The location of the subordinate object(s) in the Directory tree is immediately subordinate to the object specified by objectName. It is not relative to the current name context in the Directory specified by context.
The relationship between className and subordinateName is an ``AND'' relationship.
When className and subordinateName are provided, a list of immediate subordinate objects restricted by both filters is returned.
When className is NULL and subordinateName is NULL, a list of all immediate subordinates is returned.
When className is provided and subordinateName is NULL, a list of immediate subordinates restricted only by className's filter is returned.
When className is NULL and subordinateName is provided, a list of immediate subordinates restricted only by subordinateName's filter is returned.
The following examples show how to use wildcards for untyped names:
If the wildcard name specified for subordinateName includes a type, such as ``CN,'' the name must include the equals (=) sign. The following examples show how to use wildcards for typed names:
iterationHandle controls retrieval of search results larger than the result buffer pointed to by subordinates.
Before the initial call to NWDSListByClassAndName, set the contents of the iteration handle pointed to by iterationHandle to NO_MORE_ITERATIONS.
If the result buffer holds the complete results when NWDSListByClassAndName returns from its initial call, the location pointed to by iterationHandle is set to NO_MORE_ITERATIONS. If the iterationHandle is not set to NO_MORE_ITERATIONS, use the iteration handle for subsequent calls to NWDSListByClassAndName in order to obtain further portions of the results. When the results are completely retrieved, the contents of the iteration handle will be set to NO_MORE_ITERATIONS.
To end the List operation before the complete results have been retrieved, call NWDSListByClassAndName with a value of DSV_SEARCH to free memory and states associated with the List operation.
Allocate the result buffer pointed to by subordinates, by calling NWDSAllocBuf. This result buffer does not need to be initialized because it is a result buffer.
Follow these steps to remove the contents from the result buffer:
Directory