Fix a bug that FV->ReadSection cannot get the EFI_SECTION_GUID_DEFINED type section...
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 21 Apr 2010 02:41:15 +0000 (02:41 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 21 Apr 2010 02:41:15 +0000 (02:41 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10385 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtraction.c

index 6bab4db1f091dd5adf66982bbf2a9542b000d783..5d3bb50da7163a50f477ccae4527d8180cf6f573 100644 (file)
@@ -327,7 +327,7 @@ OpenSectionStreamEx (
   )\r
 {\r
   FRAMEWORK_SECTION_STREAM_NODE    *NewStream;\r
-  EFI_TPL                     OldTpl;\r
+  EFI_TPL                          OldTpl;\r
   \r
   //\r
   // Allocate a new stream\r
@@ -446,8 +446,8 @@ BOOLEAN
 ChildIsType (\r
   IN FRAMEWORK_SECTION_STREAM_NODE *Stream,\r
   IN FRAMEWORK_SECTION_CHILD_NODE  *Child,\r
-  IN EFI_SECTION_TYPE         SearchType,\r
-  IN EFI_GUID                 *SectionDefinitionGuid\r
+  IN EFI_SECTION_TYPE              SearchType,\r
+  IN EFI_GUID                      *SectionDefinitionGuid\r
   )\r
 {\r
   EFI_GUID_DEFINED_SECTION    *GuidedSection;\r
@@ -458,7 +458,7 @@ ChildIsType (
   if (Child->Type != SearchType) {\r
     return FALSE;\r
   }\r
-  if (SearchType != EFI_SECTION_GUID_DEFINED) {\r
+  if ((SearchType != EFI_SECTION_GUID_DEFINED) || (SectionDefinitionGuid == NULL)) {\r
     return TRUE;\r
   }\r
   GuidedSection = (EFI_GUID_DEFINED_SECTION * )(Stream->StreamBuffer + Child->OffsetInStream);\r
@@ -1155,11 +1155,11 @@ GetSection (
   OUT UINT32                                            *AuthenticationStatus\r
   )\r
 {\r
-  FRAMEWORK_SECTION_STREAM_NODE                              *StreamNode;\r
+  FRAMEWORK_SECTION_STREAM_NODE                         *StreamNode;\r
   EFI_TPL                                               OldTpl;\r
   EFI_STATUS                                            Status;\r
-  FRAMEWORK_SECTION_CHILD_NODE                               *ChildNode;\r
-  FRAMEWORK_SECTION_STREAM_NODE                              *ChildStreamNode;\r
+  FRAMEWORK_SECTION_CHILD_NODE                          *ChildNode;\r
+  FRAMEWORK_SECTION_STREAM_NODE                         *ChildStreamNode;\r
   UINTN                                                 CopySize;\r
   UINT32                                                ExtractedAuthenticationStatus;\r
   UINTN                                                 Instance;\r