MdeModulePkg: Update BootManagerMenuApp to not display itself

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18656 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Ruiyu Ni 2015-10-23 07:26:58 +00:00 committed by niruiyu
parent 711ef3f624
commit 26da0b64df
2 changed files with 16 additions and 2 deletions

View File

@ -262,13 +262,18 @@ InitializeBootMenuData (
OUT BOOT_MENU_POPUP_DATA *BootMenuData
)
{
EFI_STATUS Status;
UINTN Index;
UINTN StrIndex;
EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
if (BootOption == NULL || BootMenuData == NULL) {
return EFI_INVALID_PARAMETER;
}
}
Status = gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &ImageDevicePath);
ASSERT_EFI_ERROR (Status);
BootMenuData->TitleToken[0] = STRING_TOKEN (STR_BOOT_POPUP_MENU_TITLE_STRING);
BootMenuData->PtrTokens = AllocateZeroPool (BootOptionCount * sizeof (EFI_STRING_ID));
ASSERT (BootMenuData->PtrTokens != NULL);
@ -284,6 +289,14 @@ InitializeBootMenuData (
!IsBootManagerMenu (&BootOption[Index])) {
continue;
}
//
// Don't display myself
//
if (CompareMem (BootOption[Index].FilePath, ImageDevicePath, GetDevicePathSize (ImageDevicePath)) == 0) {
continue;
}
ASSERT (BootOption[Index].Description != NULL);
BootMenuData->PtrTokens[StrIndex++] = HiiSetString (
gStringPackHandle,

View File

@ -52,6 +52,7 @@
[Protocols]
gEfiBootLogoProtocolGuid ## CONSUMES
gEfiLoadedImageDevicePathProtocolGuid ## CONSUMES
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## PRODUCES