summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiExtractGuidedSectionLib
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/PeiExtractGuidedSectionLib')
-rw-r--r--MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
index fa382ae3c8..1fad3d0c47 100644
--- a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
+++ b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
@@ -1,7 +1,7 @@
/** @file
Provide generic extract guided section functions for PEI phase.
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -290,6 +290,7 @@ ExtractGuidedSectionGetInfo (
UINT32 Index;
EFI_STATUS Status;
PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
+ EFI_GUID *SectionDefinitionGuid;
//
// Check input paramter
@@ -306,12 +307,18 @@ ExtractGuidedSectionGetInfo (
if (EFI_ERROR (Status)) {
return Status;
}
-
+
+ if (IS_SECTION2 (InputSection)) {
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
+ } else {
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
+ }
+
//
// Search the match registered GetInfo handler for the input guided section.
//
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
+ if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
//
// Call the match handler to get information for the input section data.
//
@@ -377,6 +384,7 @@ ExtractGuidedSectionDecode (
UINT32 Index;
EFI_STATUS Status;
PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
+ EFI_GUID *SectionDefinitionGuid;
//
// Check input parameter
@@ -393,11 +401,17 @@ ExtractGuidedSectionDecode (
return Status;
}
+ if (IS_SECTION2 (InputSection)) {
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
+ } else {
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
+ }
+
//
// Search the match registered Extract handler for the input guided section.
//
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
+ if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
//
// Call the match handler to extract raw data for the input guided section.
//