/* If the TypeMerge is TRUE, Res resource type is changed to the type of destination resource type. If Dst is NULL or Res is NULL, ASSERT (). */
VOID MergeResourceTree(IN PCI_RESOURCE_NODE *Dst, IN PCI_RESOURCE_NODE *Res, IN BOOLEAN TypeMerge)
/* If the TypeMerge is TRUE, Res resource type is changed to the type of destination resource type. If Dst is NULL or Res is NULL, ASSERT (). */
VOID MergeResourceTree(IN PCI_RESOURCE_NODE *Dst, IN PCI_RESOURCE_NODE *Res, IN BOOLEAN TypeMerge)
{
  LIST_ENTRY         *CurrentLink;
  PCI_RESOURCE_NODE  *Temp;
  ASSERT (Dst != NULL);
  ASSERT (Res != NULL);
  while (!IsListEmpty (&Res->ChildList)) {
    CurrentLink = Res->ChildList.ForwardLink;
    Temp = RESOURCE_NODE_FROM_LINK (CurrentLink);
    if (TypeMerge) {
      Temp->ResType = Dst->ResType;
    }
    RemoveEntryList (CurrentLink);
    InsertResourceNode (Dst, Temp);
  }
}