/* Find the top of screen menu base on the previous record menu info. */
LIST_ENTRY* FindTopOfScreenMenuOption(IN LIST_ENTRY *HighLightMenu)
/* Find the top of screen menu base on the previous record menu info. */
LIST_ENTRY* FindTopOfScreenMenuOption(IN LIST_ENTRY *HighLightMenu)
{
  LIST_ENTRY      *NewPos;
  UI_MENU_OPTION  *MenuOption;
  UINTN           TopRow;
  UINTN           BottomRow;
  TopRow    = gStatementDimensions.TopRow    + SCROLL_ARROW_HEIGHT;
  BottomRow = gStatementDimensions.BottomRow - SCROLL_ARROW_HEIGHT;
  NewPos     = gMenuOption.ForwardLink;
  MenuOption = MENU_OPTION_FROM_LINK (NewPos);
  while (!IsTopOfScreeMenuOption (MenuOption)) {
    NewPos = NewPos->ForwardLink;
    if (NewPos == &gMenuOption) {
      break;
    }
    MenuOption = MENU_OPTION_FROM_LINK (NewPos);
  }
  if (NewPos == &gMenuOption) {
    return NULL;
  }
  if (GetDistanceBetweenMenus (HighLightMenu, NewPos) + 1 > BottomRow - TopRow) {
    return NULL;
  }
  return NewPos;
}