diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-16 07:56:40 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-16 07:56:40 +0000 |
commit | b436ed893b1d01c5b72495c75dc0a400a97853b3 (patch) | |
tree | e3a371c1582e4f9999e889f8e7f4eb6ac0b60a93 /EdkCompatibilityPkg/Compatibility | |
parent | 1947c70c3ef17f05c19f777cf1912b090cdaac4b (diff) | |
download | edk2-platforms-b436ed893b1d01c5b72495c75dc0a400a97853b3.tar.xz |
Only generate the random GUID if a package list already exist in the database.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5902 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c index d84eadeb93..5f2aa18b84 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c @@ -308,26 +308,37 @@ UefiRegisterPackageList( }
//
- // UEFI HII database does not allow two package list with the same GUID.
- // In Framework HII implementation, Packages->GuidId is used as an identifier to associate
- // a PackageList with only IFR to a Package list the with String package.
- //
- GenerateRandomGuid (&GuidId);
-
- //
// UEFI HII require EFI_HII_CONFIG_ACCESS_PROTOCOL to be installed on a EFI_HANDLE, so
// that Setup Utility can load the Buffer Storage using this protocol.
//
if (IfrPackageCount != 0) {
InstallDefaultConfigAccessProtocol (Packages, ThunkContext);
}
- PackageListHeader = PrepareUefiPackageListFromFrameworkHiiPackages (Packages, &GuidId);
+ PackageListHeader = PrepareUefiPackageListFromFrameworkHiiPackages (Packages, &ThunkContext->TagGuid);
Status = mHiiDatabase->NewPackageList (
mHiiDatabase,
PackageListHeader,
ThunkContext->UefiHiiDriverHandle,
&ThunkContext->UefiHiiHandle
);
+ if (Status == EFI_INVALID_PARAMETER) {
+ SafeFreePool (PackageListHeader);
+
+ //
+ // UEFI HII database does not allow two package list with the same GUID.
+ // In Framework HII implementation, Packages->GuidId is used as an identifier to associate
+ // a PackageList with only IFR to a Package list the with String package.
+ //
+ GenerateRandomGuid (&GuidId);
+
+ PackageListHeader = PrepareUefiPackageListFromFrameworkHiiPackages (Packages, &GuidId);
+ Status = mHiiDatabase->NewPackageList (
+ mHiiDatabase,
+ PackageListHeader,
+ ThunkContext->UefiHiiDriverHandle,
+ &ThunkContext->UefiHiiHandle
+ );
+ }
//
// BUGBUG: Remove when development is done
|