]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update the HiiConfigToBlock to follow spec.
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 5 Dec 2012 09:27:15 +0000 (09:27 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 5 Dec 2012 09:27:15 +0000 (09:27 +0000)
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

MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c

index c79a4c9ab8f4b29b551e1995dd12631d52804c41..1cb754bde0f6ce04543642d99ea863461e13d7b0 100644 (file)
@@ -3919,18 +3919,14 @@ HiiConfigToBlock (
     Status = EFI_INVALID_PARAMETER;\r
     goto Exit;\r
   }\r
-  //\r
-  // Skip '&'\r
-  //\r
-  StringPtr++;\r
 \r
   //\r
   // Parse each <ConfigElement> if exists\r
-  // Only <BlockConfig> format is supported by this help function.\r
+  // Only '&'<BlockConfig> format is supported by this help function.\r
   // <BlockConfig> ::= 'OFFSET='<Number>&'WIDTH='<Number>&'VALUE='<Number>\r
   //\r
-  while (*StringPtr != 0 && StrnCmp (StringPtr, L"OFFSET=", StrLen (L"OFFSET=")) == 0) {\r
-    StringPtr += StrLen (L"OFFSET=");\r
+  while (*StringPtr != 0 && StrnCmp (StringPtr, L"&OFFSET=", StrLen (L"&OFFSET=")) == 0) {\r
+    StringPtr += StrLen (L"&OFFSET=");\r
     //\r
     // Get Offset\r
     //\r
@@ -3949,7 +3945,7 @@ HiiConfigToBlock (
 \r
     StringPtr += Length;\r
     if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) {\r
-      *Progress = StringPtr - Length - StrLen (L"OFFSET=") - 1;\r
+      *Progress = StringPtr - Length - StrLen (L"&OFFSET=");\r
       Status = EFI_INVALID_PARAMETER;\r
       goto Exit;\r
     }\r
@@ -3990,7 +3986,7 @@ HiiConfigToBlock (
 \r
     StringPtr += Length;\r
     if (*StringPtr != 0 && *StringPtr != L'&') {\r
-      *Progress = StringPtr - Length - 7;\r
+      *Progress = StringPtr - Length - StrLen (L"&VALUE=");\r
       Status = EFI_INVALID_PARAMETER;\r
       goto Exit;\r
     }\r
@@ -4009,20 +4005,18 @@ HiiConfigToBlock (
     Value = NULL;\r
 \r
     //\r
-    // If '\0', parsing is finished. Otherwise skip '&' to continue\r
+    // If '\0', parsing is finished.\r
     //\r
     if (*StringPtr == 0) {\r
       break;\r
     }\r
-\r
-    StringPtr++;\r
   }\r
   \r
   //\r
-  // The input string is ConfigAltResp format.\r
+  // The input string is not ConfigResp format, return error.\r
   //\r
-  if ((*StringPtr != 0) && (StrnCmp (StringPtr, L"&GUID=", StrLen (L"&GUID=")) != 0)) {\r
-    *Progress = StringPtr - 1;\r
+  if (*StringPtr != 0) {\r
+    *Progress = StringPtr;\r
     Status = EFI_INVALID_PARAMETER;\r
     goto Exit;\r
   }\r
index 381cefeae5937690e40442d22a4175b9486fefcb..bcc8e020fdb2b8339fc60c4c6fb647e96aaaaeb9 100644 (file)
@@ -3513,7 +3513,7 @@ LoadStorage (
   //\r
   // Convert Result from <ConfigAltResp> to <ConfigResp>\r
   //\r
-  StrPtr = StrStr (Result, L"ALTCFG");\r
+  StrPtr = StrStr (Result, L"&GUID=");\r
   if (StrPtr != NULL) {\r
     *StrPtr = L'\0';\r
   }\r