/** @file\r
BDS Lib functions which relate with create or process the boot option.\r
\r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, 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
)\r
{\r
EFI_STATUS Status;\r
+ EFI_STATUS StatusLogo;\r
EFI_HANDLE Handle;\r
EFI_HANDLE ImageHandle;\r
EFI_DEVICE_PATH_PROTOCOL *FilePath;\r
EFI_DEVICE_PATH_PROTOCOL *WorkingDevicePath;\r
EFI_ACPI_S3_SAVE_PROTOCOL *AcpiS3Save;\r
LIST_ENTRY TempBootLists;\r
+ EFI_BOOT_LOGO_PROTOCOL *BootLogo;\r
\r
//\r
// Record the performance data for End of BDS\r
gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL);\r
\r
Done:\r
+ //\r
+ // Set Logo status invalid after trying one boot option\r
+ //\r
+ BootLogo = NULL;\r
+ StatusLogo = gBS->LocateProtocol (&gEfiBootLogoProtocolGuid, NULL, (VOID **) &BootLogo);\r
+ if (!EFI_ERROR (StatusLogo) && (BootLogo != NULL)) {\r
+ BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0);\r
+ }\r
+\r
//\r
// Clear Boot Current\r
//\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
+ if (!ValidateOption(BootOptionVar, BootOptionSize)) {\r
+ BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);\r
+ FreePool (BootOptionVar);\r
+ Index++;\r
+ continue;\r
+ }\r
+\r
TempPtr = BootOptionVar;\r
TempPtr += sizeof (UINT32) + sizeof (UINT16);\r
TempPtr += StrSize ((CHAR16 *) TempPtr);\r
EFI_DEVICE_PATH_PROTOCOL *OptionDevicePath;\r
UINT8 *TempPtr;\r
CHAR16 *Description;\r
+ BOOLEAN Corrupted;\r
\r
- Status = EFI_SUCCESS;\r
- BootOrder = NULL;\r
- BootOrderSize = 0;\r
+ Status = EFI_SUCCESS;\r
+ BootOrder = NULL;\r
+ Description = NULL;\r
+ OptionDevicePath = NULL;\r
+ BootOrderSize = 0;\r
+ Corrupted = FALSE;\r
\r
//\r
// Check "BootOrder" variable firstly, this variable hold the number of boot options\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
- TempPtr = BootOptionVar;\r
- TempPtr += sizeof (UINT32) + sizeof (UINT16);\r
- Description = (CHAR16 *) TempPtr;\r
- TempPtr += StrSize ((CHAR16 *) TempPtr);\r
- OptionDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) TempPtr;\r
+ if (!ValidateOption(BootOptionVar, BootOptionSize)) {\r
+ Corrupted = TRUE;\r
+ } else {\r
+ TempPtr = BootOptionVar;\r
+ TempPtr += sizeof (UINT32) + sizeof (UINT16);\r
+ Description = (CHAR16 *) TempPtr;\r
+ TempPtr += StrSize ((CHAR16 *) TempPtr);\r
+ OptionDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) TempPtr;\r
\r
- //\r
- // Skip legacy boot option (BBS boot device)\r
- //\r
- if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&\r
- (DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {\r
- FreePool (BootOptionVar);\r
- Index++;\r
- continue;\r
+ //\r
+ // Skip legacy boot option (BBS boot device)\r
+ //\r
+ if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&\r
+ (DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {\r
+ FreePool (BootOptionVar);\r
+ Index++;\r
+ continue;\r
+ }\r
}\r
\r
- if (!BdsLibIsValidEFIBootOptDevicePathExt (OptionDevicePath, FALSE, Description)) {\r
+ if (Corrupted || !BdsLibIsValidEFIBootOptDevicePathExt (OptionDevicePath, FALSE, Description)) {\r
//\r
// Delete this invalid boot option "Boot####"\r
//\r
// Mark this boot option in boot order as deleted\r
//\r
BootOrder[Index] = 0xffff;\r
+ Corrupted = FALSE;\r
}\r
\r
FreePool (BootOptionVar);\r