diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-25 10:10:59 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-25 10:10:59 +0000 |
commit | 2573712e0132deac7591f9ed5e2423c5e61e5af6 (patch) | |
tree | 8b213960d0df7d73510f3cadd48218667350ef76 /MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | |
parent | 234980f6e935a51fdafecb9930b4a2ecbf47b727 (diff) | |
download | edk2-platforms-2573712e0132deac7591f9ed5e2423c5e61e5af6.tar.xz |
Enhance SetupBrowser to support new UEFI HiiFormMap feature
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10069 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Setup.c')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 81de737a03..d50071e550 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -661,6 +661,10 @@ GetToken ( {
EFI_STRING String;
+ if (HiiHandle == NULL) {
+ return NULL;
+ }
+
String = HiiGetString (HiiHandle, Token, NULL);
if (String == NULL) {
String = AllocateCopyPool (sizeof (mUnknownString), mUnknownString);
@@ -1041,6 +1045,20 @@ GetQuestionValue ( }
return Status;
}
+
+ //
+ // Get question value by read expression.
+ //
+ if (Question->ReadExpression != NULL && Form->FormType == STANDARD_MAP_FORM_TYPE) {
+ Status = EvaluateExpression (FormSet, Form, Question->ReadExpression);
+ if (!EFI_ERROR (Status) && (Question->ReadExpression->Result.Type < EFI_IFR_TYPE_OTHER)) {
+ //
+ // Only update question value to the valid result.
+ //
+ CopyMem (&Question->HiiValue, &Question->ReadExpression->Result, sizeof (EFI_HII_VALUE));
+ return EFI_SUCCESS;
+ }
+ }
//
// Question value is provided by RTC
@@ -1369,6 +1387,16 @@ SetQuestionValue ( if (Question->ValueExpression != NULL) {
return Status;
}
+
+ //
+ // Before set question value, evaluate its write expression.
+ //
+ if (Question->WriteExpression != NULL && Form->FormType == STANDARD_MAP_FORM_TYPE) {
+ Status = EvaluateExpression (FormSet, Form, Question->WriteExpression);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ }
//
// Question value is provided by RTC
|