]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Update UiApp to not display itself
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 23 Oct 2015 07:28:18 +0000 (07:28 +0000)
committerniruiyu <niruiyu@Edk2>
Fri, 23 Oct 2015 07:28:18 +0000 (07:28 +0000)
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@18657 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
MdeModulePkg/Application/UiApp/Ui.h
MdeModulePkg/Application/UiApp/UiApp.inf

index 986413c19b4a56b23f8f1580889bf5b794664963..4390deef2455931e512c6697630bea7f37f84980 100644 (file)
@@ -219,7 +219,9 @@ EnumerateBootOptions  (
   VOID\r
   )\r
 {\r
   VOID\r
   )\r
 {\r
+  EFI_STATUS                    Status;\r
   UINTN                         Index;\r
   UINTN                         Index;\r
+  EFI_DEVICE_PATH_PROTOCOL      *ImageDevicePath;\r
   EFI_BOOT_MANAGER_LOAD_OPTION  *BootOption;\r
   UINTN                         BootOptionCount;\r
   EFI_STRING_ID                 Token;\r
   EFI_BOOT_MANAGER_LOAD_OPTION  *BootOption;\r
   UINTN                         BootOptionCount;\r
   EFI_STRING_ID                 Token;\r
@@ -240,6 +242,9 @@ EnumerateBootOptions  (
 \r
   DeviceType = (UINT16) -1;\r
 \r
 \r
   DeviceType = (UINT16) -1;\r
 \r
+  Status = gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &ImageDevicePath);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
   //\r
   // for better user experience\r
   // 1. User changes HD configuration (e.g.: unplug HDD), here we have a chance to remove the HDD boot option\r
   //\r
   // for better user experience\r
   // 1. User changes HD configuration (e.g.: unplug HDD), here we have a chance to remove the HDD boot option\r
@@ -289,6 +294,13 @@ EnumerateBootOptions  (
       continue;\r
     }\r
 \r
       continue;\r
     }\r
 \r
+    //\r
+    // Don't display myself\r
+    //\r
+    if (CompareMem (BootOption[Index].FilePath, ImageDevicePath, GetDevicePathSize (ImageDevicePath)) == 0) {\r
+      continue;\r
+    }\r
+\r
     //\r
     // Group the legacy boot option in the sub title created dynamically\r
     //\r
     //\r
     // Group the legacy boot option in the sub title created dynamically\r
     //\r
index 413266d815d4180a4a2b6417721b6b42a344be8c..815987800707ea46546009d91e95a753dc88b337 100644 (file)
@@ -30,6 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/HiiBootMaintenanceFormset.h>\r
 \r
 #include <Protocol/LoadFile.h>\r
 #include <Guid/HiiBootMaintenanceFormset.h>\r
 \r
 #include <Protocol/LoadFile.h>\r
+#include <Protocol/LoadedImage.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/HiiConfigRouting.h>\r
 #include <Protocol/Smbios.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/HiiConfigRouting.h>\r
 #include <Protocol/Smbios.h>\r
index 36d292e676347e6847a36f37a7a3ebd2b790ee87..9553c7bab56930cf7823e25bd3a4b1aa74e9ba23 100644 (file)
   gEfiPciIoProtocolGuid                         ## CONSUMES\r
   gEfiDevicePathToTextProtocolGuid              ## CONSUMES\r
   gEfiBootLogoProtocolGuid                      ## CONSUMES\r
   gEfiPciIoProtocolGuid                         ## CONSUMES\r
   gEfiDevicePathToTextProtocolGuid              ## CONSUMES\r
   gEfiBootLogoProtocolGuid                      ## CONSUMES\r
+  gEfiLoadedImageDevicePathProtocolGuid         ## CONSUMES\r
 \r
 [FeaturePcd]\r
 \r
 \r
 [FeaturePcd]\r
 \r