/* Return the HII package list identified by PackageList HII handle. */
HII_DATABASE_PACKAGE_LIST_INSTANCE* LocatePackageList(IN LIST_ENTRY *Database, IN EFI_HII_HANDLE PackageList)
/* Return the HII package list identified by PackageList HII handle. */
HII_DATABASE_PACKAGE_LIST_INSTANCE* LocatePackageList(IN LIST_ENTRY *Database, IN EFI_HII_HANDLE PackageList)
{
  LIST_ENTRY           *Link;
  HII_DATABASE_RECORD  *Record;
  for (Link = GetFirstNode (Database);
       !IsNull (Database, Link);
       Link = GetNextNode (Database, Link)
       )
  {
    Record = CR (Link, HII_DATABASE_RECORD, DatabaseEntry, HII_DATABASE_RECORD_SIGNATURE);
    if (Record->Handle == PackageList) {
      return Record->PackageList;
    }
  }
  return NULL;
}