summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-18 09:12:59 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-18 09:12:59 +0000
commite6c560aad63b09e6aaee3ccc65be462651772fe5 (patch)
treeea8a7bd938ec2060e395df4b86f3f97beabfc500 /MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib
parentd7f73f568f45c863b44fb2a0fecae8b8c36311d4 (diff)
downloadedk2-e6c560aad63b09e6aaee3ccc65be462651772fe5.zip
edk2-e6c560aad63b09e6aaee3ccc65be462651772fe5.tar.gz
edk2-e6c560aad63b09e6aaee3ccc65be462651772fe5.tar.bz2
Make GuidedSection library instance to follow the value of GuidedSectionExtraction protocol/PPI defined in PI spec.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4165 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib')
-rw-r--r--MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c20
-rw-r--r--MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf1
2 files changed, 18 insertions, 3 deletions
diff --git a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
index 6deb8dc..8e2cc02 100644
--- a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
+++ b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
@@ -27,6 +27,7 @@ Abstract:
#include <Protocol/SecurityPolicy.h>
#include <Library/ExtractGuidedSectionLib.h>
#include <Library/DebugLib.h>
+#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
typedef struct {
@@ -57,10 +58,16 @@ Arguments:
Returns:
EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
+ EFI_INVALID_PARAMETER - The source data is corrupted, or
+ The GUID in InputSection does not match this instance guid.
--*/
{
+ if (!CompareGuid (
+ &gEfiCrc32GuidedSectionExtractionProtocolGuid,
+ &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
+ return EFI_INVALID_PARAMETER;
+ }
//
// Retrieve the size and attribute of the input section data.
//
@@ -97,8 +104,9 @@ Arguments:
Returns:
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
+ RETURN_SUCCESS - Decompression is successfull
+ RETURN_INVALID_PARAMETER - The source data is corrupted, or
+ The GUID in InputSection does not match this instance guid.
--*/
{
@@ -108,6 +116,12 @@ Returns:
UINT32 OutputBufferSize;
VOID *DummyInterface;
+ if (!CompareGuid (
+ &gEfiCrc32GuidedSectionExtractionProtocolGuid,
+ &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
+ return EFI_INVALID_PARAMETER;
+ }
+
Crc32Checksum = 0;
//
// Points to the Crc32 section header
diff --git a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
index d5f136d..b5cbdce 100644
--- a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
+++ b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
@@ -41,6 +41,7 @@
ExtractGuidedSectionLib
UefiBootServicesTableLib
DebugLib
+ BaseMemoryLib
[Protocols]
gEfiCrc32GuidedSectionExtractionProtocolGuid