/* Get Value for given Name from a NameValue Storage. */
EFI_STATUS GetValueByName(IN BROWSER_STORAGE *Storage, IN CHAR16 *Name, IN OUT CHAR16 **Value, IN GET_SET_QUESTION_VALUE_WITH GetValueFrom)
/* Get Value for given Name from a NameValue Storage. */
EFI_STATUS GetValueByName(IN BROWSER_STORAGE *Storage, IN CHAR16 *Name, IN OUT CHAR16 **Value, IN GET_SET_QUESTION_VALUE_WITH GetValueFrom)
{
  LIST_ENTRY       *Link;
  NAME_VALUE_NODE  *Node;
  if ((GetValueFrom != GetSetValueWithEditBuffer) && (GetValueFrom != GetSetValueWithBuffer)) {
    return EFI_INVALID_PARAMETER;
  }
  *Value = NULL;
  Link = GetFirstNode (&Storage->NameValueListHead);
  while (!IsNull (&Storage->NameValueListHead, Link)) {
    Node = NAME_VALUE_NODE_FROM_LINK (Link);
    if (StrCmp (Name, Node->Name) == 0) {
      if (GetValueFrom == GetSetValueWithEditBuffer) {
        NewStringCpy (Value, Node->EditValue);
      } else {
        NewStringCpy (Value, Node->Value);
      }
      return EFI_SUCCESS;
    }
    Link = GetNextNode (&Storage->NameValueListHead, Link);
  }
  return EFI_NOT_FOUND;
}