summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2015-10-23 07:26:58 +0000
committerniruiyu <niruiyu@Edk2>2015-10-23 07:26:58 +0000
commit26da0b64df29c2a7c266661a7fe0325e0444c96c (patch)
treef02a8a35c48ce5d32d749db16db5cf79d7d2b72c /MdeModulePkg/Application
parent711ef3f6243ee5487f573a8f2e5b1749a6e02c81 (diff)
downloadedk2-26da0b64df29c2a7c266661a7fe0325e0444c96c.zip
edk2-26da0b64df29c2a7c266661a7fe0325e0444c96c.tar.gz
edk2-26da0b64df29c2a7c266661a7fe0325e0444c96c.tar.bz2
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
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c17
-rw-r--r--MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf1
2 files changed, 16 insertions, 2 deletions
diff --git a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
index d43c12f..a8d5c03 100644
--- a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
+++ b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
@@ -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,
diff --git a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
index b445505..dd60ef4 100644
--- a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
+++ b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
@@ -52,6 +52,7 @@
[Protocols]
gEfiBootLogoProtocolGuid ## CONSUMES
+ gEfiLoadedImageDevicePathProtocolGuid ## CONSUMES
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## PRODUCES