Revision: 18657
http://sourceforge.net/p/edk2/code/18657
Author: niruiyu
Date: 2015-10-23 07:28:18 +0000 (Fri, 23 Oct 2015)
Log Message:
-----------
MdeModulePkg: Update UiApp to not display itself
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
trunk/edk2/MdeModulePkg/Application/UiApp/Ui.h
trunk/edk2/MdeModulePkg/Application/UiApp/UiApp.inf
Modified: trunk/edk2/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
===================================================================
--- trunk/edk2/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
2015-10-23 07:26:58 UTC (rev 18656)
+++ trunk/edk2/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
2015-10-23 07:28:18 UTC (rev 18657)
@@ -219,7 +219,9 @@
VOID
)
{
+ EFI_STATUS Status;
UINTN Index;
+ EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
UINTN BootOptionCount;
EFI_STRING_ID Token;
@@ -240,6 +242,9 @@
DeviceType = (UINT16) -1;
+ Status = gBS->HandleProtocol (gImageHandle,
&gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &ImageDevicePath);
+ ASSERT_EFI_ERROR (Status);
+
//
// for better user experience
// 1. User changes HD configuration (e.g.: unplug HDD), here we have a
chance to remove the HDD boot option
@@ -290,6 +295,13 @@
}
//
+ // Don't display myself
+ //
+ if (CompareMem (BootOption[Index].FilePath, ImageDevicePath,
GetDevicePathSize (ImageDevicePath)) == 0) {
+ continue;
+ }
+
+ //
// Group the legacy boot option in the sub title created dynamically
//
IsLegacyOption = (BOOLEAN) (
Modified: trunk/edk2/MdeModulePkg/Application/UiApp/Ui.h
===================================================================
--- trunk/edk2/MdeModulePkg/Application/UiApp/Ui.h 2015-10-23 07:26:58 UTC
(rev 18656)
+++ trunk/edk2/MdeModulePkg/Application/UiApp/Ui.h 2015-10-23 07:28:18 UTC
(rev 18657)
@@ -30,6 +30,7 @@
#include <Guid/HiiBootMaintenanceFormset.h>
#include <Protocol/LoadFile.h>
+#include <Protocol/LoadedImage.h>
#include <Protocol/DevicePath.h>
#include <Protocol/HiiConfigRouting.h>
#include <Protocol/Smbios.h>
Modified: trunk/edk2/MdeModulePkg/Application/UiApp/UiApp.inf
===================================================================
--- trunk/edk2/MdeModulePkg/Application/UiApp/UiApp.inf 2015-10-23 07:26:58 UTC
(rev 18656)
+++ trunk/edk2/MdeModulePkg/Application/UiApp/UiApp.inf 2015-10-23 07:28:18 UTC
(rev 18657)
@@ -123,6 +123,7 @@
gEfiPciIoProtocolGuid ## CONSUMES
gEfiDevicePathToTextProtocolGuid ## CONSUMES
gEfiBootLogoProtocolGuid ## CONSUMES
+ gEfiLoadedImageDevicePathProtocolGuid ## CONSUMES
[FeaturePcd]
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits