summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2015-09-17 01:20:37 +0000
committerydong10 <ydong10@Edk2>2015-09-17 01:20:37 +0000
commit580d230d12e16651494ce622bee93591e7fe5491 (patch)
tree2574e052f1cab18713da12b3884cb1c8bd112f7a /MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
parent6c20eda777edb679f0f00baf05185363bc6bd69b (diff)
downloadedk2-platforms-580d230d12e16651494ce622bee93591e7fe5491.tar.xz
MdeModulePkg/HiiDatabase: Refine KeywordHandlerProtocol->SetData().
Update this function to follow UEFI spec requirement. 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@18490 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
index b978669687..6923d6c473 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
@@ -2829,6 +2829,7 @@ EfiConfigKeywordHandlerSetData (
BOOLEAN ReadOnly;
EFI_STRING InternalProgress;
CHAR16 *TempString;
+ CHAR16 *KeywordStartPos;
if (This == NULL || Progress == NULL || ProgressErr == NULL || KeywordString == NULL) {
return EFI_INVALID_PARAMETER;
@@ -2843,6 +2844,7 @@ EfiConfigKeywordHandlerSetData (
KeywordData = NULL;
ValueElement = NULL;
ConfigResp = NULL;
+ KeywordStartPos = NULL;
KeywordStringId = 0;
//
@@ -2886,6 +2888,7 @@ EfiConfigKeywordHandlerSetData (
//
// 3. Extract keyword from the KeywordRequest string.
//
+ KeywordStartPos = StringPtr;
Status = ExtractKeyword(StringPtr, &KeywordData, &NextStringPtr);
if (EFI_ERROR (Status)) {
//
@@ -2942,8 +2945,8 @@ EfiConfigKeywordHandlerSetData (
// 8. Check the readonly flag.
//
if (ExtractReadOnlyFromOpCode (OpCode) != ReadOnly) {
- *ProgressErr = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
- Status = EFI_INVALID_PARAMETER;
+ *ProgressErr = KEYWORD_HANDLER_ACCESS_NOT_PERMITTED;
+ Status = EFI_ACCESS_DENIED;
goto Done;
}
@@ -2970,6 +2973,7 @@ EfiConfigKeywordHandlerSetData (
FreePool (ConfigResp);
ConfigResp = NULL;
}
+ KeywordStartPos = NULL;
}
//
@@ -2988,7 +2992,11 @@ EfiConfigKeywordHandlerSetData (
*ProgressErr = KEYWORD_HANDLER_NO_ERROR;
Done:
- *Progress = KeywordString + (StringPtr - TempString);
+ if (KeywordStartPos != NULL) {
+ *Progress = KeywordString + (KeywordStartPos - TempString);
+ } else {
+ *Progress = KeywordString + (StringPtr - TempString);
+ }
ASSERT (TempString != NULL);
FreePool (TempString);
@@ -3010,7 +3018,7 @@ Done:
if (MultiConfigResp != NULL && MultiConfigResp != ConfigResp) {
FreePool (MultiConfigResp);
}
-
+
return Status;
}