The following procedure describes how to create an iterator object that has a search filter and that specifies selected attributes.
Call NWDSAllocFilter to allocate a filter expression tree.
Call NWDSAddFilterToken once for each search token to place the search-filter conditions in the expression tree.
Objects that do not meet the conditions of the search filter will not appear in the virtual list. For more information on search filters and search tokens, see Search Filter Components
(“NDK: Novell eDirectory Core Services”).
Call NWDSAllocBuf to allocate a filter buffer.
Call NWDSPutFilter to store the search-filter expression tree in the filter buffer.
To create a list with selected attributes, call NWDSAllocBuf to allocate the request buffer.
To read all attributes, set the allAttrs parameter to TRUE and skip to Step 9.
To read no attribute information, set the allAttrs parameter to NULL and skip to Step 8.
.
Call NWDSInitBuf to initialize the request buffer for a DSV_SEARCH operation.
Call NWDSPutAttrName once for each attribute name to place the names of the desired attributes into the request buffer.
This attribute filter restricts the virtual list to those objects that have the attributes contained in this list of attributes. Objects that do not have these attributes will not appear in the virtual list.
Set the allAttrs parameter of the NWDSItrCreateSearch function to FALSE.
Call NWDSItrCreateSearch to create the iterator object.
For sample code, see Section 4.4, Creating a Search Iterator and Displaying the Results: Example.