/* This function searches the list of configuration tables stored in the EFI System Table for a table with a GUID that matches TableGuid. If a match is found, then a pointer to the configuration table is returned in Table., and EFI_SUCCESS is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned. If TableGuid is NULL, then ASSERT(). If Table is NULL, then ASSERT(). */
EFI_STATUS EFIAPI EfiGetSystemConfigurationTable(IN EFI_GUID *TableGuid, OUT VOID **Table)
/* This function searches the list of configuration tables stored in the EFI System Table for a table with a GUID that matches TableGuid. If a match is found, then a pointer to the configuration table is returned in Table., and EFI_SUCCESS is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned. If TableGuid is NULL, then ASSERT(). If Table is NULL, then ASSERT(). */
EFI_STATUS EFIAPI EfiGetSystemConfigurationTable(IN EFI_GUID *TableGuid, OUT VOID **Table)
{
  EFI_SYSTEM_TABLE  *SystemTable;
  UINTN             Index;
  ASSERT (TableGuid != NULL);
  ASSERT (Table != NULL);
  SystemTable = gST;
  *Table      = NULL;
  for (Index = 0; Index < SystemTable->NumberOfTableEntries; Index++) {
    if (CompareGuid (TableGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {
      *Table = SystemTable->ConfigurationTable[Index].VendorTable;
      return EFI_SUCCESS;
    }
  }
  return EFI_NOT_FOUND;
}