RtlDeleteElementGenericTableAvl

BOOL *__stdcall RtlDeleteElementGenericTableAvl(PRTL_AVL_TABLE Table, PVOID Buffer){
  BOOL *result; 
  _RTL_BALANCED_LINKS *RightChild; 

  if( !Table->NumberGenericTableElements )
  {
LABEL_8:
    LOBYTE(result) = 0;
    return result;
  }
  RightChild = Table->BalancedRoot.RightChild;
  while( 1 )
  {
    result = (BOOL *)((__int64(__fastcall *)(PRTL_AVL_TABLE, PVOID, _RTL_BALANCED_LINKS *))Table->CompareRoutine)(
                       Table,
                       Buffer,
                       &RightChild[1]);
    if( !(_DWORD)result )
    {
      RightChild = RightChild->LeftChild;
      goto LABEL_7;
    }
    if( (_DWORD)result != 1 )
      break;
    RightChild = RightChild->RightChild;
LABEL_7:
    if( !RightChild )
      goto LABEL_8;
  }
  if( RightChild == Table->RestartKey )
    Table->RestartKey = RealPredecessor(RightChild);
  ++Table->DeleteCount;
  DeleteNodeFromTree(Table, RightChild);
  --Table->NumberGenericTableElements;
  Table->WhichOrderedElement = 0;
  Table->OrderedPointer = 0i64;
  result = (BOOL *)((__int64(__fastcall *)(PRTL_AVL_TABLE, _RTL_BALANCED_LINKS *))Table->FreeRoutine)(
                     Table,
                     RightChild);
  LOBYTE(result) = 1;
  return result;
}

Referenced by:

EtwpFreeKeyNameList
IopCleanupFileObjectIosbRange
IopSetFileObjectIosbRange
PiDmObjectManagerPopulate
PiDmRemoveCacheReferenceForObject
PiPnpRtlEndOperation
PiPnpRtlObjectEventWorker
PiSwBusRelationRemove
PiSwCloseDevice
PiSwIrpStartCreateWorker
PiSwProcessRemove
PiUpdateDriverDBCache
PnpCleanupDeviceRegistryValues
PopAvlDeleteStatsForPowerRequest
PopAvlFindOrMakeStatsForPowerRequest
PopAvlFindOrMakeStatsForScenarioType
PopCreatePowerRequestObject
PopDirectedDripsUmDirectedFxRemoveTestDevice
PopPowerRequestDeleteEntryById
VfAvlDeleteTreeNode