It wraps Lzma decompress interfaces to GUIDed Section Extraction interfaces\r
and registers them into GUIDed handler table.\r
\r
- Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2011, 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
ASSERT (ScratchBufferSize != NULL);\r
ASSERT (SectionAttribute != NULL);\r
\r
- if (!CompareGuid (\r
- &gLzmaCustomDecompressGuid, \r
+ if (IS_SECTION2 (InputSection)) {\r
+ if (!CompareGuid (\r
+ &gLzmaCustomDecompressGuid,\r
+ &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;\r
+\r
+ return LzmaUefiDecompressGetInfo (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ OutputBufferSize,\r
+ ScratchBufferSize\r
+ );\r
+ } else {\r
+ if (!CompareGuid (\r
+ &gLzmaCustomDecompressGuid,\r
&(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
- return RETURN_INVALID_PARAMETER;\r
- }\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
\r
- *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
\r
- return LzmaUefiDecompressGetInfo (\r
- (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- OutputBufferSize,\r
- ScratchBufferSize\r
- );\r
+ return LzmaUefiDecompressGetInfo (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ OutputBufferSize,\r
+ ScratchBufferSize\r
+ );\r
+ }\r
}\r
\r
/**\r
ASSERT (OutputBuffer != NULL);\r
ASSERT (InputSection != NULL);\r
\r
- if (!CompareGuid (\r
- &gLzmaCustomDecompressGuid, \r
+ if (IS_SECTION2 (InputSection)) {\r
+ if (!CompareGuid (\r
+ &gLzmaCustomDecompressGuid,\r
+ &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Authentication is set to Zero, which may be ignored.\r
+ //\r
+ *AuthenticationStatus = 0;\r
+\r
+ return LzmaUefiDecompress (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ *OutputBuffer,\r
+ ScratchBuffer\r
+ );\r
+ } else {\r
+ if (!CompareGuid (\r
+ &gLzmaCustomDecompressGuid,\r
&(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
- return RETURN_INVALID_PARAMETER;\r
- }\r
-\r
- //\r
- // Authentication is set to Zero, which may be ignored.\r
- //\r
- *AuthenticationStatus = 0;\r
-\r
- return LzmaUefiDecompress (\r
- (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- *OutputBuffer,\r
- ScratchBuffer\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Authentication is set to Zero, which may be ignored.\r
+ //\r
+ *AuthenticationStatus = 0;\r
+\r
+ return LzmaUefiDecompress (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ *OutputBuffer,\r
+ ScratchBuffer\r
);\r
+ }\r
}\r
\r
\r