/* Copy current Menu list to the new menu list. */
VOID UiCopyMenuList(OUT LIST_ENTRY *NewMenuListHead, IN LIST_ENTRY *CurrentMenuListHead)
/* Copy current Menu list to the new menu list. */
VOID UiCopyMenuList(OUT LIST_ENTRY *NewMenuListHead, IN LIST_ENTRY *CurrentMenuListHead)
{
  LIST_ENTRY       *Link;
  FORM_ENTRY_INFO  *MenuList;
  FORM_ENTRY_INFO  *NewMenuEntry;
  UiFreeMenuList (NewMenuListHead);
  Link = GetFirstNode (CurrentMenuListHead);
  while (!IsNull (CurrentMenuListHead, Link)) {
    MenuList = FORM_ENTRY_INFO_FROM_LINK (Link);
    Link     = GetNextNode (CurrentMenuListHead, Link);
    NewMenuEntry = AllocateZeroPool (sizeof (FORM_ENTRY_INFO));
    ASSERT (NewMenuEntry != NULL);
    NewMenuEntry->Signature = FORM_ENTRY_INFO_SIGNATURE;
    NewMenuEntry->HiiHandle = MenuList->HiiHandle;
    CopyMem (&NewMenuEntry->FormSetGuid, &MenuList->FormSetGuid, sizeof (EFI_GUID));
    NewMenuEntry->FormId     = MenuList->FormId;
    NewMenuEntry->QuestionId = MenuList->QuestionId;
    InsertTailList (NewMenuListHead, &NewMenuEntry->Link);
  }
}