diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-11-04 14:28:08 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-11-04 14:28:08 +0000 |
commit | 8d00a0f1955de7aa4b658009a36df5165d0a75be (patch) | |
tree | 1eec5d9bd12036da7ebf1ec38d5f7afbfd2a4e03 /MdeModulePkg/Library | |
parent | 9185c388a9e992bcbcf38d10fb24321a60950562 (diff) | |
download | edk2-platforms-8d00a0f1955de7aa4b658009a36df5165d0a75be.tar.xz |
Sync in bug fix from EDK I:
1) issue with setup browser and IFR refresh opcode
2) [HII]HIIConfigRoutingExportConfig generate error format of <MultiConfigAltResp>
3) [HII] ConfigRouting->ExtractConfig() will cause overflow
4) [Hii Database] EFI_HII_DATABASE_NOTIFY should be invoked when a string package is created internally when a new String Token is created
5) [PT]HIIConfigAccessProtocolTest fail on NT32uefi
6) Incorrect HII package types in EDK
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6378 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r-- | MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c | 54 |
2 files changed, 54 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c b/MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c index 2b639c9bb8..e74c709df7 100644 --- a/MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c +++ b/MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c @@ -125,7 +125,7 @@ IfrLibExtractClassFromHiiHandle ( Package = ((UINT8 *) HiiPackageList) + Offset;
CopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
- if (PackageHeader.Type == EFI_HII_PACKAGE_FORM) {
+ if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {
//
// Search Class Opcode in this Form Package
//
diff --git a/MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c b/MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c index d37821963c..a973d8f2dc 100644 --- a/MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c +++ b/MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c @@ -274,6 +274,58 @@ Fail: return EFI_SUCCESS;
}
+/**
+ This function initialize the data structure for dynamic opcode.
+
+ @param UpdateData The adding data;
+ @param BufferSize Length of the buffer to fill dynamic opcodes.
+
+ @retval EFI_SUCCESS Update data is initialized.
+ @retval EFI_INVALID_PARAMETER UpdateData is NULL.
+ @retval EFI_OUT_OF_RESOURCES No enough memory to allocate.
+
+**/
+EFI_STATUS
+IfrLibInitUpdateData (
+ IN OUT EFI_HII_UPDATE_DATA *UpdateData,
+ IN UINT32 BufferSize
+ )
+{
+ ASSERT (UpdateData != NULL);
+
+ UpdateData->BufferSize = BufferSize;
+ UpdateData->Offset = 0;
+ UpdateData->Data = AllocatePool (BufferSize);
+
+ return (UpdateData->Data != NULL) ? EFI_SUCCESS : EFI_OUT_OF_RESOURCES;
+}
+
+/**
+
+ This function free the resource of update data.
+
+ @param UpdateData The adding data;
+
+ @retval EFI_SUCCESS Resource in UpdateData is released.
+ @retval EFI_INVALID_PARAMETER UpdateData is NULL.
+
+**/
+EFI_STATUS
+IfrLibFreeUpdateData (
+ IN EFI_HII_UPDATE_DATA *UpdateData
+ )
+{
+ EFI_STATUS Status;
+
+ if (UpdateData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Status = gBS->FreePool (UpdateData->Data);
+ UpdateData->Data = NULL;
+
+ return Status;
+}
/**
This function allows the caller to update a form that has
@@ -364,7 +416,7 @@ IfrLibUpdateForm ( Status = GetPackageDataFromPackageList (HiiPackageList, Index, &PackageLength, &Package);
if (Status == EFI_SUCCESS) {
CopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
- if ((PackageHeader.Type == EFI_HII_PACKAGE_FORM) && !Updated) {
+ if ((PackageHeader.Type == EFI_HII_PACKAGE_FORMS) && !Updated) {
Status = UpdateFormPackageData (FormSetGuid, FormId, Package, PackageLength, Label, Insert, Data, (UINT8 **)&TempBuffer, &TempBufferSize);
if (!EFI_ERROR(Status)) {
if (FormSetGuid == NULL) {
|