From f38360fbf069864238338ccc456aff7989074df0 Mon Sep 17 00:00:00 2001 From: qwang12 Date: Fri, 5 Sep 2008 07:01:47 +0000 Subject: [PATCH] Add in a temp fix to make UEFI HII SCT can pass with platform built with FrameworkHiiToUefiHiiThunk module. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5829 6f19259b-4bc3-4df7-8a09-765794883524 --- .../FrameworkHiiToUefiHiiThunk/Package.c | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c index a5bf876e25..b3e9bdd9be 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c @@ -578,22 +578,29 @@ RemovePackNotify ( ThunkContext = UefiHiiHandleToThunkContext (Private, Handle); - if (!ThunkContext->ByFrameworkHiiNewPack) { - Status = HiiLibExportPackageLists (Handle, &HiiPackageList, &BufferSize); - ASSERT_EFI_ERROR (Status); + // + // BugBug: Change to ASSERT if HII Database fix the bug and to also invoke + // NEW_PACK_NOTIFY for package (String Package) created internally. + // + if (ThunkContext != NULL) { + if (!ThunkContext->ByFrameworkHiiNewPack) { + Status = HiiLibExportPackageLists (Handle, &HiiPackageList, &BufferSize); + ASSERT_EFI_ERROR (Status); - if (GetPackageCountByType (HiiPackageList, EFI_HII_PACKAGE_STRINGS) == 1) { - // - // If the string package will be removed is the last string package - // in the package list, we will remove the HII Thunk entry from the - // database. - // - DestroyThunkContextForUefiHiiHandle (Private, Handle); + if (GetPackageCountByType (HiiPackageList, EFI_HII_PACKAGE_STRINGS) == 1) { + // + // If the string package will be removed is the last string package + // in the package list, we will remove the HII Thunk entry from the + // database. + // + DestroyThunkContextForUefiHiiHandle (Private, Handle); + } + + FreePool (HiiPackageList); } - - FreePool (HiiPackageList); } + return Status; }