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@14727
6f19259b-4bc3-4df7-8a09-
765794883524
//\r
// Question value may be changed, need invoke its Callback()\r
//\r
//\r
// Question value may be changed, need invoke its Callback()\r
//\r
- ProcessCallBackFunction (gCurrentSelection, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);\r
+ ProcessCallBackFunction (gCurrentSelection, gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, EFI_BROWSER_ACTION_RETRIEVE, FALSE);\r
\r
if (mHiiPackageListUpdated) {\r
//\r
\r
if (mHiiPackageListUpdated) {\r
//\r
//\r
// Check whether the device path string is a valid string.\r
//\r
//\r
// Check whether the device path string is a valid string.\r
//\r
- if (Statement->HiiValue.Value.ref.DevicePath != 0 && StringPtr != NULL) {\r
+ if (Statement->HiiValue.Value.ref.DevicePath != 0 && StringPtr != NULL && StringPtr[0] != L'\0') {\r
if (Selection->Form->ModalForm) {\r
return Status;\r
}\r
if (Selection->Form->ModalForm) {\r
return Status;\r
}\r
about the Selection, form and formset to be displayed.\r
On output, Selection return the screen item that is selected\r
by user.\r
about the Selection, form and formset to be displayed.\r
On output, Selection return the screen item that is selected\r
by user.\r
+ @param FormSet The formset this question belong to.\r
+ @param Form The form this question belong to.\r
@param Question The Question which need to call.\r
@param Action The action request.\r
@param SkipSaveOrDiscard Whether skip save or discard action.\r
@param Question The Question which need to call.\r
@param Action The action request.\r
@param SkipSaveOrDiscard Whether skip save or discard action.\r
EFI_STATUS \r
ProcessCallBackFunction (\r
IN OUT UI_MENU_SELECTION *Selection,\r
EFI_STATUS \r
ProcessCallBackFunction (\r
IN OUT UI_MENU_SELECTION *Selection,\r
+ IN FORM_BROWSER_FORMSET *FormSet,\r
+ IN FORM_BROWSER_FORM *Form,\r
IN FORM_BROWSER_STATEMENT *Question,\r
IN EFI_BROWSER_ACTION Action,\r
IN BOOLEAN SkipSaveOrDiscard\r
IN FORM_BROWSER_STATEMENT *Question,\r
IN EFI_BROWSER_ACTION Action,\r
IN BOOLEAN SkipSaveOrDiscard\r
EFI_IFR_TYPE_VALUE BackUpValue;\r
UINT8 *BackUpBuffer;\r
\r
EFI_IFR_TYPE_VALUE BackUpValue;\r
UINT8 *BackUpBuffer;\r
\r
- ConfigAccess = Selection->FormSet->ConfigAccess;\r
+ ConfigAccess = FormSet->ConfigAccess;\r
SubmitFormIsRequired = FALSE;\r
SettingLevel = FormSetLevel;\r
DiscardFormIsRequired = FALSE;\r
SubmitFormIsRequired = FALSE;\r
SettingLevel = FormSetLevel;\r
DiscardFormIsRequired = FALSE;\r
return EFI_SUCCESS;\r
}\r
\r
return EFI_SUCCESS;\r
}\r
\r
- Link = GetFirstNode (&Selection->Form->StatementListHead);\r
- while (!IsNull (&Selection->Form->StatementListHead, Link)) {\r
+ Link = GetFirstNode (&Form->StatementListHead);\r
+ while (!IsNull (&Form->StatementListHead, Link)) {\r
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);\r
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);\r
- Link = GetNextNode (&Selection->Form->StatementListHead, Link);\r
+ Link = GetNextNode (&Form->StatementListHead, Link);\r
\r
//\r
// if Question != NULL, only process the question. Else, process all question in this form.\r
\r
//\r
// if Question != NULL, only process the question. Else, process all question in this form.\r
// Check whether Statement is disabled.\r
//\r
if (Statement->Expression != NULL) {\r
// Check whether Statement is disabled.\r
//\r
if (Statement->Expression != NULL) {\r
- if (EvaluateExpressionList(Statement->Expression, TRUE, Selection->FormSet, Selection->Form) == ExpressDisable) {\r
+ if (EvaluateExpressionList(Statement->Expression, TRUE, FormSet, Form) == ExpressDisable) {\r
// "retrieve" should update to the question's temp buffer.\r
//\r
if (Action == EFI_BROWSER_ACTION_CHANGING || Action == EFI_BROWSER_ACTION_RETRIEVE) {\r
// "retrieve" should update to the question's temp buffer.\r
//\r
if (Action == EFI_BROWSER_ACTION_CHANGING || Action == EFI_BROWSER_ACTION_RETRIEVE) {\r
- SetQuestionValue(Selection->FormSet, Selection->Form, Statement, GetSetValueWithEditBuffer);\r
+ SetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer);\r
CopyMem (&HiiValue->Value, &BackUpValue, sizeof (EFI_IFR_TYPE_VALUE));\r
}\r
\r
CopyMem (&HiiValue->Value, &BackUpValue, sizeof (EFI_IFR_TYPE_VALUE));\r
}\r
\r
- SetQuestionValue(Selection->FormSet, Selection->Form, Statement, GetSetValueWithEditBuffer);\r
+ SetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer);\r
//\r
if ((Action == EFI_BROWSER_ACTION_CHANGING && Status != EFI_UNSUPPORTED) || \r
Action == EFI_BROWSER_ACTION_RETRIEVE) {\r
//\r
if ((Action == EFI_BROWSER_ACTION_CHANGING && Status != EFI_UNSUPPORTED) || \r
Action == EFI_BROWSER_ACTION_RETRIEVE) {\r
- GetQuestionValue(Selection->FormSet, Selection->Form, Statement, GetSetValueWithEditBuffer);\r
+ GetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer);\r
}\r
\r
if (Status == EFI_UNSUPPORTED) {\r
}\r
\r
if (Status == EFI_UNSUPPORTED) {\r
}\r
\r
if (SubmitFormIsRequired && !SkipSaveOrDiscard) {\r
}\r
\r
if (SubmitFormIsRequired && !SkipSaveOrDiscard) {\r
- SubmitForm (Selection->FormSet, Selection->Form, SettingLevel);\r
+ SubmitForm (FormSet, Form, SettingLevel);\r
}\r
\r
if (DiscardFormIsRequired && !SkipSaveOrDiscard) {\r
}\r
\r
if (DiscardFormIsRequired && !SkipSaveOrDiscard) {\r
- DiscardForm (Selection->FormSet, Selection->Form, SettingLevel);\r
+ DiscardForm (FormSet, Form, SettingLevel);\r
+ if ((Selection->Handle != mCurrentHiiHandle) ||\r
+ (!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid))) {\r
+ gFinishRetrieveCall = FALSE;\r
+ }\r
+\r
//\r
// Initialize current settings of Questions in this FormSet\r
//\r
//\r
// Initialize current settings of Questions in this FormSet\r
//\r
CopyGuid (&mCurrentFormSetGuid, &Selection->FormSetGuid);\r
mCurrentFormId = Selection->FormId;\r
\r
CopyGuid (&mCurrentFormSetGuid, &Selection->FormSetGuid);\r
mCurrentFormId = Selection->FormId;\r
\r
- Status = ProcessCallBackFunction (Selection, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);\r
+ Status = ProcessCallBackFunction (Selection, gCurrentSelection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
}\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
}\r
+ //\r
+ // Finish call RETRIEVE callback for this formset.\r
+ //\r
+ gFinishRetrieveCall = TRUE;\r
+\r
//\r
// IFR is updated during callback of read value, force to reparse the IFR binary\r
//\r
//\r
// IFR is updated during callback of read value, force to reparse the IFR binary\r
//\r
if ((ConfigAccess != NULL) && \r
((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) && \r
(Statement->Operand != EFI_IFR_PASSWORD_OP)) {\r
if ((ConfigAccess != NULL) && \r
((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) && \r
(Statement->Operand != EFI_IFR_PASSWORD_OP)) {\r
- Status = ProcessCallBackFunction(Selection, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);\r
+ Status = ProcessCallBackFunction(Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);\r
if (Statement->Operand == EFI_IFR_REF_OP) {\r
//\r
// Process dynamic update ref opcode.\r
if (Statement->Operand == EFI_IFR_REF_OP) {\r
//\r
// Process dynamic update ref opcode.\r
}\r
\r
if (!EFI_ERROR (Status) && Statement->Operand != EFI_IFR_REF_OP) {\r
}\r
\r
if (!EFI_ERROR (Status) && Statement->Operand != EFI_IFR_REF_OP) {\r
- ProcessCallBackFunction(Selection, Statement, EFI_BROWSER_ACTION_CHANGED, FALSE);\r
+ ProcessCallBackFunction(Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGED, FALSE);\r
}\r
} else if (Statement->Operand != EFI_IFR_PASSWORD_OP) {\r
SetQuestionValue (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer);\r
}\r
} else if (Statement->Operand != EFI_IFR_PASSWORD_OP) {\r
SetQuestionValue (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer);\r
(!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||\r
(Selection->FormId != mCurrentFormId))) {\r
\r
(!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||\r
(Selection->FormId != mCurrentFormId))) {\r
\r
- Status = ProcessCallBackFunction (Selection, NULL, EFI_BROWSER_ACTION_FORM_CLOSE, FALSE);\r
+ Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_CLOSE, FALSE);\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
}\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
}\r
LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList);\r
LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList);\r
\r
LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList);\r
LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList);\r
\r
+BOOLEAN gFinishRetrieveCall;\r
BOOLEAN gResetRequired;\r
BOOLEAN gExitRequired;\r
BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel;\r
BOOLEAN gResetRequired;\r
BOOLEAN gExitRequired;\r
BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel;\r
EFI_GUID ZeroGuid;\r
EFI_STATUS Status;\r
FORM_BROWSER_FORMSET *OldFormset;\r
EFI_GUID ZeroGuid;\r
EFI_STATUS Status;\r
FORM_BROWSER_FORMSET *OldFormset;\r
+ BOOLEAN OldRetrieveValue;\r
\r
OldFormset = mSystemLevelFormSet;\r
\r
OldFormset = mSystemLevelFormSet;\r
+ OldRetrieveValue = gFinishRetrieveCall;\r
+ gFinishRetrieveCall = FALSE;\r
\r
//\r
// Get all the Hii handles\r
\r
//\r
// Get all the Hii handles\r
//\r
FreePool (HiiHandles);\r
\r
//\r
FreePool (HiiHandles);\r
\r
+ gFinishRetrieveCall = OldRetrieveValue;\r
mSystemLevelFormSet = OldFormset;\r
}\r
\r
mSystemLevelFormSet = OldFormset;\r
}\r
\r
//\r
SaveBrowserContext ();\r
\r
//\r
SaveBrowserContext ();\r
\r
+ gFinishRetrieveCall = FALSE;\r
gResetRequired = FALSE;\r
gExitRequired = FALSE;\r
Status = EFI_SUCCESS;\r
gResetRequired = FALSE;\r
gExitRequired = FALSE;\r
Status = EFI_SUCCESS;\r
// Call the Retrieve call back function for all questions.\r
//\r
if ((FormSet->ConfigAccess != NULL) && (Selection != NULL) &&\r
// Call the Retrieve call back function for all questions.\r
//\r
if ((FormSet->ConfigAccess != NULL) && (Selection != NULL) &&\r
- ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK)) {\r
+ ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) &&\r
+ !gFinishRetrieveCall) {\r
//\r
// Check QuestionValue does exist.\r
//\r
//\r
// Check QuestionValue does exist.\r
//\r
- Status = ProcessCallBackFunction(Selection, Question, EFI_BROWSER_ACTION_RETRIEVE, TRUE);\r
+ Status = ProcessCallBackFunction(Selection, FormSet, Form, Question, EFI_BROWSER_ACTION_RETRIEVE, TRUE);\r
\r
extern BOOLEAN gResetRequired;\r
extern BOOLEAN gExitRequired;\r
\r
extern BOOLEAN gResetRequired;\r
extern BOOLEAN gExitRequired;\r
+extern BOOLEAN gFinishRetrieveCall;\r
extern LIST_ENTRY gBrowserFormSetList;\r
extern LIST_ENTRY gBrowserHotKeyList;\r
extern BROWSER_SETTING_SCOPE gBrowserSettingScope;\r
extern LIST_ENTRY gBrowserFormSetList;\r
extern LIST_ENTRY gBrowserHotKeyList;\r
extern BROWSER_SETTING_SCOPE gBrowserSettingScope;\r
about the Selection, form and formset to be displayed.\r
On output, Selection return the screen item that is selected\r
by user.\r
about the Selection, form and formset to be displayed.\r
On output, Selection return the screen item that is selected\r
by user.\r
- @param Statement The Question which need to call.\r
+ @param FormSet The formset this question belong to.\r
+ @param Form The form this question belong to.\r
+ @param Question The Question which need to call.\r
@param Action The action request.\r
@param SkipSaveOrDiscard Whether skip save or discard action.\r
\r
@param Action The action request.\r
@param SkipSaveOrDiscard Whether skip save or discard action.\r
\r
EFI_STATUS \r
ProcessCallBackFunction (\r
IN OUT UI_MENU_SELECTION *Selection,\r
EFI_STATUS \r
ProcessCallBackFunction (\r
IN OUT UI_MENU_SELECTION *Selection,\r
+ IN FORM_BROWSER_FORMSET *FormSet,\r
+ IN FORM_BROWSER_FORM *Form,\r
IN FORM_BROWSER_STATEMENT *Question,\r
IN EFI_BROWSER_ACTION Action,\r
IN BOOLEAN SkipSaveOrDiscard\r
IN FORM_BROWSER_STATEMENT *Question,\r
IN EFI_BROWSER_ACTION Action,\r
IN BOOLEAN SkipSaveOrDiscard\r