/** @file\r
The platform boot manager reference implementation\r
\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
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
BOOLEAN IsLegacyOption;\r
BOOLEAN NeedEndOp;\r
UINT16 KeyInput;\r
+ UINTN DestMax;\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
\r
TempStr = UiDevicePathToStr (BootOption[Index].FilePath);\r
TempSize = StrSize (TempStr);\r
+ DestMax = (TempSize + StrSize (L"Device Path : ")) / sizeof(CHAR16);\r
HelpString = AllocateZeroPool (TempSize + StrSize (L"Device Path : "));\r
ASSERT (HelpString != NULL);\r
- StrCat (HelpString, L"Device Path : ");\r
- StrCat (HelpString, TempStr);\r
+ StrCatS (HelpString, DestMax, L"Device Path : ");\r
+ StrCatS (HelpString, DestMax, TempStr);\r
\r
HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);\r
\r