/* Initialize the menu bar with the specified items. */
EFI_STATUS MenuBarInit(IN CONST EDITOR_MENU_ITEM *Items)
/* Initialize the menu bar with the specified items. */
EFI_STATUS MenuBarInit(IN CONST EDITOR_MENU_ITEM *Items)
{
  CONST EDITOR_MENU_ITEM  *ItemsWalker;
  for (NumItems = 0, ItemsWalker = Items; ItemsWalker != NULL && ItemsWalker->Function != NULL; ItemsWalker++, NumItems++) {
  }
  MenuItems = AllocateZeroPool ((NumItems+1) * sizeof (EDITOR_MENU_ITEM));
  if (MenuItems == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  CopyMem (MenuItems, Items, (NumItems+1) * sizeof (EDITOR_MENU_ITEM));
  return EFI_SUCCESS;
}