Call EFI_BROWSER_ACTION_RETRIEVE for each form instead of only call once before enter this formset.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming, Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15465 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -25,6 +25,7 @@ UINT32 gBrowserStatus = BROWSER_SUCCESS;
|
|||||||
CHAR16 *gErrorInfo;
|
CHAR16 *gErrorInfo;
|
||||||
UINT16 mCurFakeQestId;
|
UINT16 mCurFakeQestId;
|
||||||
FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
|
FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
|
||||||
|
BOOLEAN mFinishRetrieveCall = FALSE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Evaluate all expressions in a Form.
|
Evaluate all expressions in a Form.
|
||||||
@ -2394,11 +2395,6 @@ SetupBrowser (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Selection->Handle != mCurrentHiiHandle) ||
|
|
||||||
(!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid))) {
|
|
||||||
gFinishRetrieveCall = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize current settings of Questions in this FormSet
|
// Initialize current settings of Questions in this FormSet
|
||||||
//
|
//
|
||||||
@ -2469,6 +2465,11 @@ SetupBrowser (
|
|||||||
if (((Selection->Handle != mCurrentHiiHandle) ||
|
if (((Selection->Handle != mCurrentHiiHandle) ||
|
||||||
(!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||
|
(!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||
|
||||||
(Selection->FormId != mCurrentFormId))) {
|
(Selection->FormId != mCurrentFormId))) {
|
||||||
|
//
|
||||||
|
// Update Retrieve flag.
|
||||||
|
//
|
||||||
|
mFinishRetrieveCall = FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Keep current form information
|
// Keep current form information
|
||||||
//
|
//
|
||||||
@ -2477,7 +2478,7 @@ SetupBrowser (
|
|||||||
mCurrentFormId = Selection->FormId;
|
mCurrentFormId = Selection->FormId;
|
||||||
|
|
||||||
if (ConfigAccess != NULL) {
|
if (ConfigAccess != NULL) {
|
||||||
Status = ProcessCallBackFunction (Selection, gCurrentSelection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);
|
Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
@ -2501,18 +2502,27 @@ SetupBrowser (
|
|||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
if (!mFinishRetrieveCall) {
|
||||||
// Finish call RETRIEVE callback for this formset.
|
//
|
||||||
//
|
// Finish call RETRIEVE callback for this form.
|
||||||
gFinishRetrieveCall = TRUE;
|
//
|
||||||
|
mFinishRetrieveCall = TRUE;
|
||||||
|
|
||||||
//
|
if (ConfigAccess != NULL) {
|
||||||
// IFR is updated during callback of read value, force to reparse the IFR binary
|
Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_RETRIEVE, FALSE);
|
||||||
//
|
if (EFI_ERROR (Status)) {
|
||||||
if (mHiiPackageListUpdated) {
|
goto Done;
|
||||||
Selection->Action = UI_ACTION_REFRESH_FORMSET;
|
}
|
||||||
mHiiPackageListUpdated = FALSE;
|
|
||||||
break;
|
//
|
||||||
|
// IFR is updated during callback of open form, force to reparse the IFR binary
|
||||||
|
//
|
||||||
|
if (mHiiPackageListUpdated) {
|
||||||
|
Selection->Action = UI_ACTION_REFRESH_FORMSET;
|
||||||
|
mHiiPackageListUpdated = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -48,7 +48,6 @@ LIST_ENTRY gBrowserFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserFor
|
|||||||
LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList);
|
LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList);
|
||||||
LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList);
|
LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList);
|
||||||
|
|
||||||
BOOLEAN gFinishRetrieveCall;
|
|
||||||
BOOLEAN gResetRequired;
|
BOOLEAN gResetRequired;
|
||||||
BOOLEAN gExitRequired;
|
BOOLEAN gExitRequired;
|
||||||
BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel;
|
BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel;
|
||||||
@ -258,11 +257,8 @@ LoadAllHiiFormset (
|
|||||||
EFI_GUID ZeroGuid;
|
EFI_GUID ZeroGuid;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
FORM_BROWSER_FORMSET *OldFormset;
|
FORM_BROWSER_FORMSET *OldFormset;
|
||||||
BOOLEAN OldRetrieveValue;
|
|
||||||
|
|
||||||
OldFormset = mSystemLevelFormSet;
|
OldFormset = mSystemLevelFormSet;
|
||||||
OldRetrieveValue = gFinishRetrieveCall;
|
|
||||||
gFinishRetrieveCall = FALSE;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get all the Hii handles
|
// Get all the Hii handles
|
||||||
@ -311,7 +307,6 @@ LoadAllHiiFormset (
|
|||||||
//
|
//
|
||||||
FreePool (HiiHandles);
|
FreePool (HiiHandles);
|
||||||
|
|
||||||
gFinishRetrieveCall = OldRetrieveValue;
|
|
||||||
mSystemLevelFormSet = OldFormset;
|
mSystemLevelFormSet = OldFormset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +365,6 @@ SendForm (
|
|||||||
//
|
//
|
||||||
SaveBrowserContext ();
|
SaveBrowserContext ();
|
||||||
|
|
||||||
gFinishRetrieveCall = FALSE;
|
|
||||||
gResetRequired = FALSE;
|
gResetRequired = FALSE;
|
||||||
gExitRequired = FALSE;
|
gExitRequired = FALSE;
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
@ -3483,8 +3477,6 @@ LoadFormConfig (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
FORM_BROWSER_STATEMENT *Question;
|
FORM_BROWSER_STATEMENT *Question;
|
||||||
UINT8 *BufferValue;
|
|
||||||
UINTN StorageWidth;
|
|
||||||
|
|
||||||
Link = GetFirstNode (&Form->StatementListHead);
|
Link = GetFirstNode (&Form->StatementListHead);
|
||||||
while (!IsNull (&Form->StatementListHead, Link)) {
|
while (!IsNull (&Form->StatementListHead, Link)) {
|
||||||
@ -3506,38 +3498,6 @@ LoadFormConfig (
|
|||||||
HiiSetString (FormSet->HiiHandle, Question->HiiValue.Value.string, (CHAR16*)Question->BufferValue, NULL);
|
HiiSetString (FormSet->HiiHandle, Question->HiiValue.Value.string, (CHAR16*)Question->BufferValue, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Call the Retrieve call back function for all questions.
|
|
||||||
//
|
|
||||||
if ((FormSet->ConfigAccess != NULL) && (Selection != NULL) &&
|
|
||||||
((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) &&
|
|
||||||
!gFinishRetrieveCall) {
|
|
||||||
//
|
|
||||||
// Check QuestionValue does exist.
|
|
||||||
//
|
|
||||||
StorageWidth = Question->StorageWidth;
|
|
||||||
if (Question->BufferValue != NULL) {
|
|
||||||
BufferValue = Question->BufferValue;
|
|
||||||
} else {
|
|
||||||
BufferValue = (UINT8 *) &Question->HiiValue.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// For efivarstore storage, initial question value first.
|
|
||||||
//
|
|
||||||
if ((Question->Storage != NULL) && (Question->Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE)) {
|
|
||||||
Status = gRT->GetVariable (
|
|
||||||
Question->VariableName,
|
|
||||||
&Question->Storage->Guid,
|
|
||||||
NULL,
|
|
||||||
&StorageWidth,
|
|
||||||
BufferValue
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = ProcessCallBackFunction(Selection, FormSet, Form, Question, EFI_BROWSER_ACTION_RETRIEVE, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
Link = GetNextNode (&Form->StatementListHead, Link);
|
Link = GetNextNode (&Form->StatementListHead, Link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -546,7 +546,6 @@ extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;
|
|||||||
|
|
||||||
extern BOOLEAN gResetRequired;
|
extern BOOLEAN gResetRequired;
|
||||||
extern BOOLEAN gExitRequired;
|
extern BOOLEAN gExitRequired;
|
||||||
extern BOOLEAN gFinishRetrieveCall;
|
|
||||||
extern LIST_ENTRY gBrowserFormSetList;
|
extern LIST_ENTRY gBrowserFormSetList;
|
||||||
extern LIST_ENTRY gBrowserHotKeyList;
|
extern LIST_ENTRY gBrowserHotKeyList;
|
||||||
extern BROWSER_SETTING_SCOPE gBrowserSettingScope;
|
extern BROWSER_SETTING_SCOPE gBrowserSettingScope;
|
||||||
|
Reference in New Issue
Block a user