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