]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
MdeModulePkg: INF/DEC file updates to EDK II packages
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / HiiDatabase.h
index c2917a9233ecaaca36351839eb74573f21385e48..32e48275b037612c8cabc392d5a480d685361190 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
 Private structures definitions in HiiDatabase.\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2011, 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
@@ -17,7 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Uefi.h>\r
 \r
-#include <Protocol/ConsoleControl.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/HiiFont.h>\r
 #include <Protocol/HiiImage.h>\r
@@ -28,6 +27,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/SimpleTextOut.h>\r
 \r
 #include <Guid/HiiKeyBoardLayout.h>\r
+#include <Guid/GlobalVariable.h>\r
 \r
 \r
 #include <Library/DebugLib.h>\r
@@ -37,15 +37,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
-#include <Library/IfrSupportLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/HiiLib.h>\r
-\r
-#define HII_DATABASE_NOTIFY_GUID \\r
-  { \\r
-    0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \\r
-  }\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/PrintLib.h>\r
 \r
 #define MAX_STRING_LENGTH                  1024\r
 #define MAX_FONT_NAME_LEN                  256\r
@@ -61,14 +56,59 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define BITMAP_LEN_8_BIT(Width, Height)  ((Width) * (Height))\r
 #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)\r
 \r
+//\r
+// IFR data structure\r
+//\r
+// BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure.\r
+\r
+typedef struct {\r
+  LIST_ENTRY          Entry;             // Link to VarStorage\r
+  EFI_GUID            Guid;\r
+  CHAR16              *Name;\r
+  UINT16              Size;\r
+  UINT8               Type;\r
+  LIST_ENTRY          BlockEntry;        // Link to its Block array\r
+} IFR_VARSTORAGE_DATA;\r
+\r
+typedef struct {\r
+  LIST_ENTRY          Entry;             // Link to Block array\r
+  UINT16              Offset;\r
+  UINT16              Width;\r
+  EFI_QUESTION_ID     QuestionId;\r
+  UINT8               OpCode;\r
+  UINT8               Scope;\r
+  LIST_ENTRY          DefaultValueEntry; // Link to its default value array\r
+  CHAR16              *Name;\r
+} IFR_BLOCK_DATA;\r
+\r
+//\r
+// Get default value from IFR data.\r
+//\r
+typedef enum {\r
+  DefaultValueFromDefault = 0,     // Get from the minimum or first one when not set default value.\r
+  DefaultValueFromFlag,            // Get default value from the defalut flag.\r
+  DefaultValueFromOpcode           // Get default value from default opcode, highest priority.\r
+} DEFAULT_VALUE_TYPE;\r
+\r
+typedef struct {\r
+  LIST_ENTRY          Entry;\r
+  DEFAULT_VALUE_TYPE  Type;\r
+  BOOLEAN             Cleaned;       // Whether this value is cleaned\r
+                                     // TRUE  Cleaned, the value can't be used\r
+                                     // FALSE Not cleaned, the value can  be used.\r
+  UINT16              DefaultId;\r
+  EFI_IFR_TYPE_VALUE  Value;\r
+} IFR_DEFAULT_DATA;\r
+\r
 //\r
 // Storage types\r
 //\r
-#define EFI_HII_VARSTORE_BUFFER            0\r
-#define EFI_HII_VARSTORE_NAME_VALUE        1\r
-#define EFI_HII_VARSTORE_EFI_VARIABLE      2\r
+#define EFI_HII_VARSTORE_BUFFER              0\r
+#define EFI_HII_VARSTORE_NAME_VALUE          1\r
+#define EFI_HII_VARSTORE_EFI_VARIABLE        2\r
+#define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3\r
 \r
-#define HII_FORMSET_STORAGE_SIGNATURE           EFI_SIGNATURE_32 ('H', 'S', 'T', 'G')\r
+#define HII_FORMSET_STORAGE_SIGNATURE           SIGNATURE_32 ('H', 'S', 'T', 'G')\r
 typedef struct {\r
   UINTN               Signature;\r
   LIST_ENTRY          Entry;\r
@@ -82,13 +122,11 @@ typedef struct {
   UINT16              Size;\r
 } HII_FORMSET_STORAGE;\r
 \r
-#define HII_FORMSET_STORAGE_FROM_LINK(a)  CR (a, HII_FORMSET_STORAGE, Link, HII_FORMSET_STORAGE_SIGNATURE)\r
-\r
 \r
 //\r
 // String Package definitions\r
 //\r
-#define HII_STRING_PACKAGE_SIGNATURE    EFI_SIGNATURE_32 ('h','i','s','p')\r
+#define HII_STRING_PACKAGE_SIGNATURE    SIGNATURE_32 ('h','i','s','p')\r
 typedef struct _HII_STRING_PACKAGE_INSTANCE {\r
   UINTN                                 Signature;\r
   EFI_HII_STRING_PACKAGE_HDR            *StringPkgHdr;\r
@@ -96,12 +134,13 @@ typedef struct _HII_STRING_PACKAGE_INSTANCE {
   LIST_ENTRY                            StringEntry;\r
   LIST_ENTRY                            FontInfoList;  // local font info list\r
   UINT8                                 FontId;\r
+  EFI_STRING_ID                         MaxStringId;   // record StringId\r
 } HII_STRING_PACKAGE_INSTANCE;\r
 \r
 //\r
 // Form Package definitions\r
 //\r
-#define HII_IFR_PACKAGE_SIGNATURE       EFI_SIGNATURE_32 ('h','f','r','p')\r
+#define HII_IFR_PACKAGE_SIGNATURE       SIGNATURE_32 ('h','f','r','p')\r
 typedef struct _HII_IFR_PACKAGE_INSTANCE {\r
   UINTN                                 Signature;\r
   EFI_HII_PACKAGE_HEADER                FormPkgHdr;\r
@@ -112,7 +151,7 @@ typedef struct _HII_IFR_PACKAGE_INSTANCE {
 //\r
 // Simple Font Package definitions\r
 //\r
-#define HII_S_FONT_PACKAGE_SIGNATURE    EFI_SIGNATURE_32 ('h','s','f','p')\r
+#define HII_S_FONT_PACKAGE_SIGNATURE    SIGNATURE_32 ('h','s','f','p')\r
 typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE {\r
   UINTN                                 Signature;\r
   EFI_HII_SIMPLE_FONT_PACKAGE_HDR       *SimpleFontPkgHdr;\r
@@ -122,16 +161,18 @@ typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE {
 //\r
 // Font Package definitions\r
 //\r
-#define HII_FONT_PACKAGE_SIGNATURE      EFI_SIGNATURE_32 ('h','i','f','p')\r
+#define HII_FONT_PACKAGE_SIGNATURE      SIGNATURE_32 ('h','i','f','p')\r
 typedef struct _HII_FONT_PACKAGE_INSTANCE {\r
   UINTN                                 Signature;\r
   EFI_HII_FONT_PACKAGE_HDR              *FontPkgHdr;\r
+  UINT16                                Height;\r
+  UINT16                                BaseLine;\r
   UINT8                                 *GlyphBlock;\r
   LIST_ENTRY                            FontEntry;\r
   LIST_ENTRY                            GlyphInfoList;\r
 } HII_FONT_PACKAGE_INSTANCE;\r
 \r
-#define HII_GLYPH_INFO_SIGNATURE        EFI_SIGNATURE_32 ('h','g','i','s')\r
+#define HII_GLYPH_INFO_SIGNATURE        SIGNATURE_32 ('h','g','i','s')\r
 typedef struct _HII_GLYPH_INFO {\r
   UINTN                                 Signature;\r
   LIST_ENTRY                            Entry;\r
@@ -139,7 +180,7 @@ typedef struct _HII_GLYPH_INFO {
   EFI_HII_GLYPH_INFO                    Cell;\r
 } HII_GLYPH_INFO;\r
 \r
-#define HII_FONT_INFO_SIGNATURE         EFI_SIGNATURE_32 ('h','l','f','i')\r
+#define HII_FONT_INFO_SIGNATURE         SIGNATURE_32 ('h','l','f','i')\r
 typedef struct _HII_FONT_INFO {\r
   UINTN                                 Signature;\r
   LIST_ENTRY                            Entry;\r
@@ -147,7 +188,7 @@ typedef struct _HII_FONT_INFO {
   UINT8                                 FontId;\r
 } HII_FONT_INFO;\r
 \r
-#define HII_GLOBAL_FONT_INFO_SIGNATURE  EFI_SIGNATURE_32 ('h','g','f','i')\r
+#define HII_GLOBAL_FONT_INFO_SIGNATURE  SIGNATURE_32 ('h','g','f','i')\r
 typedef struct _HII_GLOBAL_FONT_INFO {\r
   UINTN                                 Signature;\r
   LIST_ENTRY                            Entry;\r
@@ -173,7 +214,7 @@ typedef struct _HII_IMAGE_PACKAGE_INSTANCE {
 //\r
 // Keyboard Layout Pacakge definitions\r
 //\r
-#define HII_KB_LAYOUT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','k','l','p')\r
+#define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')\r
 typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE {\r
   UINTN                                 Signature;\r
   UINT8                                 *KeyboardPkg;\r
@@ -183,7 +224,7 @@ typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE {
 //\r
 // Guid Package definitions\r
 //\r
-#define HII_GUID_PACKAGE_SIGNATURE      EFI_SIGNATURE_32 ('h','i','g','p')\r
+#define HII_GUID_PACKAGE_SIGNATURE      SIGNATURE_32 ('h','i','g','p')\r
 typedef struct _HII_GUID_PACKAGE_INSTANCE {\r
   UINTN                                 Signature;\r
   UINT8                                 *GuidPkg;\r
@@ -206,7 +247,7 @@ typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE {
   UINT8                                 *DevicePathPkg;\r
 } HII_DATABASE_PACKAGE_LIST_INSTANCE;\r
 \r
-#define HII_HANDLE_SIGNATURE            EFI_SIGNATURE_32 ('h','i','h','l')\r
+#define HII_HANDLE_SIGNATURE            SIGNATURE_32 ('h','i','h','l')\r
 \r
 typedef struct {\r
   UINTN               Signature;\r
@@ -214,7 +255,7 @@ typedef struct {
   UINTN               Key;\r
 } HII_HANDLE;\r
 \r
-#define HII_DATABASE_RECORD_SIGNATURE   EFI_SIGNATURE_32 ('h','i','d','r')\r
+#define HII_DATABASE_RECORD_SIGNATURE   SIGNATURE_32 ('h','i','d','r')\r
 \r
 typedef struct _HII_DATABASE_RECORD {\r
   UINTN                                 Signature;\r
@@ -224,7 +265,7 @@ typedef struct _HII_DATABASE_RECORD {
   LIST_ENTRY                            DatabaseEntry;\r
 } HII_DATABASE_RECORD;\r
 \r
-#define HII_DATABASE_NOTIFY_SIGNATURE   EFI_SIGNATURE_32 ('h','i','d','n')\r
+#define HII_DATABASE_NOTIFY_SIGNATURE   SIGNATURE_32 ('h','i','d','n')\r
 \r
 typedef struct _HII_DATABASE_NOTIFY {\r
   UINTN                                 Signature;\r
@@ -236,7 +277,7 @@ typedef struct _HII_DATABASE_NOTIFY {
   LIST_ENTRY                            DatabaseNotifyEntry;\r
 } HII_DATABASE_NOTIFY;\r
 \r
-#define HII_DATABASE_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('H', 'i', 'D', 'p')\r
+#define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')\r
 \r
 typedef struct _HII_DATABASE_PRIVATE_DATA {\r
   UINTN                                 Signature;\r
@@ -391,8 +432,9 @@ GetSystemFont (
 /**\r
   Parse all string blocks to find a String block specified by StringId.\r
   If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks\r
-  within this string package and backup its information.\r
-  If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END).\r
+  within this string package and backup its information. If LastStringId is \r
+  specified, the string id of last string block will also be output.\r
+  If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).\r
 \r
   @param  Private                 Hii database private structure.\r
   @param  StringPackage           Hii string package instance.\r
@@ -402,7 +444,8 @@ GetSystemFont (
   @param  StringBlockAddr         Output the block address of found string block.\r
   @param  StringTextOffset        Offset, relative to the found block address, of\r
                                   the  string text information.\r
-  @param  LastStringId            Output the last string id when StringId = 0.\r
+  @param  LastStringId            Output the last string id when StringId = 0 or StringId = -1.\r
+  @param  StartStringId           The first id in the skip block which StringId in the block.\r
 \r
   @retval EFI_SUCCESS             The string text and font is retrieved\r
                                   successfully.\r
@@ -420,7 +463,8 @@ FindStringBlock (
   OUT UINT8                           *BlockType, OPTIONAL\r
   OUT UINT8                           **StringBlockAddr, OPTIONAL\r
   OUT UINTN                           *StringTextOffset, OPTIONAL\r
-  OUT EFI_STRING_ID                   *LastStringId OPTIONAL\r
+  OUT EFI_STRING_ID                   *LastStringId, OPTIONAL\r
+  OUT EFI_STRING_ID                   *StartStringId OPTIONAL\r
   );\r
 \r
 \r
@@ -454,6 +498,34 @@ FindGlyphBlock (
   OUT UINTN                          *GlyphBufferLen OPTIONAL\r
   );\r
 \r
+/**\r
+  This function exports Form packages to a buffer.\r
+  This is a internal function.\r
+\r
+  @param  Private                Hii database private structure.\r
+  @param  Handle                 Identification of a package list.\r
+  @param  PackageList            Pointer to a package list which will be exported.\r
+  @param  UsedSize               The length of buffer be used.\r
+  @param  BufferSize             Length of the Buffer.\r
+  @param  Buffer                 Allocated space for storing exported data.\r
+  @param  ResultSize             The size of the already exported content of  this\r
+                                 package list.\r
+\r
+  @retval EFI_SUCCESS            Form Packages are exported successfully.\r
+  @retval EFI_INVALID_PARAMETER  Any input parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+ExportFormPackages (\r
+  IN HII_DATABASE_PRIVATE_DATA          *Private,\r
+  IN EFI_HII_HANDLE                     Handle,\r
+  IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList,\r
+  IN UINTN                              UsedSize,\r
+  IN UINTN                              BufferSize,\r
+  IN OUT VOID                           *Buffer,\r
+  IN OUT UINTN                          *ResultSize\r
+  );\r
+\r
 //\r
 // EFI_HII_FONT_PROTOCOL protocol interfaces\r
 //\r
@@ -652,13 +724,15 @@ HiiGetGlyph (
                                   with the  first font. On return, points to the\r
                                   returned font handle or points to NULL if there\r
                                   are no more matching fonts.\r
-  @param  StringInfoIn            Upon entry, points to the font to return\r
-                                  information about. If NULL, then the information about the system default \r
-                                  font will be returned.\r
-  @param  StringInfoOut           Upon return, contains the matching font's\r
-                                  information.  If NULL, then no information is\r
-                                  returned. It's caller's responsibility to free\r
-                                  this buffer.\r
+  @param  StringInfoIn            Upon entry, points to the font to return information\r
+                                  about. If NULL, then the information about the system\r
+                                  default font will be returned.\r
+  @param  StringInfoOut           Upon return, contains the matching font's information.\r
+                                  If NULL, then no information is returned. This buffer\r
+                                  is allocated with a call to the Boot Service AllocatePool().\r
+                                  It is the caller's responsibility to call the Boot \r
+                                  Service FreePool() when the caller no longer requires\r
+                                  the contents of StringInfoOut.\r
   @param  String                  Points to the string which will be tested to\r
                                   determine  if all characters are available. If\r
                                   NULL, then any font  is acceptable.\r
@@ -666,7 +740,7 @@ HiiGetGlyph (
   @retval EFI_SUCCESS             Matching font returned successfully.\r
   @retval EFI_NOT_FOUND           No matching font was found.\r
   @retval EFI_INVALID_PARAMETER   StringInfoIn is NULL.\r
-  @retval EFI_INVALID_PARAMETER  StringInfoIn->FontInfoMask is an invalid combination.\r
+  @retval EFI_INVALID_PARAMETER   StringInfoIn->FontInfoMask is an invalid combination.\r
   @retval EFI_OUT_OF_RESOURCES    There were insufficient resources to complete the\r
                                   request.\r
 **/\r
@@ -931,13 +1005,14 @@ HiiNewString (
   @retval EFI_SUCCESS             The string was returned successfully.\r
   @retval EFI_NOT_FOUND           The string specified by StringId is not\r
                                   available.\r
-  @retval EFI_NOT_FOUND           The string specified by StringId is available but\r
-                                                not in the specified language.\r
-                                                The specified PackageList is not in the database.\r
-  @retval EFI_INVALID_LANGUAGE   - The string specified by StringId is available but\r
+                                  The specified PackageList is not in the database.\r
+  @retval EFI_INVALID_LANGUAGE    The string specified by StringId is available but\r
+                                  not in the specified language.\r
   @retval EFI_BUFFER_TOO_SMALL    The buffer specified by StringSize is too small\r
                                   to  hold the string.\r
-  @retval EFI_INVALID_PARAMETER   The String or Language or StringSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The Language or StringSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by StringSize was not zero\r
+                                  and String was NULL.\r
   @retval EFI_OUT_OF_RESOURCES    There were insufficient resources to complete the\r
                                    request.\r
 \r
@@ -996,13 +1071,15 @@ HiiSetString (
   @param  This                    A pointer to the EFI_HII_STRING_PROTOCOL\r
                                   instance.\r
   @param  PackageList             The package list to examine.\r
-  @param  Languages               Points to the buffer to hold the returned string.\r
+  @param  Languages               Points to the buffer to hold the returned\r
+                                  null-terminated ASCII string.\r
   @param  LanguagesSize           On entry, points to the size of the buffer\r
                                   pointed to by  Languages, in bytes. On  return,\r
                                   points to the length of Languages, in bytes.\r
 \r
   @retval EFI_SUCCESS             The languages were returned successfully.\r
-  @retval EFI_INVALID_PARAMETER   The Languages or LanguagesSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The LanguagesSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by LanguagesSize is not zero and Languages is NULL.\r
   @retval EFI_BUFFER_TOO_SMALL    The LanguagesSize is too small to hold the list\r
                                   of  supported languages. LanguageSize is updated\r
                                   to contain the required size.\r
@@ -1028,27 +1105,31 @@ HiiGetLanguages (
   @param  This                    A pointer to the EFI_HII_STRING_PROTOCOL\r
                                   instance.\r
   @param  PackageList             The package list to examine.\r
-  @param  FirstLanguage           Points to the primary language.\r
-  @param  SecondaryLanguages      Points to the buffer to hold the returned list of\r
-                                   secondary languages for the specified\r
-                                  FirstLanguage. If there are no secondary\r
-                                  languages, the function  returns successfully,\r
+  @param  PrimaryLanguage         Points to the null-terminated ASCII string that specifies\r
+                                  the primary language. Languages are specified in the\r
+                                  format specified in Appendix M of the UEFI 2.0 specification.\r
+  @param  SecondaryLanguages      Points to the buffer to hold the returned null-terminated\r
+                                  ASCII string that describes the list of\r
+                                  secondary languages for the specified\r
+                                  PrimaryLanguage. If there are no secondary\r
+                                  languages, the function returns successfully,\r
                                   but this is set to NULL.\r
   @param  SecondaryLanguagesSize  On entry, points to the size of the buffer\r
-                                  pointed to  by SecondLanguages, in bytes. On\r
-                                  return, points to the length of SecondLanguages\r
+                                  pointed to by SecondaryLanguages, in bytes. On\r
+                                  return, points to the length of SecondaryLanguages\r
                                   in bytes.\r
 \r
   @retval EFI_SUCCESS             Secondary languages were correctly returned.\r
-  @retval EFI_INVALID_PARAMETER   FirstLanguage or SecondLanguages or\r
-                                  SecondLanguagesSize was NULL.\r
-  @retval EFI_BUFFER_TOO_SMALL    The buffer specified by SecondLanguagesSize is\r
+  @retval EFI_INVALID_PARAMETER   PrimaryLanguage or SecondaryLanguagesSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by SecondaryLanguagesSize is not\r
+                                  zero and SecondaryLanguages is NULL.\r
+  @retval EFI_BUFFER_TOO_SMALL    The buffer specified by SecondaryLanguagesSize is\r
                                   too small to hold the returned information.\r
-                                  SecondLanguageSize is updated to hold the size of\r
+                                  SecondaryLanguageSize is updated to hold the size of\r
                                   the buffer required.\r
-  @retval EFI_INVALID_LANGUAGE           The language specified by FirstLanguage is not\r
+  @retval EFI_INVALID_LANGUAGE    The language specified by PrimaryLanguage is not\r
                                   present in the specified package list.\r
-  @retval EFI_NOT_FOUND          The specified PackageList is not in the Database.                                \r
+  @retval EFI_NOT_FOUND           The specified PackageList is not in the Database.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1056,7 +1137,7 @@ EFIAPI
 HiiGetSecondaryLanguages (\r
   IN CONST EFI_HII_STRING_PROTOCOL   *This,\r
   IN EFI_HII_HANDLE                  PackageList,\r
-  IN CONST CHAR8                     *FirstLanguage,\r
+  IN CONST CHAR8                     *PrimaryLanguage,\r
   IN OUT CHAR8                       *SecondaryLanguages,\r
   IN OUT UINTN                       *SecondaryLanguagesSize\r
   );\r
@@ -1076,6 +1157,8 @@ HiiGetSecondaryLanguages (
   @param  PackageList             A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
                                   structure.\r
   @param  DriverHandle            Associate the package list with this EFI handle.\r
+                                  If a NULL is specified, this data will not be associate\r
+                                  with any drivers and cannot have a callback induced.\r
   @param  Handle                  A pointer to the EFI_HII_HANDLE instance.\r
 \r
   @retval EFI_SUCCESS             The package list associated with the Handle was\r
@@ -1090,7 +1173,7 @@ EFIAPI
 HiiNewPackageList (\r
   IN CONST EFI_HII_DATABASE_PROTOCOL    *This,\r
   IN CONST EFI_HII_PACKAGE_LIST_HEADER  *PackageList,\r
-  IN CONST EFI_HANDLE                   DriverHandle,\r
+  IN CONST EFI_HANDLE                   DriverHandle, OPTIONAL\r
   OUT EFI_HII_HANDLE                    *Handle\r
   );\r
 \r
@@ -1165,18 +1248,19 @@ HiiUpdatePackageList (
   @param  Handle                  An array of EFI_HII_HANDLE instances returned.\r
 \r
   @retval EFI_SUCCESS             The matching handles are outputed successfully.\r
-                                                HandleBufferLength is updated with the actual length.\r
+                                  HandleBufferLength is updated with the actual length.\r
   @retval EFI_BUFFER_TO_SMALL     The HandleBufferLength parameter indicates that\r
                                   Handle is too small to support the number of\r
                                   handles. HandleBufferLength is updated with a\r
                                   value that will  enable the data to fit.\r
   @retval EFI_NOT_FOUND           No matching handle could not be found in\r
                                   database.\r
-  @retval EFI_INVALID_PARAMETER   Handle or HandleBufferLength was NULL.\r
-  @retval EFI_INVALID_PARAMETER  PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
-                         PackageGuid is not NULL, PackageType is a EFI_HII_\r
-                         PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
-  \r
+  @retval EFI_INVALID_PARAMETER   HandleBufferLength was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by HandleBufferLength was not\r
+                                  zero and Handle was NULL.\r
+  @retval EFI_INVALID_PARAMETER   PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
+                                  PackageGuid is not NULL, PackageType is a EFI_HII_\r
+                                  PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1214,7 +1298,9 @@ HiiListPackageLists (
                                   a value that will enable the data to fit.\r
   @retval EFI_NOT_FOUND           The specifiecd Handle could not be found in the\r
                                   current database.\r
-  @retval EFI_INVALID_PARAMETER   Handle or Buffer or BufferSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   BufferSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by BufferSize was not zero \r
+                                  and Buffer was NULL.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1314,8 +1400,9 @@ HiiUnregisterPackageNotify (
                                   number of GUIDs. KeyGuidBufferLength is\r
                                   updated with a value that will enable the data to\r
                                   fit.\r
-  @retval EFI_INVALID_PARAMETER   The KeyGuidBuffer or KeyGuidBufferLength was\r
-                                  NULL.\r
+  @retval EFI_INVALID_PARAMETER   The KeyGuidBufferLength is NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by KeyGuidBufferLength is not\r
+                                  zero and KeyGuidBuffer is NULL.\r
   @retval EFI_NOT_FOUND           There was no keyboard layout.\r
 \r
 **/\r
@@ -1470,9 +1557,9 @@ HiiConfigRoutingExtractConfig (
                                   instance.\r
   @param  Results                 Null-terminated Unicode string in\r
                                   <MultiConfigAltResp> format which has all values\r
-                                  filled in for the names in the Request string.\r
-                                  String to be allocated by the  called function.\r
-                                  De-allocation is up to the caller.\r
+                                  filled in for the entirety of the current HII \r
+                                  database. String to be allocated by the  called \r
+                                  function. De-allocation is up to the caller.\r
 \r
   @retval EFI_SUCCESS             The Results string is filled with the values\r
                                   corresponding to all requested names.\r
@@ -1595,8 +1682,9 @@ HiiBlockToConfig (
                                   (see below)  is returned.\r
   @param  BlockSize               The length of the Block in units of UINT8.  On\r
                                   input, this is the size of the Block. On output,\r
-                                  if successful, contains the index of the  last\r
-                                  modified byte in the Block.\r
+                                  if successful, contains the largest index of the\r
+                                  modified byte in the Block, or the required buffer\r
+                                  size if the Block is not large enough.\r
   @param  Progress                On return, points to an element of the ConfigResp\r
                                    string filled in with the offset of the most\r
                                   recent '&' before the first failing name / value\r
@@ -1621,6 +1709,8 @@ HiiBlockToConfig (
                                   value pair. Block is left updated and\r
                                   Progress points at the '&' preceding the first\r
                                   non-<BlockName>.\r
+  @retval EFI_BUFFER_TOO_SMALL    Block not large enough. Progress undefined. \r
+                                  BlockSize is updated with the required buffer size.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1687,11 +1777,25 @@ HiiGetAltCfg (
   );\r
 \r
 \r
+/**\r
+  Compare whether two names of languages are identical.\r
+\r
+  @param  Language1              Name of language 1 from StringPackage\r
+  @param  Language2              Name of language 2 to be compared with language 1.\r
+\r
+  @retval TRUE                   same\r
+  @retval FALSE                  not same\r
+\r
+**/\r
+BOOLEAN\r
+HiiCompareLanguage (\r
+  IN  CHAR8  *Language1,\r
+  IN  CHAR8  *Language2\r
+  )\r
+;\r
+\r
 //\r
 // Global variables\r
 //\r
 extern EFI_EVENT gHiiKeyboardLayoutChanged;\r
-\r
-#include "R8Lib.h"\r
-\r
 #endif\r