diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-19 09:11:42 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-19 09:11:42 +0000 |
commit | e2701217a1fa4f5edef14a870e8ed75474d45f04 (patch) | |
tree | afea694d30a815c7ee63719a0b09d401743131d4 /MdePkg/Library/DxeExtractGuidedSectionLib | |
parent | aa09397b3c62c7b409135ed91edef8bd7bd33a73 (diff) | |
download | edk2-e2701217a1fa4f5edef14a870e8ed75474d45f04.tar.gz edk2-e2701217a1fa4f5edef14a870e8ed75474d45f04.tar.bz2 edk2-e2701217a1fa4f5edef14a870e8ed75474d45f04.zip |
Update ExtractGuidedSectionLib instance to cover the same handler is registered multi times, the later will override the pre setting.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4183 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/DxeExtractGuidedSectionLib')
-rw-r--r-- | MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c index 164691389b..acffa264fe 100644 --- a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c +++ b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c @@ -114,12 +114,32 @@ ExtractGuidedSectionRegisterHandlers ( IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER DecodeHandler
)
{
+ UINT32 Index;
//
// Check input paramter.
//
if (SectionGuid == NULL) {
return RETURN_INVALID_PARAMETER;
}
+
+ //
+ // Search the match registered GetInfo handler for the input guided section.
+ //
+ for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {
+ if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionGuid)) {
+ break;
+ }
+ }
+
+ //
+ // If the guided handler has been registered before, only update its handler.
+ //
+ if (Index < mNumberOfExtractHandler) {
+ mExtractDecodeHandlerTable [Index] = DecodeHandler;
+ mExtractGetInfoHandlerTable [Index] = GetInfoHandler;
+ return RETURN_SUCCESS;
+ }
+
//
// Check the global table is enough to contain new Handler.
//
|