2.2 Retrieving and Unpacking Object and Attribute Name Data

The following procedure explains how to retrieve data from a call to NWDSItrGetNext or NWDSItrGetPrev function when the information type of the iterator object consists of attribute names without values. If your result buffer is not big enough to hold all the requested data, you must retrieve the data and then repeat the call to retrieve the next set of data.

  1. Call NWDSAllocBuf to allocate the result buffer, which does not need to be initialized.

  2. Call either NWDSItrGetNext or NWDSItrGetPrev.

  3. Call NWDSGetObjectCount to determine the number of objects whose information is stored in the buffer.

  4. Call NWDSGetObjectName to get the name of the current object in the buffer and the count of attributes associated with the object.

  5. Call NWDSGetAttrName to retrieve the name of the attribute and the count of values associated with the attribute. For this information type, the number of values will always be zero.

  6. Repeat Step 5 until all attribute information for the object has been read.

  7. Loop to Step 4 until the information for all objects in the buffer has been retrieved.

  8. If the result buffer does not contain all the requested data, loop to Step 2 and call the request function again (either NWDSItrGetNext or NWDSItrGetPrev).

    If the result buffer contains all the requested data, continue with Step 9.

  9. Call NWDSFreeBuf to free the result buffer.

  10. Call NWDSItrDestroy to destroy the iterator object.

You must pull all information from the result buffer even if you do not plan to use it.

See Also