Add support for EFI_IFR_QUESTION_REF3 opcode for browser when this opcode has the device path info.

Signed-off-by: ydong10
Reviewed-by: lgao4

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12759 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10
2011-11-22 07:46:35 +00:00
parent 736d06b8ec
commit db40504eae
3 changed files with 202 additions and 31 deletions

View File

@ -329,7 +329,7 @@ SendForm (
//
// Initialize internal data structures of FormSet
//
Status = InitializeFormSet (Selection->Handle, &Selection->FormSetGuid, FormSet);
Status = InitializeFormSet (Selection->Handle, &Selection->FormSetGuid, FormSet, TRUE);
if (EFI_ERROR (Status) || IsListEmpty (&FormSet->FormListHead)) {
DestroyFormSet (FormSet);
break;
@ -1220,6 +1220,7 @@ GetQuestionValue (
Status = EFI_SUCCESS;
Value = NULL;
Result = NULL;
//
// Statement don't have storage, skip them
@ -1428,7 +1429,7 @@ GetQuestionValue (
FreePool (Value);
}
} else {
if (Storage->Type == EFI_HII_VARSTORE_BUFFER) {
if (Storage->Type == EFI_HII_VARSTORE_BUFFER || Storage->Type == EFI_HII_VARSTORE_NAME_VALUE) {
//
// Request current settings from Configuration Driver
//
@ -1541,9 +1542,9 @@ GetQuestionValue (
}
}
}
FreePool (Result);
if (EFI_ERROR (Status)) {
FreePool (Result);
return Status;
}
} else if (Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
@ -1579,6 +1580,10 @@ GetQuestionValue (
} else {
SetValueByName (Storage, Question->VariableName, Value, TRUE);
}
if (Result != NULL) {
FreePool (Result);
}
}
return Status;
@ -1783,7 +1788,7 @@ SetQuestionValue (
}
if (!Cached) {
if (Storage->Type == EFI_HII_VARSTORE_BUFFER) {
if (Storage->Type == EFI_HII_VARSTORE_BUFFER || Storage->Type == EFI_HII_VARSTORE_NAME_VALUE) {
//
// <ConfigResp> ::= <ConfigHdr> + <BlockName> + "&VALUE=" + "<HexCh>StorageWidth * 2" ||
// <ConfigHdr> + "&" + <VariableName> + "=" + "<string>"
@ -2991,7 +2996,6 @@ ExtractDefault (
EFI_HII_HANDLE *HiiHandles;
UINTN Index;
EFI_GUID ZeroGuid;
UINTN BackUpClassOfVfr;
//
// Check the supported setting level.
@ -3051,7 +3055,6 @@ ExtractDefault (
// Open all FormSet by locate HII packages.
// Initiliaze the maintain FormSet to store default data as back up data.
//
BackUpClassOfVfr = gClassOfVfr;
BackUpFormSet = gOldFormSet;
gOldFormSet = NULL;
@ -3078,7 +3081,7 @@ ExtractDefault (
LocalFormSet = AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET));
ASSERT (LocalFormSet != NULL);
ZeroMem (&ZeroGuid, sizeof (ZeroGuid));
Status = InitializeFormSet (HiiHandles[Index], &ZeroGuid, LocalFormSet);
Status = InitializeFormSet (HiiHandles[Index], &ZeroGuid, LocalFormSet, FALSE);
if (EFI_ERROR (Status) || IsListEmpty (&LocalFormSet->FormListHead)) {
DestroyFormSet (LocalFormSet);
continue;
@ -3108,7 +3111,6 @@ ExtractDefault (
//
FreePool (HiiHandles);
gOldFormSet = BackUpFormSet;
gClassOfVfr = BackUpClassOfVfr;
//
// Set Default Value for each FormSet in the maintain list.
@ -3660,6 +3662,7 @@ GetIfrBinaryData (
found in package list.
On output, GUID of the formset found(if not NULL).
@param FormSet FormSet data structure.
@param UpdateGlobalVar Whether need to update the global variable.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NOT_FOUND The specified FormSet could not be found.
@ -3669,7 +3672,8 @@ EFI_STATUS
InitializeFormSet (
IN EFI_HII_HANDLE Handle,
IN OUT EFI_GUID *FormSetGuid,
OUT FORM_BROWSER_FORMSET *FormSet
OUT FORM_BROWSER_FORMSET *FormSet,
IN BOOLEAN UpdateGlobalVar
)
{
EFI_STATUS Status;
@ -3714,6 +3718,13 @@ InitializeFormSet (
return Status;
}
//
// If not need to update the global variable, just return.
//
if (!UpdateGlobalVar) {
return Status;
}
//
// Set VFR type by FormSet SubClass field
//