1fde2f61 |
1 | /** @file\r |
2 | LZMA Decompress Library header file\r |
3 | \r |
4 | Copyright (c) 2006 - 2010, Intel Corporation<BR>\r |
5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r |
8 | http://opensource.org/licenses/bsd-license.php\r |
9 | \r |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
12 | \r |
13 | **/\r |
14 | \r |
15 | #ifndef __LZMA_DECOMPRESS_H___\r |
16 | #define __LZMA_DECOMPRESS_H___\r |
17 | \r |
18 | /**\r |
19 | Examines a GUIDed section and returns the size of the decoded buffer and the\r |
20 | size of an scratch buffer required to actually decode the data in a GUIDed section.\r |
21 | \r |
22 | Examines a GUIDed section specified by InputSection. \r |
23 | If GUID for InputSection does not match the GUID that this handler supports,\r |
24 | then RETURN_UNSUPPORTED is returned. \r |
25 | If the required information can not be retrieved from InputSection,\r |
26 | then RETURN_INVALID_PARAMETER is returned.\r |
27 | If the GUID of InputSection does match the GUID that this handler supports,\r |
28 | then the size required to hold the decoded buffer is returned in OututBufferSize,\r |
29 | the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field\r |
30 | from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute.\r |
31 | \r |
32 | If InputSection is NULL, then ASSERT().\r |
33 | If OutputBufferSize is NULL, then ASSERT().\r |
34 | If ScratchBufferSize is NULL, then ASSERT().\r |
35 | If SectionAttribute is NULL, then ASSERT().\r |
36 | \r |
37 | \r |
38 | @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.\r |
39 | @param[out] OutputBufferSize A pointer to the size, in bytes, of an output buffer required\r |
40 | if the buffer specified by InputSection were decoded.\r |
41 | @param[out] ScratchBufferSize A pointer to the size, in bytes, required as scratch space\r |
42 | if the buffer specified by InputSection were decoded.\r |
43 | @param[out] SectionAttribute A pointer to the attributes of the GUIDed section. See the Attributes\r |
44 | field of EFI_GUID_DEFINED_SECTION in the PI Specification.\r |
45 | \r |
46 | @retval RETURN_SUCCESS The information about InputSection was returned.\r |
47 | @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports.\r |
48 | @retval RETURN_INVALID_PARAMETER The information can not be retrieved from the section specified by InputSection.\r |
49 | \r |
50 | **/\r |
51 | RETURN_STATUS\r |
52 | EFIAPI\r |
53 | LzmaGuidedSectionGetInfo (\r |
54 | IN CONST VOID *InputSection,\r |
55 | OUT UINT32 *OutputBufferSize,\r |
56 | OUT UINT32 *ScratchBufferSize,\r |
57 | OUT UINT16 *SectionAttribute\r |
58 | );\r |
59 | \r |
60 | /**\r |
61 | Decompress a LZAM compressed GUIDed section into a caller allocated output buffer.\r |
62 | \r |
63 | Decodes the GUIDed section specified by InputSection. \r |
64 | If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned. \r |
65 | If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned.\r |
66 | If the GUID of InputSection does match the GUID that this handler supports, then InputSection\r |
67 | is decoded into the buffer specified by OutputBuffer and the authentication status of this\r |
68 | decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the\r |
69 | data in InputSection, then OutputBuffer is set to point at the data in InputSection. Otherwise,\r |
70 | the decoded data will be placed in caller allocated buffer specified by OutputBuffer.\r |
71 | \r |
72 | If InputSection is NULL, then ASSERT().\r |
73 | If OutputBuffer is NULL, then ASSERT().\r |
74 | If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().\r |
75 | If AuthenticationStatus is NULL, then ASSERT().\r |
76 | \r |
77 | \r |
78 | @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.\r |
79 | @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. \r |
80 | @param[out] ScratchBuffer A caller allocated buffer that may be required by this function\r |
81 | as a scratch buffer to perform the decode operation. \r |
82 | @param[out] AuthenticationStatus \r |
83 | A pointer to the authentication status of the decoded output buffer.\r |
84 | See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI\r |
85 | section of the PI Specification. EFI_AUTH_STATUS_PLATFORM_OVERRIDE must\r |
86 | never be set by this handler.\r |
87 | \r |
88 | @retval RETURN_SUCCESS The buffer specified by InputSection was decoded.\r |
89 | @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports.\r |
90 | @retval RETURN_INVALID_PARAMETER The section specified by InputSection can not be decoded.\r |
91 | \r |
92 | **/\r |
93 | RETURN_STATUS\r |
94 | EFIAPI\r |
95 | LzmaGuidedSectionExtraction (\r |
96 | IN CONST VOID *InputSection,\r |
97 | OUT VOID **OutputBuffer,\r |
98 | OUT VOID *ScratchBuffer, OPTIONAL\r |
99 | OUT UINT32 *AuthenticationStatus\r |
100 | );\r |
101 | \r |
102 | #endif // __LZMADECOMPRESS_H__\r |
103 | \r |