summaryrefslogtreecommitdiff
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
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
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c24
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.c2
2 files changed, 10 insertions, 16 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;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index 381cefeae5..bcc8e020fd 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -3513,7 +3513,7 @@ LoadStorage (
//
// Convert Result from <ConfigAltResp> to <ConfigResp>
//
- StrPtr = StrStr (Result, L"ALTCFG");
+ StrPtr = StrStr (Result, L"&GUID=");
if (StrPtr != NULL) {
*StrPtr = L'\0';
}