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 188.8.131.52.5, the delete operation transforms the targeted object into a deleted-object or a tombstone, depending on the state of the Recycle Binoptional feature. The tree-delete operation performs, as described in [MS-ADTS] section 184.108.40.206.5.7.3, 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 220.127.116.11.5. 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 18.104.22.168.9 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 22.214.171.124.5, that indicates the reason for the failure.