Layers on top of Firmware Block protocol to produce a file abstraction\r
of FV based files.\r
\r
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
@retval EFI_SUCCESS Successfully read volume header to the allocated\r
buffer.\r
@retval EFI_ACCESS_DENIED Read status of FV is not enabled.\r
+ @retval EFI_INVALID_PARAMETER The FV Header signature is not as expected or\r
+ the file system could not be understood.\r
**/\r
EFI_STATUS\r
GetFwVolHeader (\r
);\r
}\r
\r
+ //\r
+ // Validate FV Header signature, if not as expected, continue.\r
+ //\r
+ if (TempFvh.Signature != EFI_FVH_SIGNATURE) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Check to see that the file system is indeed formatted in a way we can\r
+ // understand it...\r
+ //\r
+ if ((!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&\r
+ (!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
*FwVolHeader = AllocatePool (TempFvh.HeaderLength);\r
if (*FwVolHeader == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
continue;\r
}\r
ASSERT (FwVolHeader != NULL);\r
- //\r
- // Check to see that the file system is indeed formatted in a way we can\r
- // understand it...\r
- //\r
- if ((!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&\r
- (!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {\r
- FreePool (FwVolHeader);\r
- continue;\r
- }\r
FreePool (FwVolHeader);\r
\r
Reinstall = FALSE;\r
/** @file\r
Common defines and definitions for a FwVolDxe driver.\r
\r
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
@retval EFI_SUCCESS Successfully read volume header to the allocated\r
buffer.\r
@retval EFI_ACCESS_DENIED Read status of FV is not enabled.\r
+ @retval EFI_INVALID_PARAMETER The FV Header signature is not as expected or\r
+ the file system could not be understood.\r
**/\r
EFI_STATUS\r
GetFwVolHeader (\r
@retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.\r
@retval EFI_SUCCESS Successfully read volume header to the allocated\r
buffer.\r
+ @retval EFI_INVALID_PARAMETER The FV Header signature is not as expected or\r
+ the file system could not be understood.\r
\r
**/\r
EFI_STATUS\r
@retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.\r
@retval EFI_SUCCESS Successfully read volume header to the allocated\r
buffer.\r
+ @retval EFI_INVALID_PARAMETER The FV Header signature is not as expected or\r
+ the file system could not be understood.\r
\r
**/\r
EFI_STATUS\r
return Status;\r
}\r
\r
+ //\r
+ // Validate FV Header signature, if not as expected, continue.\r
+ //\r
+ if (TempFvh.Signature != EFI_FVH_SIGNATURE) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Check to see that the file system is indeed formatted in a way we can\r
+ // understand it...\r
+ //\r
+ if ((!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&\r
+ (!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
//\r
// Allocate a buffer for the caller\r
//\r
}\r
ASSERT (FwVolHeader != NULL);\r
\r
- //\r
- // Validate FV Header signature, if not as expected, continue.\r
- //\r
- if (FwVolHeader->Signature != EFI_FVH_SIGNATURE) {\r
- CoreFreePool (FwVolHeader);\r
- continue;\r
- }\r
-\r
if (!VerifyFvHeaderChecksum (FwVolHeader)) {\r
CoreFreePool (FwVolHeader);\r
continue;\r
}\r
\r
-\r
- //\r
- // Check to see that the file system is indeed formatted in a way we can\r
- // understand it...\r
- //\r
- if ((!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&\r
- (!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {\r
- continue;\r
- }\r
-\r
//\r
// Check if there is an FV protocol already installed in that handle\r
//\r
IN EFI_FFS_FILE_HEADER *FfsHeader\r
);\r
\r
-\r
-/**\r
- given the supplied FW_VOL_BLOCK_PROTOCOL, allocate a buffer for output and\r
- copy the volume header into it.\r
-\r
- @param Fvb The FW_VOL_BLOCK_PROTOCOL instance from which to\r
- read the volume header\r
- @param FwVolHeader Pointer to pointer to allocated buffer in which\r
- the volume header is returned.\r
-\r
- @retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.\r
- @retval EFI_SUCCESS Successfully read volume header to the allocated\r
- buffer.\r
-\r
-**/\r
-EFI_STATUS\r
-GetFwVolHeader (\r
- IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb,\r
- OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader\r
- );\r
-\r
#endif\r