]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / ConfigRouting.c
index d5ef60b7f5ed3eb223d96c60123df4b3bb319351..eca4fefc93a22e9fa7241e9ad7ccb784989ba818 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
 Implementation of interfaces function for EFI_HII_CONFIG_ROUTING_PROTOCOL.\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -168,7 +168,7 @@ GetDevicePath (
   Converts the unicode character of the string from uppercase to lowercase.\r
   This is a internal function.\r
 \r
-  @param Str     String to be converted\r
+  @param ConfigString  String to be converted\r
 \r
 **/\r
 VOID\r
@@ -773,7 +773,7 @@ InsertBlockData (
 /**\r
   This function checks VarOffset and VarWidth is in the block range.\r
 \r
-  @param  BlockArray         The block array is to be checked. \r
+  @param  RequestBlockArray  The block array is to be checked. \r
   @param  VarOffset          Offset of var to the structure\r
   @param  VarWidth           Width of var.\r
   \r
@@ -831,7 +831,7 @@ EFI_STATUS
 EFIAPI\r
 ParseIfrData (\r
   IN     UINT8               *Package,\r
-  IN     UINT32              PackageLenth,\r
+  IN     UINT32              PackageLength,\r
   IN     EFI_STRING          ConfigHdr,\r
   IN     IFR_BLOCK_DATA      *RequestBlockArray,\r
   IN OUT IFR_VARSTORAGE_DATA *VarStorageData,\r
@@ -868,12 +868,13 @@ ParseIfrData (
   TempStr          = NULL;\r
   BlockData        = NULL;\r
   DefaultData      = NULL;\r
+  VarDefaultName   = 0;\r
 \r
   //\r
   // Go through the form package to parse OpCode one by one.\r
   //\r
   IfrOffset   = sizeof (EFI_HII_PACKAGE_HEADER);\r
-  while (IfrOffset < PackageLenth) {\r
+  while (IfrOffset < PackageLength) {\r
     IfrOpHdr  = (EFI_IFR_OP_HEADER *) (Package + IfrOffset);\r
 \r
     switch (IfrOpHdr->OpCode) {\r
@@ -950,6 +951,7 @@ ParseIfrData (
       break;\r
 \r
     case EFI_IFR_FORM_OP:\r
+    case EFI_IFR_FORM_MAP_OP:\r
       //\r
       // No matched varstore is found and directly return.\r
       //\r
@@ -1042,32 +1044,15 @@ ParseIfrData (
       //\r
       IfrOrderedList = (EFI_IFR_ORDERED_LIST *) IfrOpHdr;\r
       if (IfrOrderedList->Question.VarStoreId != VarStorageData->VarStoreId) {\r
+        BlockData = NULL;\r
         break;\r
       }\r
-      \r
+\r
       //\r
       // Get Offset/Width by Question header and OneOf Flags\r
       //\r
       VarOffset = IfrOrderedList->Question.VarStoreInfo.VarOffset;\r
       VarWidth  = IfrOrderedList->MaxContainers;\r
-\r
-      //\r
-      // Check whether this question is in requested block array.\r
-      //\r
-      if (!BlockArrayCheck (RequestBlockArray, VarOffset, VarWidth)) {\r
-        //\r
-        // This question is not in the requested string. Skip it.\r
-        //\r
-        break;\r
-      }\r
-\r
-      //\r
-      // Check this var question is in the var storage \r
-      //\r
-      if ((VarOffset + VarWidth) > VarStorageData->Size) {\r
-        Status = EFI_INVALID_PARAMETER;\r
-        goto Done;\r
-      }\r
       \r
       //\r
       // Set Block Data\r
@@ -1083,11 +1068,6 @@ ParseIfrData (
       BlockData->OpCode     = IfrOpHdr->OpCode;\r
       BlockData->Scope      = IfrOpHdr->Scope;\r
       InitializeListHead (&BlockData->DefaultValueEntry);\r
-      \r
-      //\r
-      // Add Block Data into VarStorageData BlockEntry\r
-      //\r
-      InsertBlockData (&VarStorageData->BlockEntry, &BlockData);\r
       break;\r
 \r
     case EFI_IFR_CHECKBOX_OP:\r
@@ -1384,12 +1364,40 @@ ParseIfrData (
           // Invalid ordered list option data type.\r
           //\r
           Status = EFI_INVALID_PARAMETER;\r
+          FreePool (BlockData);\r
           goto Done;\r
         }\r
+\r
         //\r
         // Calculate Ordered list QuestionId width.\r
         //\r
         BlockData->Width = (UINT16) (BlockData->Width * VarWidth);\r
+        //\r
+        // Check whether this question is in requested block array.\r
+        //\r
+        if (!BlockArrayCheck (RequestBlockArray, BlockData->Offset, BlockData->Width)) {\r
+          //\r
+          // This question is not in the requested string. Skip it.\r
+          //\r
+          FreePool (BlockData);\r
+          BlockData = NULL;\r
+          break;\r
+        }\r
+        //\r
+        // Check this var question is in the var storage \r
+        //\r
+        if ((BlockData->Offset + BlockData->Width) > VarStorageData->Size) {\r
+          Status = EFI_INVALID_PARAMETER;\r
+          FreePool (BlockData);\r
+          goto Done;\r
+        }\r
+        //\r
+        // Add Block Data into VarStorageData BlockEntry\r
+        //\r
+        InsertBlockData (&VarStorageData->BlockEntry, &BlockData);\r
+        //\r
+        // No default data for OrderedList.\r
+        //\r
         BlockData = NULL;\r
         break;\r
       }\r
@@ -3184,7 +3192,7 @@ Exit:
   @param  This                   A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
                                  instance.\r
   @param  ConfigResp             A null-terminated Unicode string in <ConfigResp>\r
-                                 format. It can be ConfigAltResp format string.\r
+                                 format.\r
   @param  Block                  A possibly null array of bytes representing the\r
                                  current  block. Only bytes referenced in the\r
                                  ConfigResp string  in the block are modified. If\r
@@ -3407,7 +3415,7 @@ Exit:
   @param  This                   A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
                                  instance.\r
   @param  Configuration          A null-terminated Unicode string in\r
-                                 <MultiConfigAltResp> format. It is <ConfigAltResp> format.\r
+                                 <MultiConfigAltResp> format.\r
   @param  Guid                   A pointer to the GUID value to search for in the\r
                                  routing portion of the ConfigResp string when\r
                                  retrieving  the requested data. If Guid is NULL,\r