#include <nwnet.h> or #include <nwdsdsa.h>NWDSCCODE N_API NWDSSearch (NWDSContextHandle context, pnstr8 baseObjectName, nint scope, nbool8 searchAliases, pBuf_T filter, nuint32 infoType, nbool8 allAttrs, pBuf_T attrNames, pnint32 iterationHandle, nint32 countObjectsToSearch, pnint32 countObjectsSearched, pBuf_T objectInfo);
NWDSSearch succeeds if the base object is located, regardless of whether there are any subordinates to the base object.
baseObjectName identifies the object (or possibly the root) to which the search is relative. If the string is empty, the current context is selected as the base object.
scope takes one of three possible values:
0 | DS_SEARCH_ENTRY | Search applies only to the base object. |
1 | DS_SEARCH_SUBORDINATES | Search applies only to the immediate subordinates of the base object. |
2 | DS_SEARCH_SUBTREE | Search applies to the base object and all of its subordinates. |
----------------------------------------------------------------- | 0 | DS_SEARCH_ENTRY | Search applies only to the | | | | base object. | |------|------------------------|--------------------------------| | 1 | DS_SEARCH_SUBORDINATES| Search applies only to the | | | | immediate subordinates of the | | | | base object. | |------|------------------------|--------------------------------| | 2 | DS_SEARCH_SUBTREE | Search applies to the base | | | | object and all of its | | | | subordinates. | |------|------------------------|--------------------------------|
Aliases are dereferenced while locating the base object unless the context flag associated with DCV_DEREF_ALIASES is not set. Aliases among the subordinates of the base object are dereferenced during the search unless searchAliases is FALSE. If searchAliases is TRUE, the search continues in the subtree of the aliased object.
filter eliminates objects not of interest to the application. Information is returned only on objects which satisfy the filter.
infoType, allAttrs, and attrNames indicate what attribute information is requested.
infoType specifies whether both attribute names and attribute values are requested. True specifies attribute names only; FALSE specifies attribute names and values.
If allAttrs is TRUE, information about all attributes associated with the object is requested and attrNames is ignored (in which case, attrNames can be NULL). If allAttrs is FALSE, only the attributes specified byattrNames are requested.
If allAttrs is FALSE and attrNames is NULL, no attribute information is returned. infoType is not meaningful. In this case, the return value of NWDSRead determines whether the specified object exists, or whether access to the object is allowed.
The buffer pointed to by attrNames is used to explicitly specify the attributes to be returned.
iterationHandle controls the retrieval results that are larger than the result buffer pointed to by objectInfo.
Before calling NWDSSearch initially, set the contents of the iteration handle pointed to by iterationHandle to NO_MORE_ITERATIONS.
If the result buffer holds the complete results when NWDSSearch returns from its initial call, the location pointed to by iterationHandle is set to NO_MORE_ITERATIONS. If the iteration handle is not set to NO_MORE_ITERATIONS, use the iteration handle for subsequent calls to NWDSSearch 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 Search operation before the complete results have been retrieved, call NWDSCloseIteration with a value of DSV_SEARCH to free memory and states associated with the Search operation.
The level of granularity for partial results is an individual attribute value. If the attribute is a multivalued attribute and its values are split across two or more calls to NWDSSearch, the current object name, object info, and attribute name is repeated in each subsequent result buffer.
Currently, because of aliasing, searching a subtree can result (1) in duplicate entries or (2) in an infinite loop.
Follow these steps to search a region of the Direction:
You must pull all information from the result buffer even if you do not plan to use it.
Directory