3.1.6.3.1 Search For One Object

  1. Generate a Read Directory Begin (section 3.1.6.4) event with the following arguments:

    • iDirectoryObjectType := iDirectoryObjectType

    • iFilter := iFilter

    • iAttributeList := iAttributeList

    • iAttributeSortOrder := Null

  2. If the rStatus value returned by the Read Directory Begin event is not set to DirectoryOperationResult.Success, rStatus MUST be set to the rStatus returned by the Read Directory Begin event, and processing MUST end.

  3. Let IteratorHandle be a HANDLE ([MS-DTYP] section 2.2.16) that MUST be initialized to the value returned by the Read Directory Begin (section 3.1.6.4) event in rQueryHandle.

  4. Generate a Read Directory Next (section 3.1.6.5) event with the following arguments:

    • iQueryHandle := IteratorHandle

  5. If the rStatus value returned by the Read Directory Next event is not set to DirectoryOperationResult.Success, rStatus MUST be set to the rStatus returned by the Read Directory Next event, and processing MUST end.

  6. Let DirObj be a DirectoryObject ADM element instance that MUST be initialized to the value returned by the Read Directory Next event in rDirectoryObject.

  7. Generate a Read Directory End (section 3.1.6.6) event with the following arguments:

    • iQueryHandle := IteratorHandle

  8. If the rStatus value returned by the Read Directory End event is not set to DirectoryOperationResult.Success, rStatus MUST be set to the rStatus returned by the Read Directory End event, and processing MUST end.

  9. rStatus MUST be set to DirectoryOperationResult.Success, rDirectoryObject MUST be set to the value of DirObj, and processing MUST end.