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
This commit is contained in:
ydong10
2010-12-23 06:47:50 +00:00
parent 7b546f7480
commit e2100bfa65
8 changed files with 89 additions and 69 deletions

View File

@@ -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;