16#define EXTRACT_HANDLER_INFO_SIGNATURE SIGNATURE_32 ('E', 'G', 'S', 'I')
20 UINT32 NumberOfExtractHandler;
21 GUID *ExtractHandlerGuidTable;
47 if (HandlerInfo ==
NULL) {
49 return EFI_OUT_OF_RESOURCES;
55 if (HandlerInfo->Signature == EXTRACT_HANDLER_INFO_SIGNATURE) {
59 *InfoPointer = HandlerInfo;
66 HandlerInfo->Signature = EXTRACT_HANDLER_INFO_SIGNATURE;
67 if (HandlerInfo->Signature != EXTRACT_HANDLER_INFO_SIGNATURE) {
78 HandlerInfo->NumberOfExtractHandler = 0;
79 HandlerInfo->ExtractHandlerGuidTable = (
GUID *)(HandlerInfo + 1);
81 (UINT8 *)HandlerInfo->ExtractHandlerGuidTable +
82 PcdGet32 (PcdMaximumGuidedExtractHandler) *
sizeof (
GUID)
85 (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable +
86 PcdGet32 (PcdMaximumGuidedExtractHandler) *
89 *InfoPointer = HandlerInfo;
110 OUT GUID **ExtractHandlerGuidTable
113 RETURN_STATUS Status;
116 ASSERT (ExtractHandlerGuidTable !=
NULL);
123 *ExtractHandlerGuidTable =
NULL;
130 ASSERT (HandlerInfo !=
NULL);
131 *ExtractHandlerGuidTable = HandlerInfo->ExtractHandlerGuidTable;
132 return HandlerInfo->NumberOfExtractHandler;
168 RETURN_STATUS Status;
174 ASSERT (SectionGuid !=
NULL);
175 ASSERT (GetInfoHandler !=
NULL);
176 ASSERT (DecodeHandler !=
NULL);
189 ASSERT (HandlerInfo !=
NULL);
190 for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
191 if (
CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
195 HandlerInfo->ExtractDecodeHandlerTable[Index] = DecodeHandler;
196 HandlerInfo->ExtractGetInfoHandlerTable[Index] = GetInfoHandler;
204 if (HandlerInfo->NumberOfExtractHandler >=
PcdGet32 (PcdMaximumGuidedExtractHandler)) {
211 CopyGuid (HandlerInfo->ExtractHandlerGuidTable + HandlerInfo->NumberOfExtractHandler, SectionGuid);
212 HandlerInfo->ExtractDecodeHandlerTable[HandlerInfo->NumberOfExtractHandler] = DecodeHandler;
213 HandlerInfo->ExtractGetInfoHandlerTable[HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;
256 OUT UINT32 *OutputBufferSize,
257 OUT UINT32 *ScratchBufferSize,
258 OUT UINT16 *SectionAttribute
262 RETURN_STATUS Status;
269 ASSERT (InputSection !=
NULL);
270 ASSERT (OutputBufferSize !=
NULL);
271 ASSERT (ScratchBufferSize !=
NULL);
272 ASSERT (SectionAttribute !=
NULL);
282 if (IS_SECTION2 (InputSection)) {
291 ASSERT (HandlerInfo !=
NULL);
292 for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
293 if (
CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
297 return HandlerInfo->ExtractGetInfoHandlerTable[Index](
351 OUT VOID **OutputBuffer,
352 IN VOID *ScratchBuffer OPTIONAL,
353 OUT UINT32 *AuthenticationStatus
357 RETURN_STATUS Status;
364 ASSERT (InputSection !=
NULL);
365 ASSERT (OutputBuffer !=
NULL);
366 ASSERT (AuthenticationStatus !=
NULL);
376 if (IS_SECTION2 (InputSection)) {
385 ASSERT (HandlerInfo !=
NULL);
386 for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
387 if (
CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
391 return HandlerInfo->ExtractDecodeHandlerTable[Index](
442 RETURN_STATUS Status;
448 ASSERT (SectionGuid !=
NULL);
461 ASSERT (HandlerInfo !=
NULL);
462 for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
463 if (
CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
467 if (GetInfoHandler !=
NULL) {
468 *GetInfoHandler = HandlerInfo->ExtractGetInfoHandlerTable[Index];
471 if (DecodeHandler !=
NULL) {
472 *DecodeHandler = HandlerInfo->ExtractDecodeHandlerTable[Index];
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
#define RETURN_ERROR(StatusCode)
#define RETURN_UNSUPPORTED
#define RETURN_OUT_OF_RESOURCES
#define PcdGet64(TokenName)
#define PcdGet32(TokenName)