summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Tan <ming.tan@intel.com>2024-01-02 10:32:45 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-01-24 15:57:35 +0000
commitff52277e3796c50511e544219dde0b21edf5c53e (patch)
tree5f9239a03a124c2fd1f87a5435d5def9758990bb
parent588cfc63d235b0b4c7ba8ebae2a7e3787e62b1e7 (diff)
downloadedk2-ff52277e3796c50511e544219dde0b21edf5c53e.tar.gz
edk2-ff52277e3796c50511e544219dde0b21edf5c53e.tar.bz2
edk2-ff52277e3796c50511e544219dde0b21edf5c53e.zip
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>
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c13
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h1
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr10
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni4
4 files changed, 28 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index 62ba52e940..003cb499b5 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -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.
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
index 489d7bcbf3..3f5388946d 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
+++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
@@ -95,6 +95,7 @@ typedef struct {
MY_EFI_UNION_DATA MyUnionData;
UINT8 QuestionXUefiKeywordRestStyle;
UINT8 QuestionNonXUefiKeywordRestStyle;
+ UINT8 QuestionApply;
} DRIVER_SAMPLE_CONFIGURATION;
//
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
index 5323e2b411..0c376fe9b7 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
+++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
@@ -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),
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
index 8a3e286bec..ed906045fd 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
+++ b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
@@ -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"