diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-17 05:28:31 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-17 05:28:31 +0000 |
commit | d91c7bf9e42e8be23bb67bf7c189348b4ec11797 (patch) | |
tree | 6ec665a716fd00837295a548f77ac35b32e460c4 /MdeModulePkg/Library/UefiHiiLib | |
parent | 6924b7ae2609f05fce279e23ab00159f51cd33cd (diff) | |
download | edk2-platforms-d91c7bf9e42e8be23bb67bf7c189348b4ec11797.tar.xz |
Update HiiLib to copy all IfrOpcode, not Opcode by Opcode.
Update DriverSampleDxe to use new UEFI 2.1 classguid
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8114 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/UefiHiiLib')
-rw-r--r-- | MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c index e1d8a64730..d36828a115 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c @@ -2191,8 +2191,7 @@ InternalHiiUpdateFormPackageData ( BOOLEAN GetFormSet;
BOOLEAN GetForm;
BOOLEAN Updated;
- EFI_IFR_OP_HEADER *AddOpCode;
- UINT32 UpdatePackageLength;
+ UINTN UpdatePackageLength;
CopyMem (TempPackage, Package, sizeof (EFI_HII_PACKAGE_HEADER));
UpdatePackageLength = sizeof (EFI_HII_PACKAGE_HEADER);
@@ -2230,7 +2229,7 @@ InternalHiiUpdateFormPackageData ( //
// The matched Form is found, and Update data in this form
//
- if (GetFormSet && GetForm && !Updated) {
+ if (GetFormSet && GetForm) {
UpdateIfrOpHdr = (EFI_IFR_OP_HEADER *) OpCodeBufferStart->Buffer;
if ((UpdateIfrOpHdr->Length == IfrOpHdr->Length) && \
(CompareMem (IfrOpHdr, UpdateIfrOpHdr, UpdateIfrOpHdr->Length) == 0)) {
@@ -2263,22 +2262,14 @@ InternalHiiUpdateFormPackageData ( return EFI_NOT_FOUND;
}
}
+
//
// Insert the updated data
//
- UpdateIfrOpHdr = (EFI_IFR_OP_HEADER *) OpCodeBufferStart->Buffer;
- AddSize = UpdateIfrOpHdr->Length;
- AddOpCode = (EFI_IFR_OP_HEADER *) (OpCodeBufferStart->Buffer + AddSize);
- while (AddSize < OpCodeBufferStart->Position) {
- CopyMem (BufferPos, AddOpCode, AddOpCode->Length);
- BufferPos += AddOpCode->Length;
- UpdatePackageLength += AddOpCode->Length;
-
- AddSize += AddOpCode->Length;
- AddOpCode = (EFI_IFR_OP_HEADER *) (OpCodeBufferStart->Buffer + AddSize);
- }
-
- ASSERT (AddSize == OpCodeBufferStart->Position);
+ AddSize = ((EFI_IFR_OP_HEADER *) OpCodeBufferStart->Buffer)->Length;
+ CopyMem (BufferPos, OpCodeBufferStart->Buffer + AddSize, OpCodeBufferStart->Position - AddSize);
+ BufferPos += OpCodeBufferStart->Position - AddSize;
+ UpdatePackageLength += OpCodeBufferStart->Position - AddSize;
if (OpCodeBufferEnd != NULL) {
//
@@ -2288,10 +2279,19 @@ InternalHiiUpdateFormPackageData ( BufferPos += IfrOpHdr->Length;
UpdatePackageLength += IfrOpHdr->Length;
}
+
+ //
+ // Copy the left package data.
+ //
+ Offset += IfrOpHdr->Length;
+ CopyMem (BufferPos, (UINT8 *) Package + Offset, PackageHeader.Length - Offset);
+ UpdatePackageLength += PackageHeader.Length - Offset;
+
//
// Set update flag
//
Updated = TRUE;
+ break;
}
}
@@ -2311,7 +2311,7 @@ InternalHiiUpdateFormPackageData ( //
// Update the package length.
//
- PackageHeader.Length = UpdatePackageLength;
+ PackageHeader.Length = (UINT32) UpdatePackageLength;
CopyMem (TempPackage, &PackageHeader, sizeof (EFI_HII_PACKAGE_HEADER));
return EFI_SUCCESS;
|