VOID\r
)\r
{\r
+ EFI_STATUS Status;\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
\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
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
#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
gEfiPciIoProtocolGuid ## CONSUMES\r
gEfiDevicePathToTextProtocolGuid ## CONSUMES\r
gEfiBootLogoProtocolGuid ## CONSUMES\r
+ gEfiLoadedImageDevicePathProtocolGuid ## CONSUMES\r
\r
[FeaturePcd]\r
\r