summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2012-12-05 09:27:15 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2012-12-05 09:27:15 +0000
commitedae8d2dbda4d355d98df57b7d1952a5c3ebeacd (patch)
tree99901d5661dd0f542aa30a952ecb9d06aa265947 /MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
parent73b5f8bceeb65dbd1d66f502d3bf2bf7127a59d4 (diff)
downloadedk2-platforms-edae8d2dbda4d355d98df57b7d1952a5c3ebeacd.tar.xz
Update the HiiConfigToBlock to follow spec.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13983 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index c79a4c9ab8..1cb754bde0 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -3919,18 +3919,14 @@ HiiConfigToBlock (
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
- //
- // Skip '&'
- //
- StringPtr++;
//
// Parse each <ConfigElement> if exists
- // Only <BlockConfig> format is supported by this help function.
+ // Only '&'<BlockConfig> format is supported by this help function.
// <BlockConfig> ::= 'OFFSET='<Number>&'WIDTH='<Number>&'VALUE='<Number>
//
- while (*StringPtr != 0 && StrnCmp (StringPtr, L"OFFSET=", StrLen (L"OFFSET=")) == 0) {
- StringPtr += StrLen (L"OFFSET=");
+ while (*StringPtr != 0 && StrnCmp (StringPtr, L"&OFFSET=", StrLen (L"&OFFSET=")) == 0) {
+ StringPtr += StrLen (L"&OFFSET=");
//
// Get Offset
//
@@ -3949,7 +3945,7 @@ HiiConfigToBlock (
StringPtr += Length;
if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) {
- *Progress = StringPtr - Length - StrLen (L"OFFSET=") - 1;
+ *Progress = StringPtr - Length - StrLen (L"&OFFSET=");
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
@@ -3990,7 +3986,7 @@ HiiConfigToBlock (
StringPtr += Length;
if (*StringPtr != 0 && *StringPtr != L'&') {
- *Progress = StringPtr - Length - 7;
+ *Progress = StringPtr - Length - StrLen (L"&VALUE=");
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
@@ -4009,20 +4005,18 @@ HiiConfigToBlock (
Value = NULL;
//
- // If '\0', parsing is finished. Otherwise skip '&' to continue
+ // If '\0', parsing is finished.
//
if (*StringPtr == 0) {
break;
}
-
- StringPtr++;
}
//
- // The input string is ConfigAltResp format.
+ // The input string is not ConfigResp format, return error.
//
- if ((*StringPtr != 0) && (StrnCmp (StringPtr, L"&GUID=", StrLen (L"&GUID=")) != 0)) {
- *Progress = StringPtr - 1;
+ if (*StringPtr != 0) {
+ *Progress = StringPtr;
Status = EFI_INVALID_PARAMETER;
goto Exit;
}