diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-12-23 06:47:50 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-12-23 06:47:50 +0000 |
commit | e2100bfa651cd0d1295ef13451b9cf4adddb8bfa (patch) | |
tree | f66ecec3f0655199fb98e79780e376c82891d40a /MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | |
parent | 7b546f7480c39e72d230970cf114ab333c912eb7 (diff) | |
download | edk2-platforms-e2100bfa651cd0d1295ef13451b9cf4adddb8bfa.tar.xz |
1. Support inconsistent if opcode used in string/password opcode.
2. Add sample code of using inconsistent if opcode in string opcode.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11196 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c index 4923478954..314f91b529 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -542,11 +542,13 @@ DestroyStorage ( /**
Free resources of a Statement.
+ @param FormSet Pointer of the FormSet
@param Statement Pointer of the Statement
**/
VOID
DestroyStatement (
+ IN FORM_BROWSER_FORMSET *FormSet,
IN OUT FORM_BROWSER_STATEMENT *Statement
)
{
@@ -608,18 +610,23 @@ DestroyStatement ( if (Statement->BufferValue != NULL) {
FreePool (Statement->BufferValue);
}
+ if (Statement->Operand == EFI_IFR_STRING_OP || Statement->Operand == EFI_IFR_PASSWORD_OP) {
+ DeleteString(Statement->HiiValue.Value.string, FormSet->HiiHandle);
+ }
}
/**
Free resources of a Form.
+ @param FormSet Pointer of the FormSet
@param Form Pointer of the Form.
**/
VOID
DestroyForm (
- IN OUT FORM_BROWSER_FORM *Form
+ IN FORM_BROWSER_FORMSET *FormSet,
+ IN OUT FORM_BROWSER_FORM *Form
)
{
LIST_ENTRY *Link;
@@ -645,7 +652,7 @@ DestroyForm ( Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
RemoveEntryList (&Statement->Link);
- DestroyStatement (Statement);
+ DestroyStatement (FormSet, Statement);
}
//
@@ -731,7 +738,7 @@ DestroyFormSet ( Form = FORM_BROWSER_FORM_FROM_LINK (Link);
RemoveEntryList (&Form->Link);
- DestroyForm (Form);
+ DestroyForm (FormSet, Form);
}
}
@@ -1580,6 +1587,7 @@ ParseOpCodes ( CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_STRING;
CurrentStatement->BufferValue = AllocateZeroPool (CurrentStatement->StorageWidth + sizeof (CHAR16));
+ CurrentStatement->HiiValue.Value.string = NewString ((CHAR16*) CurrentStatement->BufferValue, FormSet->HiiHandle);
InitializeRequestElement (FormSet, CurrentStatement);
break;
@@ -1598,6 +1606,7 @@ ParseOpCodes ( CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_STRING;
CurrentStatement->BufferValue = AllocateZeroPool ((CurrentStatement->StorageWidth + sizeof (CHAR16)));
+ CurrentStatement->HiiValue.Value.string = NewString ((CHAR16*) CurrentStatement->BufferValue, FormSet->HiiHandle);
InitializeRequestElement (FormSet, CurrentStatement);
break;
|