MdeModulePkg/DriverSampleDxe: EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY

REF: UEFI_Spec_2_10_Aug29.pdf page 1695.

In 35.5.4 EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack():
If the callback function returns with the ActionRequest set to
_QUESTION_APPLY, then the Forms Browser will write the current modified
question value on the selected form to storage.

Update the DriverSampleDxe, add a new question "Question apply test".

Signed-off-by: Ming Tan <ming.tan@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Ming Tan 2024-01-02 10:32:45 +08:00 committed by mergify[bot]
parent 588cfc63d2
commit ff52277e37
4 changed files with 28 additions and 0 deletions

View File

@ -858,6 +858,7 @@ ExtractConfig (
@retval EFI_INVALID_PARAMETER Configuration is NULL.
@retval EFI_NOT_FOUND Routing data doesn't match any storage in this
driver.
@retval EFI_DEVICE_ERROR If value is 44, return error for testing.
**/
EFI_STATUS
@ -1065,6 +1066,11 @@ RouteConfig (
return Status;
}
if (PrivateData->Configuration.QuestionApply == 44) {
// Return error for verify the error handling of caller.
return EFI_DEVICE_ERROR;
}
//
// Store Buffer Storage back to EFI variable
//
@ -1599,6 +1605,13 @@ DriverCallback (
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
break;
case 0x1253:
//
// User change the value of "Question apply test".
//
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY;
break;
case 0x1231:
//
// 1. Check to see whether system support keyword.

View File

@ -95,6 +95,7 @@ typedef struct {
MY_EFI_UNION_DATA MyUnionData;
UINT8 QuestionXUefiKeywordRestStyle;
UINT8 QuestionNonXUefiKeywordRestStyle;
UINT8 QuestionApply;
} DRIVER_SAMPLE_CONFIGURATION;
//

View File

@ -513,6 +513,16 @@ formset
default = 18,
endnumeric;
numeric varid = MyIfrNVData.QuestionApply,
questionid = 0x1253,
prompt = STRING_TOKEN(STR_QUESTION_APPLY_TEST_PROMPT),
help = STRING_TOKEN(STR_QUESTION_APPLY_TEST_HELP),
flags = INTERACTIVE,
minimum = 0,
maximum = 255,
default = 19,
endnumeric;
text
help = STRING_TOKEN(STR_POPUP_TEST_HELP),
text = STRING_TOKEN(STR_POPUP_TEST_PROMPT),

View File

@ -269,6 +269,10 @@
#language fr-FR "Submitted callback test"
#string STR_SUBMITTED_CALLBACK_TEST_HELP #language en-US "Change the value and press F10 to submit will pop up a dialogue to show SUBMITTED Callback has been triggered"
#language fr-FR "Change the value and press F10 to submit will pop up a dialogue to show SUBMITTED Callback has been triggered"
#string STR_QUESTION_APPLY_TEST_PROMPT #language en-US "Question apply test"
#language fr-FR "Question apply test"
#string STR_QUESTION_APPLY_TEST_HELP #language en-US "Change the value and it will be applied automaticlly. If set to 44, then return failed."
#language fr-FR "Change the value and it will be applied automaticlly. If set to 44, then return failed."
#string STR_POPUP_TEST_PROMPT #language en-US "Select it to invoke Hii Popup Protocol"
#language fr-FR "Select it to invoke Hii Popup Protocol"
#string STR_POPUP_TEST_HELP #language en-US "Select this question will pop up a message box, then user can decide whether exit current form or not"