/* This function finds the table specified by the handle and returns a pointer to it. If the handle is not found, EFI_NOT_FOUND is returned and the contents of Table are undefined. */
EFI_STATUS FindTableByHandle(IN UINTN Handle, IN LIST_ENTRY *TableList, OUT EFI_ACPI_TABLE_LIST **Table)
/* This function finds the table specified by the handle and returns a pointer to it. If the handle is not found, EFI_NOT_FOUND is returned and the contents of Table are undefined. */
EFI_STATUS FindTableByHandle(IN UINTN Handle, IN LIST_ENTRY *TableList, OUT EFI_ACPI_TABLE_LIST **Table)
{
  LIST_ENTRY           *CurrentLink;
  EFI_ACPI_TABLE_LIST  *CurrentTable;
  ASSERT (Table);
  CurrentLink = TableList->ForwardLink;
  while (CurrentLink != TableList) {
    CurrentTable = EFI_ACPI_TABLE_LIST_FROM_LINK (CurrentLink);
    if (CurrentTable->Handle == Handle) {
      *Table = CurrentTable;
      return EFI_SUCCESS;
    }
    CurrentLink = CurrentLink->ForwardLink;
  }
  return EFI_NOT_FOUND;
}