]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/SectionExtraction.h
Removed IntelframeworkPkg contamination from MdeModulePkg modules.
[mirror_edk2.git] / MdePkg / Include / Protocol / SectionExtraction.h
CommitLineData
ba237732
A
1/** @file\r
2 This file declares Section Extraction protocol.\r
3\r
4 The section extraction protocol is referenced in the PI 1.0 specification, but\r
5 not defined. It will likely be added in an eratta update.\r
6\r
7 Copyright (c) 2006, Intel Corporation \r
8 All rights reserved. This program and the materials \r
9 are licensed and made available under the terms and conditions of the BSD License \r
10 which accompanies this distribution. The full text of the license may be found at \r
11 http://opensource.org/licenses/bsd-license.php \r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
15\r
16**/\r
17\r
18#ifndef __SECTION_EXTRACTION_PROTOCOL_H__\r
19#define __SECTION_EXTRACTION_PROTOCOL_H__\r
20\r
21\r
22\r
23typedef struct _EFI_SECTION_EXTRACTION_PROTOCOL EFI_SECTION_EXTRACTION_PROTOCOL;\r
24\r
25//\r
26// Protocol member functions\r
27//\r
28/**\r
29 Creates and returns a new section stream handle to represent the new section stream.\r
30\r
31 @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r
32 @param SectionStreamLength Size in bytes of the section stream.\r
33 @param SectionStream Buffer containing the new section stream.\r
34 @param SectionStreamHandle A pointer to a caller-allocated UINTN that,\r
35 on output, contains the new section stream handle.\r
36\r
37 @retval EFI_SUCCESS The SectionStream was successfully processed and\r
38 the section stream handle was returned.\r
39 @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to\r
40 process the request.\r
41 @retval EFI_INVALID_PARAMETER The section stream may be corrupt or the value\r
42 of SectionStreamLength may be incorrect.\r
43\r
44**/\r
45typedef\r
46EFI_STATUS\r
47(EFIAPI *EFI_OPEN_SECTION_STREAM) (\r
48 IN EFI_SECTION_EXTRACTION_PROTOCOL *This,\r
49 IN UINTN SectionStreamLength,\r
50 IN VOID *SectionStream,\r
51 OUT UINTN *SectionStreamHandle\r
52 );\r
53\r
54/**\r
55 Reads and returns a single section from a section stream.\r
56\r
57 @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r
58 @param SectionStreamHandle Indicates from which section stream to read.\r
59 @param SectionType Pointer to an EFI_SECTION_TYPE.\r
60 @param SectionDefinitionGuid Pointer to an EFI_GUID.If SectionType ==\r
61 EFI_SECTION_GUID_DEFINED, SectionDefinitionGuid indicates what section GUID\r
62 to search for.If SectionType !=EFI_SECTION_GUID_DEFINED, then\r
63 SectionDefinitionGuid is unused and is ignored.\r
64 @param SectionInstance Indicates which instance of the requested section\r
65 type to return when SectionType is not NULL.\r
66 @param SectionStreamHandle A pointer to a caller-allocated UINTN that, on output,\r
67 contains the new section stream handle.\r
68 @param Buffer Pointer to a pointer to a buffer in which the section\r
69 contents are returned.\r
70 @param BufferSize Pointer to a caller-allocated UINTN.\r
71 @param AuthenticationStatus Pointer to a caller-allocated UINT32 in\r
72 which any meta-data from encapsulation GUID-defined sections is returned.\r
73\r
74 @retval EFI_SUCCESS The SectionStream was successfully processed and\r
75 the section contents were returned in Buffer.\r
76 @retval EFI_PROTOCOL_ERROR A GUID-defined section was encountered in\r
77 the section stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set,\r
78 but there was no corresponding GUIDed Section Extraction Protocol in\r
79 the handle database.\r
80 @retval EFI_NOT_FOUND An error was encountered when parsing the SectionStream,\r
81 which indicates that the SectionStream is not correctly formatted.\r
82 Or The requested section does not exist.\r
83 @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process\r
84 the request.\r
85 @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
86 @retval EFI_BUFFER_TOO_SMALL The size of the input buffer is insufficient to\r
87 contain the requested section.\r
88\r
89**/\r
90typedef\r
91EFI_STATUS\r
92(EFIAPI *EFI_GET_SECTION) (\r
93 IN EFI_SECTION_EXTRACTION_PROTOCOL *This,\r
94 IN UINTN SectionStreamHandle,\r
95 IN EFI_SECTION_TYPE *SectionType,\r
96 IN EFI_GUID *SectionDefinitionGuid,\r
97 IN UINTN SectionInstance,\r
98 IN VOID **Buffer,\r
99 IN OUT UINTN *BufferSize,\r
100 OUT UINT32 *AuthenticationStatus\r
101 );\r
102\r
103/**\r
104 Deletes a section stream handle and returns all associated resources to the system.\r
105\r
106 @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r
107 @param SectionStreamHandle Indicates the section stream to close.\r
108 @retval EFI_SUCCESS The SectionStream was successfully processed and\r
109 the section stream handle was returned.\r
110 @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
111\r
112**/\r
113typedef\r
114EFI_STATUS\r
115(EFIAPI *EFI_CLOSE_SECTION_STREAM) (\r
116 IN EFI_SECTION_EXTRACTION_PROTOCOL *This,\r
117 IN UINTN SectionStreamHandle\r
118 );\r
119\r
120/**\r
121 @par Protocol Description:\r
122 The Section Extraction Protocol provides a simple method of extracting \r
123 sections from arbitrarily complex files.\r
124\r
125 @param OpenSectionStream\r
126 Takes a bounded stream of sections and returns a section stream handle. \r
127\r
128 @param GetSection\r
129 Given a section stream handle, retrieves the requested section and \r
130 meta-data from the section stream. \r
131\r
132 @param CloseSectionStream\r
133 Given a section stream handle, closes the section stream.\r
134\r
135**/\r
136struct _EFI_SECTION_EXTRACTION_PROTOCOL {\r
137 EFI_OPEN_SECTION_STREAM OpenSectionStream;\r
138 EFI_GET_SECTION GetSection;\r
139 EFI_CLOSE_SECTION_STREAM CloseSectionStream;\r
140};\r
141\r
142#endif\r