Sync value for string opcode after call the Callback function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming, Gao <liming.gao@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15448 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong
2014-04-11 06:15:57 +00:00
committed by ydong10
parent 66a5771e7a
commit 061d546224
3 changed files with 52 additions and 3 deletions

View File

@@ -2993,6 +2993,7 @@ GetQuestionDefault (
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
EFI_BROWSER_ACTION_REQUEST ActionRequest;
INTN Action;
CHAR16 *NewString;
Status = EFI_NOT_FOUND;
StrValue = NULL;
@@ -3030,6 +3031,19 @@ GetQuestionDefault (
&ActionRequest
);
if (!EFI_ERROR (Status)) {
if (HiiValue->Type == EFI_IFR_TYPE_STRING) {
NewString = GetToken (Question->HiiValue.Value.string, FormSet->HiiHandle);
ASSERT (NewString != NULL);
ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Question->StorageWidth);
if (StrLen (NewString) * sizeof (CHAR16) <= Question->StorageWidth) {
CopyMem (Question->BufferValue, NewString, StrSize (NewString));
} else {
CopyMem (Question->BufferValue, NewString, Question->StorageWidth);
}
FreePool (NewString);
}
return Status;
}
}
@@ -3307,7 +3321,7 @@ ExtractDefault (
//
// Call the Retrieve call back to get the initial question value.
//
Status = ProcessRetrieveForQuestion(FormSet->ConfigAccess, Question);
Status = ProcessRetrieveForQuestion(FormSet->ConfigAccess, Question, FormSet);
}
//