/* Find parent formset menu(the first menu which has different formset) for current menu. If not find, just return to the first menu. */
VOID FindParentFormSet(IN OUT UI_MENU_SELECTION *Selection)
/* Find parent formset menu(the first menu which has different formset) for current menu. If not find, just return to the first menu. */
VOID FindParentFormSet(IN OUT UI_MENU_SELECTION *Selection)
{
  FORM_ENTRY_INFO  *CurrentMenu;
  FORM_ENTRY_INFO  *ParentMenu;
  CurrentMenu = Selection->CurrentMenu;
  ParentMenu  = UiFindParentMenu (CurrentMenu, FormSetLevel);
  if (ParentMenu != NULL) {
    CopyMem (&Selection->FormSetGuid, &ParentMenu->FormSetGuid, sizeof (EFI_GUID));
    Selection->Handle     = ParentMenu->HiiHandle;
    Selection->FormId     = ParentMenu->FormId;
    Selection->QuestionId = ParentMenu->QuestionId;
  } else {
    Selection->FormId     = CurrentMenu->FormId;
    Selection->QuestionId = CurrentMenu->QuestionId;
  }
  Selection->Statement = NULL;
}