]>
Commit | Line | Data |
---|---|---|
607a0df6 | 1 | /** @file\r |
2 | LZMA Decompress GUIDed Section Extraction Library.\r | |
3 | It wraps Lzma decompress interfaces to GUIDed Section Extraction interfaces\r | |
4 | and registers them into GUIDed handler table.\r | |
5 | \r | |
60274cca HT |
6 | Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r |
7 | This program and the accompanying materials\r | |
607a0df6 | 8 | are licensed and made available under the terms and conditions of the BSD License\r |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | \r | |
15 | **/\r | |
16 | \r | |
17 | #include <PiDxe.h>\r | |
18 | #include <Library/HobLib.h>\r | |
19 | #include <Library/ExtractGuidedSectionLib.h>\r | |
20 | \r | |
21 | #include <Guid/ExtractSection.h>\r | |
22 | #include <Guid/LzmaDecompress.h>\r | |
23 | \r | |
24 | \r | |
25 | /**\r | |
26 | Register LzmaDecompress and LzmaDecompressGetInfo handlers with LzmaCustomerDecompressGuid.\r | |
27 | \r | |
28 | @retval RETURN_SUCCESS Register successfully.\r | |
29 | @retval RETURN_OUT_OF_RESOURCES No enough memory to store this handler.\r | |
30 | **/\r | |
31 | EFI_STATUS\r | |
32 | EFIAPI\r | |
33 | LzmaDecompressLibConstructor (\r | |
34 | )\r | |
35 | {\r | |
36 | EXTRACT_SECTION_HOB *Hob;\r | |
3402aac7 | 37 | \r |
607a0df6 | 38 | Hob = GetFirstGuidHob (&gLzmaCustomDecompressGuid);\r |
39 | if (Hob == NULL) {\r | |
40 | return EFI_NOT_FOUND;\r | |
41 | }\r | |
3402aac7 RC |
42 | \r |
43 | // Locate Guided Hob\r | |
607a0df6 | 44 | \r |
45 | return ExtractGuidedSectionRegisterHandlers (\r | |
46 | &gLzmaCustomDecompressGuid,\r | |
ca3ad58b | 47 | Hob->Data.SectionGetInfo,\r |
48 | Hob->Data.SectionExtraction\r | |
3402aac7 | 49 | );\r |
607a0df6 | 50 | }\r |