]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
Move SecExtractGuidedSectionLib instance from OvmfPkg to MdePkg
[mirror_edk2.git] / MdePkg / Library / PeiExtractGuidedSectionLib / PeiExtractGuidedSectionLib.c
index 6b2797778cb20813fcd25b45a0c0dd43af0d77a2..d5c20c5a96e12117aef5b5a5f8a2340c5c6c7a05 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provide generic extract guided section functions for PEI phase.\r
 \r
-  Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -67,7 +67,7 @@ PeiGetExtractGuidedSectionHandlerInfo (
           HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) (\r
                                                       (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + \r
                                                       PcdGet32 (PcdMaximumGuidedExtractHandler) * \r
-                                                      sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER)\r
+                                                      sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER)\r
                                                      );\r
         }\r
         //\r
@@ -94,6 +94,7 @@ PeiGetExtractGuidedSectionHandlerInfo (
     //\r
     // No enough resource to build guid hob.\r
     //\r
+    *InfoPointer = NULL;\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   //\r
@@ -109,7 +110,7 @@ PeiGetExtractGuidedSectionHandlerInfo (
   HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) (\r
                                               (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + \r
                                               PcdGet32 (PcdMaximumGuidedExtractHandler) * \r
-                                              sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER)\r
+                                              sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER)\r
                                              );\r
   //\r
   // return the created HandlerInfo.\r
@@ -148,7 +149,8 @@ ExtractGuidedSectionGetGuidList (
   //\r
   Status = PeiGetExtractGuidedSectionHandlerInfo (&HandlerInfo);\r
   if (EFI_ERROR (Status)) {\r
-    return Status;\r
+    *ExtractHandlerGuidTable = NULL;\r
+    return 0;\r
   }\r
 \r
   //\r
@@ -238,7 +240,7 @@ ExtractGuidedSectionRegisterHandlers (
   CopyGuid (HandlerInfo->ExtractHandlerGuidTable + HandlerInfo->NumberOfExtractHandler, SectionGuid);\r
   HandlerInfo->ExtractDecodeHandlerTable [HandlerInfo->NumberOfExtractHandler] = DecodeHandler;\r
   HandlerInfo->ExtractGetInfoHandlerTable [HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;\r
-  \r
+\r
   return RETURN_SUCCESS;\r
 }\r
 \r