]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PCD/Dxe/Service.c
Update string offset and default offset from UINT16 to STRING_HEAD to match the gener...
[mirror_edk2.git] / MdeModulePkg / Universal / PCD / Dxe / Service.c
index 8bfd199e4826bb25ac77a95f1fce599821e0e73b..53780dca9fac2db9d2713fff74a3495e26071064 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
     Help functions used by PCD DXE driver.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, 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
@@ -55,7 +55,7 @@ GetWorker (
   EFI_STATUS          Status;\r
   UINT32              LocalTokenNumber;\r
   UINT32              Offset;\r
-  UINT16              StringTableIdx;      \r
+  STRING_HEAD         StringTableIdx;      \r
   BOOLEAN             IsPeiDb;\r
 \r
   //\r
@@ -139,7 +139,7 @@ GetWorker (
                // If a HII type PCD's datum type is VOID*, the DefaultValueOffset is the index of \r
                // string array in string table.\r
                //\r
-        StringTableIdx = *(UINT16*)((UINT8 *) PcdDb + VariableHead->DefaultValueOffset);   \r
+        StringTableIdx = *(STRING_HEAD*)((UINT8 *) PcdDb + VariableHead->DefaultValueOffset);   \r
         VaraiableDefaultBuffer = (VOID *) (StringTable + StringTableIdx);     \r
         Status = GetHiiVariable (Guid, Name, &Data, &DataSize);\r
         if (Status == EFI_SUCCESS) {\r
@@ -184,7 +184,7 @@ GetWorker (
       break;\r
 \r
     case PCD_TYPE_STRING:\r
-      StringTableIdx = *(UINT16*)((UINT8 *) PcdDb + Offset);\r
+      StringTableIdx = *(STRING_HEAD*)((UINT8 *) PcdDb + Offset);\r
       RetPtr = (VOID *) (StringTable + StringTableIdx);\r
       break;\r
 \r
@@ -815,7 +815,7 @@ SetWorker (
     \r
     case PCD_TYPE_STRING:\r
       if (SetPtrTypeSize (TmpTokenNumber, Size)) {\r
-        CopyMem (StringTable + *((UINT16 *)InternalData), Data, *Size);\r
+        CopyMem (StringTable + *((STRING_HEAD *)InternalData), Data, *Size);\r
         Status = EFI_SUCCESS;\r
       } else {\r
         Status = EFI_INVALID_PARAMETER;\r
@@ -847,7 +847,7 @@ SetWorker (
       if (EFI_NOT_FOUND == Status) {\r
         if ((LocalTokenNumber & PCD_TYPE_ALL_SET) == (PCD_TYPE_HII|PCD_TYPE_STRING))  {\r
           CopyMem (\r
-            StringTable + *(UINT16 *)(PcdDb + VariableHead->DefaultValueOffset),\r
+            StringTable + *(STRING_HEAD *)(PcdDb + VariableHead->DefaultValueOffset),\r
             Data,\r
             *Size\r
             );\r