EFI_STATUS Status;\r
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
EFI_BROWSER_ACTION_REQUEST ActionRequest;\r
- EFI_HII_VALUE *QuestionValue;\r
+ EFI_IFR_TYPE_VALUE IfrTypeValue;\r
\r
- QuestionValue = &MenuOption->ThisTag->HiiValue;\r
ConfigAccess = Selection->FormSet->ConfigAccess;\r
if (ConfigAccess == NULL) {\r
return EFI_UNSUPPORTED;\r
// Prepare password string in HII database\r
//\r
if (String != NULL) {\r
- QuestionValue->Value.string = NewString (String, Selection->FormSet->HiiHandle);\r
+ IfrTypeValue.string = NewString (String, Selection->FormSet->HiiHandle);\r
} else {\r
- QuestionValue->Value.string = 0;\r
+ IfrTypeValue.string = 0;\r
}\r
\r
//\r
ConfigAccess,\r
EFI_BROWSER_ACTION_CHANGING,\r
MenuOption->ThisTag->QuestionId,\r
- QuestionValue->Type,\r
- &QuestionValue->Value,\r
+ MenuOption->ThisTag->HiiValue.Type,\r
+ &IfrTypeValue,\r
&ActionRequest\r
);\r
\r
// Remove password string from HII database\r
//\r
if (String != NULL) {\r
- DeleteString (QuestionValue->Value.string, Selection->FormSet->HiiHandle);\r
+ DeleteString (IfrTypeValue.string, Selection->FormSet->HiiHandle);\r
}\r
\r
return Status;\r
UINTN Index2;\r
UINT8 *ValueArray;\r
UINT8 ValueType;\r
+ EFI_STRING_ID StringId;\r
\r
Status = EFI_SUCCESS;\r
\r
StringPtr = NULL;\r
Character[1] = L'\0';\r
*OptionString = NULL;\r
+ StringId = 0;\r
\r
ZeroMem (FormattedNumber, 21 * sizeof (CHAR16));\r
BufferSize = (gOptionBlockWidth + 1) * 2 * gScreenDimensions.BottomRow;\r
\r
Status = ReadString (MenuOption, gPromptForData, StringPtr);\r
if (!EFI_ERROR (Status)) {\r
- CopyMem (Question->BufferValue, StringPtr, Maximum * sizeof (CHAR16));\r
- SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);\r
+ HiiSetString(Selection->FormSet->HiiHandle, Question->HiiValue.Value.string, StringPtr, NULL);\r
+ Status = ValidateQuestion(Selection->FormSet, Selection->Form, Question, EFI_HII_EXPRESSION_INCONSISTENT_IF);\r
+ if (EFI_ERROR (Status)) {\r
+ HiiSetString(Selection->FormSet->HiiHandle, Question->HiiValue.Value.string, (CHAR16*)Question->BufferValue, NULL);\r
+ } else {\r
+ CopyMem (Question->BufferValue, StringPtr, Maximum * sizeof (CHAR16));\r
+ SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);\r
\r
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
+ UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
+ }\r
}\r
\r
FreePool (StringPtr);\r
//\r
if (StrCmp (StringPtr, TempString) == 0) {\r
//\r
- // Two password match, send it to Configuration Driver\r
+ // Prepare the Question->HiiValue.Value.string for ValidateQuestion use.\r
//\r
- if ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) {\r
- PasswordCallback (Selection, MenuOption, StringPtr);\r
+ if((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) {\r
+ StringId = Question->HiiValue.Value.string;\r
+ Question->HiiValue.Value.string = NewString (StringPtr, Selection->FormSet->HiiHandle);\r
} else {\r
- CopyMem (Question->BufferValue, StringPtr, Maximum * sizeof (CHAR16));\r
- SetQuestionValue (Selection->FormSet, Selection->Form, Question, FALSE);\r
+ HiiSetString(Selection->FormSet->HiiHandle, Question->HiiValue.Value.string, StringPtr, NULL);\r
+ }\r
+ \r
+ Status = ValidateQuestion(Selection->FormSet, Selection->Form, Question, EFI_HII_EXPRESSION_INCONSISTENT_IF);\r
+\r
+ //\r
+ // Researve the Question->HiiValue.Value.string.\r
+ //\r
+ if((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) {\r
+ DeleteString(Question->HiiValue.Value.string, Selection->FormSet->HiiHandle);\r
+ Question->HiiValue.Value.string = StringId;\r
+ } \r
+ \r
+ if (EFI_ERROR (Status)) {\r
+ //\r
+ // Reset state machine for interactive password\r
+ //\r
+ if ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) {\r
+ PasswordCallback (Selection, MenuOption, NULL);\r
+ } else {\r
+ //\r
+ // Researve the Question->HiiValue.Value.string.\r
+ //\r
+ HiiSetString(Selection->FormSet->HiiHandle, Question->HiiValue.Value.string, (CHAR16*)Question->BufferValue, NULL); \r
+ }\r
+ } else {\r
+ //\r
+ // Two password match, send it to Configuration Driver\r
+ //\r
+ if ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) {\r
+ PasswordCallback (Selection, MenuOption, StringPtr);\r
+ } else {\r
+ CopyMem (Question->BufferValue, StringPtr, Maximum * sizeof (CHAR16));\r
+ SetQuestionValue (Selection->FormSet, Selection->Form, Question, FALSE);\r
+ }\r
}\r
} else {\r
//\r