\r
#include <Protocol/BlockIo.h>\r
#include <Protocol/DevicePathToText.h>\r
+#include <Protocol/FirmwareVolumeBlock.h>\r
#include <Protocol/PxeBaseCode.h>\r
#include <Protocol/SimpleFileSystem.h>\r
#include <Protocol/SimpleNetwork.h>\r
IN OUT LIST_ENTRY* BdsLoadOptionList\r
)\r
{\r
- EFI_STATUS Status;\r
- UINTN HandleCount;\r
- EFI_HANDLE *HandleBuffer;\r
- UINTN DevicePathHandleCount;\r
- EFI_HANDLE *DevicePathHandleBuffer;\r
- BOOLEAN IsParent;\r
- UINTN Index;\r
- UINTN Index2;\r
- BDS_SUPPORTED_DEVICE *SupportedDevice;\r
- EFI_DEVICE_PATH_PROTOCOL* DevicePathProtocol;\r
- EFI_DEVICE_PATH* DevicePath;\r
+ EFI_STATUS Status;\r
+ UINTN HandleCount;\r
+ EFI_HANDLE *HandleBuffer;\r
+ UINTN DevicePathHandleCount;\r
+ EFI_HANDLE *DevicePathHandleBuffer;\r
+ BOOLEAN IsParent;\r
+ UINTN Index;\r
+ UINTN Index2;\r
+ BDS_SUPPORTED_DEVICE *SupportedDevice;\r
+ EFI_DEVICE_PATH_PROTOCOL* DevicePathProtocol;\r
+ EFI_DEVICE_PATH* DevicePath;\r
+ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileProtocol;\r
+ EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvbProtocol;\r
\r
// List all the BlockIo Protocols\r
Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &HandleCount, &HandleBuffer);\r
}\r
\r
for (Index = 0; Index < HandleCount; Index++) {\r
- // We only select the handle WITH a Device Path AND not part of Media (to avoid duplication with HardDisk, CDROM, etc)\r
+ // We only select handles WITH a Device Path AND not part of Media (to\r
+ // avoid duplication with HardDisk, CDROM, etc). Skip handles used by\r
+ // Simple Filesystem or used for Variable Storage.\r
+\r
+\r
+ Status = gBS->HandleProtocol (HandleBuffer[Index],\r
+ &gEfiSimpleFileSystemProtocolGuid,\r
+ (VOID *)&FileProtocol);\r
+ if (!EFI_ERROR(Status)) {\r
+ // SimpleFilesystem supported on this handle, skip\r
+ continue;\r
+ }\r
+\r
+ Status = gBS->HandleProtocol (HandleBuffer[Index],\r
+ &gEfiFirmwareVolumeBlockProtocolGuid,\r
+ (VOID *)&FvbProtocol);\r
+ if (!EFI_ERROR(Status)) {\r
+ // Firmware Volme Block / Variable storage supported on this handle, skip\r
+ continue;\r
+ }\r
+\r
+ Status = gBS->HandleProtocol (HandleBuffer[Index],\r
+ &gEfiFirmwareVolumeBlock2ProtocolGuid,\r
+ (VOID *)&FvbProtocol);\r
+ if (!EFI_ERROR(Status)) {\r
+ // Firmware Volme Block / Variable storage supported on this handle, skip\r
+ continue;\r
+ }\r
+\r
Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID **)&DevicePathProtocol);\r
if (!EFI_ERROR(Status)) {\r
// BlockIo is not part of Media Device Path\r