BROWSER_SETTING_SCOPE SettingLevel;\r
EFI_IFR_TYPE_VALUE BackUpValue;\r
UINT8 *BackUpBuffer;\r
+ CHAR16 *NewString;\r
\r
ConfigAccess = FormSet->ConfigAccess;\r
SubmitFormIsRequired = FALSE;\r
}\r
}\r
\r
+ //\r
+ // Need to sync the value between Statement->HiiValue->Value and Statement->BufferValue\r
+ //\r
+ if (HiiValue->Type == EFI_IFR_TYPE_STRING) {\r
+ NewString = GetToken (Statement->HiiValue.Value.string, FormSet->HiiHandle);\r
+ ASSERT (NewString != NULL);\r
+\r
+ ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth);\r
+ if (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth) {\r
+ CopyMem (Statement->BufferValue, NewString, StrSize (NewString));\r
+ } else {\r
+ CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth);\r
+ }\r
+ FreePool (NewString);\r
+ }\r
+\r
//\r
// According the spec, return value from call back of "changing" and \r
// "retrieve" should update to the question's temp buffer.\r
\r
@param ConfigAccess The config access protocol produced by the hii driver.\r
@param Statement The Question which need to call.\r
+ @param FormSet The formset this question belong to.\r
\r
@retval EFI_SUCCESS The call back function excutes successfully.\r
@return Other value if the call back function failed to excute. \r
EFI_STATUS \r
ProcessRetrieveForQuestion (\r
IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess,\r
- IN FORM_BROWSER_STATEMENT *Statement\r
+ IN FORM_BROWSER_STATEMENT *Statement,\r
+ IN FORM_BROWSER_FORMSET *FormSet\r
)\r
{\r
EFI_STATUS Status;\r
EFI_BROWSER_ACTION_REQUEST ActionRequest;\r
EFI_HII_VALUE *HiiValue;\r
EFI_IFR_TYPE_VALUE *TypeValue;\r
+ CHAR16 *NewString;\r
\r
Status = EFI_SUCCESS;\r
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;\r
TypeValue,\r
&ActionRequest\r
);\r
+ if (!EFI_ERROR (Status) && HiiValue->Type == EFI_IFR_TYPE_STRING) {\r
+ NewString = GetToken (Statement->HiiValue.Value.string, FormSet->HiiHandle);\r
+ ASSERT (NewString != NULL);\r
+\r
+ ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth);\r
+ if (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth) {\r
+ CopyMem (Statement->BufferValue, NewString, StrSize (NewString));\r
+ } else {\r
+ CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth);\r
+ }\r
+ FreePool (NewString);\r
+ }\r
+\r
return Status;\r
}\r
\r
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
EFI_BROWSER_ACTION_REQUEST ActionRequest;\r
INTN Action;\r
+ CHAR16 *NewString;\r
\r
Status = EFI_NOT_FOUND;\r
StrValue = NULL;\r
&ActionRequest\r
);\r
if (!EFI_ERROR (Status)) {\r
+ if (HiiValue->Type == EFI_IFR_TYPE_STRING) {\r
+ NewString = GetToken (Question->HiiValue.Value.string, FormSet->HiiHandle);\r
+ ASSERT (NewString != NULL);\r
+\r
+ ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Question->StorageWidth);\r
+ if (StrLen (NewString) * sizeof (CHAR16) <= Question->StorageWidth) {\r
+ CopyMem (Question->BufferValue, NewString, StrSize (NewString));\r
+ } else {\r
+ CopyMem (Question->BufferValue, NewString, Question->StorageWidth);\r
+ }\r
+\r
+ FreePool (NewString);\r
+ }\r
return Status;\r
}\r
}\r
//\r
// Call the Retrieve call back to get the initial question value.\r
//\r
- Status = ProcessRetrieveForQuestion(FormSet->ConfigAccess, Question);\r
+ Status = ProcessRetrieveForQuestion(FormSet->ConfigAccess, Question, FormSet);\r
}\r
\r
//\r
\r
@param ConfigAccess The config access protocol produced by the hii driver.\r
@param Statement The Question which need to call.\r
+ @param FormSet The formset this question belong to.\r
\r
@retval EFI_SUCCESS The call back function excutes successfully.\r
@return Other value if the call back function failed to excute. \r
EFI_STATUS \r
ProcessRetrieveForQuestion (\r
IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess,\r
- IN FORM_BROWSER_STATEMENT *Statement\r
+ IN FORM_BROWSER_STATEMENT *Statement,\r
+ IN FORM_BROWSER_FORMSET *FormSet\r
);\r
\r
/**\r