5.161 RemoveObj

 procedure RemoveObj(o: DSName,treeDeletion: boolean): ULONG

The RemoveObj procedure performs a delete operation on the object whose DSName is o. If the value of parameter treeDeletion is true, then the tree-delete variation of the operation is performed. As described in [MS-ADTS] section, the delete operation transforms the targeted object into a deleted-object or a tombstone, depending on the state of the Recycle Bin optional feature. The tree-delete operation performs, as described in [MS-ADTS] section, a delete operation on all objects in the subtree rooted at the target object. All appropriate attributes (possibly including distinguishedName) are changed or removed from the deleted objects to conform to the invariants of [MS-ADTS] section Any changes that need to be made to the objects are performed as an originating update, except for changes required to remove linked attribute values, which are simply removed from the directory. Attributes and values that already conform to the invariants are not changed. See [MS-ADTS] section for more details on originating updates. If the delete operation succeeds, 0 is returned. Otherwise, this procedure returns an error code, as specified in [MS-ADTS] section, that indicates the reason for the failure.