]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
Add support to original EFI_IFR_FORM_SET in initial UEFI2.1 spec. Now, it has been...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / DeviceMngr / DeviceManager.c
index 15435056f8d4c8c2a5a602c687a387866e45b0a6..7dbbe85ce8cc8fbc0fb480a68104e58450f0e59d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The platform device manager reference implementation\r
 \r
-Copyright (c) 2004 - 2009, Intel Corporation. <BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. <BR>\r
 All rights reserved. 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
@@ -294,18 +294,25 @@ ExtractDisplayedHiiFormFromHiiHandle (
         OpCodeData = Package + Offset2;\r
 \r
         if (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) {\r
-          //\r
-          // Find FormSet OpCode\r
-          //\r
-          ClassGuidNum = ((EFI_IFR_FORM_SET *) OpCodeData)->Flags;\r
-          ClassGuid = (EFI_GUID *) (VOID *)(OpCodeData + sizeof (EFI_IFR_FORM_SET));\r
-          while (ClassGuidNum-- > 0) {\r
-            if (CompareGuid (SetupClassGuid, ClassGuid)) {\r
-              CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));\r
-              CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));\r
-              FreePool (HiiPackageList);\r
-              return TRUE;\r
+          if (((EFI_IFR_OP_HEADER *) OpCodeData)->Length > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {\r
+            //\r
+            // Find FormSet OpCode\r
+            //\r
+            ClassGuidNum = ((EFI_IFR_FORM_SET *) OpCodeData)->Flags;\r
+            ClassGuid = (EFI_GUID *) (VOID *)(OpCodeData + sizeof (EFI_IFR_FORM_SET));\r
+            while (ClassGuidNum-- > 0) {\r
+              if (CompareGuid (SetupClassGuid, ClassGuid)) {\r
+                CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));\r
+                CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));\r
+                FreePool (HiiPackageList);\r
+                return TRUE;\r
+              }\r
             }\r
+           } else {\r
+             CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));\r
+             CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));\r
+             FreePool (HiiPackageList);\r
+             return TRUE;\r
           }\r
         }\r
         \r
@@ -978,22 +985,19 @@ CallDriverHealth (
 }\r
 \r
 \r
-/*\r
+/**\r
   Check the Driver Health status of a single controller and try to process it if not healthy.\r
 \r
   This function called by CheckAllControllersHealthStatus () function in order to process a specify\r
   contoller's health state.\r
 \r
-  @param DriverHealth       A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.\r
+  @param DriverHealthList   A Pointer to the list contain all of the platform driver health information. \r
+  @param DriverHandle       The handle of driver.\r
   @param ControllerHandle   The class guid specifies which form set will be displayed.\r
   @param ChildHandle        The handle of the child controller to retrieve the health \r
-                           status on.  This is an optional parameter that may be NULL. \r
+                            status on.  This is an optional parameter that may be NULL. \r
+  @param DriverHealth       A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.\r
   @param HealthStatus       The health status of the controller.\r
-  @param MessageList        An array of warning or error messages associated \r
-                           with the controller specified by ControllerHandle and \r
-                           ChildHandle.  This is an optional parameter that may be NULL.\r
-  @param FormHiiHandle      The HII handle for an HII form associated with the \r
-                           controller specified by ControllerHandle and ChildHandle.\r
 \r
   @retval EFI_INVALID_PARAMETER   HealthStatus or DriverHealth is NULL.\r
   @retval HealthStatus            The Health status of specify controller.\r
@@ -1001,7 +1005,7 @@ CallDriverHealth (
   @retval EFI_NOT_FOUND           No controller in the platform install Driver Health Protocol.\r
   @retval EFI_SUCCESS             The Health related operation has been taken successfully.\r
 \r
-*/\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GetSingleControllerHealthStatus (\r
@@ -1306,14 +1310,14 @@ Done:
 }\r
 \r
 \r
-/*\r
+/**\r
   Check the healthy status of the platform, this function will return immediately while found one driver \r
   in the platform are not healthy.\r
 \r
   @retval FALSE      at least one driver in the platform are not healthy.\r
   @retval TRUE       No controller install Driver Health Protocol,\r
                      or all controllers in the platform are in healthy status.\r
-*/\r
+**/\r
 BOOLEAN\r
 PlaformHealthStatusCheck (\r
   VOID\r
@@ -1570,7 +1574,7 @@ ProcessMessages (
 \r
 }\r
 \r
-/*\r
+/**\r
   Repair the whole platform.\r
 \r
   This function is the main entry for user choose "Repair All" in the front page.\r
@@ -1580,7 +1584,7 @@ ProcessMessages (
   @param DriverHealthList   A Pointer to the list contain all of the platform driver health\r
                             information.\r
 \r
-*/\r
+**/\r
 VOID\r
 PlatformRepairAll (\r
   IN LIST_ENTRY  *DriverHealthList\r
@@ -1671,10 +1675,10 @@ DriverHealthSelectBestLanguage (
   @param  SupportedLanguage    The best suitable language that matches the SupportedLangues interface for the \r
                                located Component Name (2) instance.\r
 \r
-  @param  EFI_SUCCESS          The Component Name (2) protocol instance is successfully located and we find\r
+  @retval EFI_SUCCESS          The Component Name (2) protocol instance is successfully located and we find\r
                                the best matching language it support.\r
-  @param  EFI_UNSUPPORTED      The input Language is not supported by the Component Name (2) protocol.\r
-  @param  Other                Some error occurs when locating Component Name (2) protocol instance or finding\r
+  @retval EFI_UNSUPPORTED      The input Language is not supported by the Component Name (2) protocol.\r
+  @retval Other                Some error occurs when locating Component Name (2) protocol instance or finding\r
                                the supported language.\r
 \r
 **/\r
@@ -1893,7 +1897,6 @@ GetControllerNameWorker (
                                It will also be NULL for bus drivers that attempt to retrieve the name\r
                                of the bus controller. It will not be NULL for a bus driver that attempts\r
                                to retrieve the name of a child controller.\r
-  @param  Language             An ASCII string that represents the language command line option.\r
   @param  ControllerName       A pointer to the Unicode string to return. This Unicode string\r
                                is the name of the controller specified by ControllerHandle and ChildHandle.\r
 \r