/* Check whether need to enable the reset flag in form level. Also clean all ValueChanged flag in question. */
VOID UpdateFlagForForm(IN BOOLEAN SetFlag, IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
/* Check whether need to enable the reset flag in form level. Also clean all ValueChanged flag in question. */
VOID UpdateFlagForForm(IN BOOLEAN SetFlag, IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
{
  LIST_ENTRY              *Link;
  FORM_BROWSER_STATEMENT  *Question;
  BOOLEAN                 OldValue;
  Link = GetFirstNode (&Form->StatementListHead);
  while (!IsNull (&Form->StatementListHead, Link)) {
    Question = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
    Link     = GetNextNode (&Form->StatementListHead, Link);
    if (!Question->ValueChanged) {
      continue;
    }
    OldValue = Question->ValueChanged;
    Question->ValueChanged = IsQuestionValueChanged (FormSet, Form, Question, GetSetValueWithBothBuffer);
    if (SetFlag && OldValue && !Question->ValueChanged) {
      if ((Question->QuestionFlags & EFI_IFR_FLAG_RESET_REQUIRED) != 0) {
        gResetRequiredFormLevel   = TRUE;
        gResetRequiredSystemLevel = TRUE;
      }
      if ((Question->QuestionFlags & EFI_IFR_FLAG_RECONNECT_REQUIRED) != 0) {
        gFlagReconnect = TRUE;
      }
    }
  }
}