/* Get formset storage based on the input varstoreid info. */
HII_FORMSET_STORAGE* GetFstStgFromVarId(IN HII_FORMSET *FormSet, IN EFI_VARSTORE_ID VarStoreId)
/* Get formset storage based on the input varstoreid info. */
HII_FORMSET_STORAGE* GetFstStgFromVarId(IN HII_FORMSET *FormSet, IN EFI_VARSTORE_ID VarStoreId)
{
  HII_FORMSET_STORAGE  *Storage;
  LIST_ENTRY           *Link;
  BOOLEAN              Found;
  Found   = FALSE;
  Storage = NULL;
  Link = GetFirstNode (&FormSet->StorageListHead);
  while (!IsNull (&FormSet->StorageListHead, Link)) {
    Storage = HII_STORAGE_FROM_LINK (Link);
    if (Storage->VarStoreId == VarStoreId) {
      Found = TRUE;
      break;
    }
    Link = GetNextNode (&FormSet->StorageListHead, Link);
  }
  return Found ? Storage : NULL;
}