]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
Per UEFI spec, FORM_OPEN/FORM_CLOSE Callback function should be called for each quest...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / DeviceMngr / DeviceManager.c
index 30be2b59b5a32a46beb003a7bf64b80ef7148dc1..6965615df31c6cc3aef8de65ea79c74a65662f1b 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   The platform device manager reference implementation\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2004 - 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
@@ -122,6 +122,13 @@ DeviceManagerCallback (
   OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest\r
   )\r
 {\r
+  if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) {\r
+    //\r
+    // Do nothing for UEFI OPEN/CLOSE Action\r
+    //\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
   if ((Value == NULL) || (ActionRequest == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -298,7 +305,7 @@ ExtractDisplayedHiiFormFromHiiHandle (
             //\r
             // Find FormSet OpCode\r
             //\r
-            ClassGuidNum = ((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3;\r
+            ClassGuidNum = (UINT8) (((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3);\r
             ClassGuid = (EFI_GUID *) (VOID *)(OpCodeData + sizeof (EFI_IFR_FORM_SET));\r
             while (ClassGuidNum-- > 0) {\r
               if (CompareGuid (SetupClassGuid, ClassGuid)) {\r
@@ -464,13 +471,24 @@ CallDeviceManager (
                 &NumHandles,\r
                 &DriverHealthHandles\r
                 );\r
+\r
   //\r
-  // If there are no drivers installed driver health protocol\r
+  // If there are no drivers installed driver health protocol, do not create driver health entry in UI\r
   //\r
-  if (NumHandles == 0) {\r
-    HiiSetString (HiiHandle, STRING_TOKEN (STR_DM_DRIVER_HEALTH_TITLE), GetStringById (STRING_TOKEN (STR_EMPTY_STRING)), NULL);\r
-    HiiSetString (HiiHandle, STRING_TOKEN (STR_DRIVER_HEALTH_ALL_HEALTHY), GetStringById (STRING_TOKEN (STR_EMPTY_STRING)), NULL);\r
-  } else {\r
+  if (NumHandles != 0) {\r
+    //\r
+    // If driver health protocol is installed, create Driver Health subtitle and entry\r
+    //\r
+    HiiCreateSubTitleOpCode (StartOpCodeHandle, STRING_TOKEN (STR_DM_DRIVER_HEALTH_TITLE), 0, 0, 0);\r
+    HiiCreateActionOpCode (\r
+      StartOpCodeHandle,                                // Container for dynamic created opcodes\r
+      DEVICE_MANAGER_KEY_DRIVER_HEALTH,                 // Question ID\r
+      STRING_TOKEN(STR_DRIVER_HEALTH_ALL_HEALTHY),      // Prompt text\r
+      STRING_TOKEN(STR_DRIVER_HEALTH_STATUS_HELP),      // Help text\r
+      EFI_IFR_FLAG_CALLBACK,                            // Question flag\r
+      0                                                 // Action String ID\r
+    );\r
+\r
     //\r
     // Check All Driver health status\r
     //\r
@@ -598,6 +616,13 @@ DriverHealthCallback (
   OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest\r
   )\r
 {\r
+  if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) {\r
+    //\r
+    // Do nothing for UEFI OPEN/CLOSE Action\r
+    //\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
   if ((Value == NULL) || (ActionRequest == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r