3.1.6.5 Read Directory Next

This event MUST be generated with the following arguments:

Return Values:

  • rStatus: A DirectoryOperationResult that indicates the result of this directory operation.

  • rDirectoryObject: The next DirectoryObject ADM element instance from the collection of DirectoryObject ADM element instances that match the iFilter expressions supplied to the Read Directory Begin event that created the supplied iQueryHandle. The collection is ordered based on iAttributeSortOrder supplied to the Read Directory Begin event that created the supplied iQueryHandle. This value is populated with the attributes specified in iAttributeList supplied to the Read Directory Begin event that created the supplied iQueryHandle. This value is undefined if rStatus does not equal DirectoryOperationResult.Success.

The algorithm MUST perform the following actions to process this event:

  • Let ReadIterator be the ReadDirectoryIteratorState ADM element instance found in the ReadDirectoryIteratorStateCollection ADM element for which the value of the Handle ADM attribute equals the value of iQueryHandle. If no such ReadDirectoryIteratorState ADM element is found, processing MUST end. rStatus MUST be set to DirectoryOperationResult.GenericError.

  • Let NextResult be a list of attribute values initialized by removing the first sublist from ReadIterator.LDAPState and placing it in NextResult. If ReadIterator.LDAPState is empty, rStatus MUST be set to DirectoryOperationResult.EndOfData, and processing MUST end.

  • A Create ADM Element From LDAP Values (section 3.1.6.11) event MUST be generated with the following arguments:

    • iDirectoryObjectType := ReadIterator.DataElementType

    • iADMAttributes := ReadIterator.AttributeList

    • iLDAPAttributeList := ReadIterator.LDAPAttributeList

    • iValues := NextResult

  • rStatus MUST be set to the rStatus returned by the Create ADM Element From LDAP Values event. rDirectoryObject MUST be set to the rDirectoryObject returned by the Create ADM Element From LDAP Values event. Processing MUST end.