]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.c
87605cc05528fca2332efe950ebffeaaab69255a
[mirror_edk2.git] / MdeModulePkg / Universal / FirmwareVolume / GuidedSectionExtraction / Crc32SectionExtract / Dxe / GuidedSection.c
1 /*++
2
3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 GuidedSection.c
15
16 Abstract:
17
18 GUIDed section extraction protocol implementation.
19 This contains the common constructor of GUIDed section
20 extraction protocol. GUID specific implementation of each
21 GUIDed section extraction protocol can be found in other
22 files under the same directory.
23
24 --*/
25
26 #include "GuidedSection.h"
27
28 EFI_STATUS
29 GuidedSectionExtractionProtocolConstructor (
30 OUT EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL **GuidedSep,
31 IN EFI_EXTRACT_GUIDED_SECTION ExtractSection
32 )
33 /*++
34
35 Routine Description:
36
37 Constructor for the GUIDed section extraction protocol. Initializes
38 instance data.
39
40 Arguments:
41
42 This Instance to construct
43
44 Returns:
45
46 EFI_SUCCESS: Instance initialized.
47
48 --*/
49 // TODO: GuidedSep - add argument and description to function comment
50 // TODO: ExtractSection - add argument and description to function comment
51 // TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
52 {
53 *GuidedSep = AllocatePool (sizeof (EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL));
54 if (*GuidedSep == NULL) {
55 return EFI_OUT_OF_RESOURCES;
56 }
57
58 (*GuidedSep)->ExtractSection = ExtractSection;
59
60 return EFI_SUCCESS;
61 }