diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-20 08:14:08 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-20 08:14:08 +0000 |
commit | a54205363ca2eb65ac18654b671f24a0c6ae1c66 (patch) | |
tree | 96d107c1056050e74e8016667c7c05fa2e07f2ba /EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c | |
parent | 6412128af3f7a7e118605109713edf2f3dae3bd6 (diff) | |
download | edk2-platforms-a54205363ca2eb65ac18654b671f24a0c6ae1c66.tar.xz |
Update FrameworkHiiOnUefiHiiThunk to use new HII library.
And add the internal CreateRawOpCode API for the unsupported OpCode: String and Ref.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8136 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c index 623e832826..484e306be2 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c @@ -488,24 +488,25 @@ HiiThunkUpdateForm ( IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN EFI_FORM_LABEL Label,
IN BOOLEAN AddData,
- IN FRAMEWORK_EFI_HII_UPDATE_DATA *Data
+ IN FRAMEWORK_EFI_HII_UPDATE_DATA *Data
)
{
EFI_STATUS Status;
HII_THUNK_PRIVATE_DATA *Private;
- HII_THUNK_CONTEXT *ThunkContext;
- EFI_HII_UPDATE_DATA *UefiHiiUpdateData;
+ HII_THUNK_CONTEXT *ThunkContext;
EFI_HII_HANDLE UefiHiiHandle;
EFI_GUID FormsetGuid;
EFI_FORM_ID FormId;
EFI_TPL OldTpl;
+ VOID *StartOpCodeHandle;
+ VOID *EndOpCodeHandle;
+ EFI_IFR_GUID_LABEL *StartLabel;
+ EFI_IFR_GUID_LABEL *EndLabel;
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
mInFrameworkUpdatePakcage = TRUE;
Status = EFI_SUCCESS;
- UefiHiiUpdateData = NULL;
-
Private = HII_THUNK_PRIVATE_DATA_FROM_THIS(This);
@@ -539,34 +540,51 @@ HiiThunkUpdateForm ( goto Done;
}
+ //
+ // Init OpCode Handle
+ //
+ StartOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (StartOpCodeHandle != NULL);
+
+ EndOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (EndOpCodeHandle != NULL);
+
+ //
+ // Create Hii Extend Label OpCode as the start opcode
+ //
+ StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
+ StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
+ StartLabel->Number = Label;
+
+ //
+ // Create Hii Extend Label OpCode as the end opcode
+ //
+ EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
+ EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
+ EndLabel->Number = 0xffff;
+
if (AddData) {
if (Data->DataCount != 0) {
ThunkContext = UefiHiiHandleToThunkContext (Private, UefiHiiHandle);
- Status = FwUpdateDataToUefiUpdateData (ThunkContext, Data, &UefiHiiUpdateData);
+ Status = FwUpdateDataToUefiUpdateData (ThunkContext, Data, StartOpCodeHandle);
ASSERT_EFI_ERROR (Status);
- Status = IfrLibUpdateForm (UefiHiiHandle, &FormsetGuid, FormId, Label, TRUE, UefiHiiUpdateData);
+ Status = HiiUpdateForm (UefiHiiHandle, &FormsetGuid, FormId, StartOpCodeHandle, NULL);
ASSERT_EFI_ERROR (Status);
-
- }
+ }
} else {
//
// Delete Opcode starting from Labe in FormId found
//
- UefiHiiUpdateData = AllocateZeroPool (sizeof (*UefiHiiUpdateData));
-
- Status = IfrLibUpdateForm (UefiHiiHandle, &FormsetGuid, FormId, Label, FALSE, UefiHiiUpdateData);
+ Status = HiiUpdateForm (UefiHiiHandle, &FormsetGuid, FormId, StartOpCodeHandle, EndOpCodeHandle);
ASSERT_EFI_ERROR (Status);
}
+ HiiFreeOpCodeHandle (StartOpCodeHandle);
+ HiiFreeOpCodeHandle (EndOpCodeHandle);
+
Done:
- if (UefiHiiUpdateData != NULL) {
- if (UefiHiiUpdateData->Data != NULL) {
- FreePool (UefiHiiUpdateData->Data);
- }
- FreePool (UefiHiiUpdateData);
- }
mInFrameworkUpdatePakcage = FALSE;
|