/*++\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
+Copyright (c) 2006 - 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
http://opensource.org/licenses/bsd-license.php \r
EFI_STATUS\r
FvbGetVolumeAttributes (\r
IN UINTN Instance,\r
- OUT EFI_FVB_ATTRIBUTES_2 *Attributes,\r
+ OUT EFI_FVB_ATTRIBUTES_2 *Attributes,\r
IN ESAL_FWB_GLOBAL *Global,\r
IN BOOLEAN Virtual\r
)\r
{\r
\r
EFI_FVB_ATTRIBUTES_2 Attributes;\r
- UINTN LbaAddress;\r
- UINTN LbaLength;\r
- EFI_STATUS Status;\r
- UINT8 Data;\r
+ UINTN LbaAddress;\r
+ UINTN LbaLength;\r
+ EFI_STATUS Status;\r
+ UINT8 Data;\r
\r
//\r
// Check if the FV is write enabled\r
EFI_STATUS\r
FvbSetVolumeAttributes (\r
IN UINTN Instance,\r
- IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes,\r
+ IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes,\r
IN ESAL_FWB_GLOBAL *Global,\r
IN BOOLEAN Virtual\r
)\r
EFI_FW_VOL_INSTANCE *FwhInstance = NULL;\r
EFI_FVB_ATTRIBUTES_2 OldAttributes;\r
EFI_FVB_ATTRIBUTES_2 *AttribPtr;\r
- UINT32 Capabilities;\r
- UINT32 OldStatus;\r
- UINT32 NewStatus;\r
- EFI_STATUS Status;\r
+ UINT32 Capabilities;\r
+ UINT32 OldStatus;\r
+ UINT32 NewStatus;\r
+ EFI_STATUS Status;\r
EFI_FVB_ATTRIBUTES_2 UnchangedAttributes;\r
\r
\r
EFIAPI\r
FvbProtocolGetAttributes (\r
IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
- OUT EFI_FVB_ATTRIBUTES_2 *Attributes\r
+ OUT EFI_FVB_ATTRIBUTES_2 *Attributes\r
)\r
/*++\r
\r
EFIAPI\r
FvbProtocolSetAttributes (\r
IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
- IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes\r
+ IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes\r
)\r
/*++\r
\r
//\r
// Check input parameters\r
//\r
- if (NumOfLba == 0) {\r
+ if (NumOfLba == 0 || (StartingLba + NumOfLba) > NumOfBlocks) {\r
VA_END (args);\r
return EFI_INVALID_PARAMETER;\r
}\r
-\r
- if ((StartingLba + NumOfLba) > NumOfBlocks) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
} while (1);\r
\r
VA_END (args);\r