]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
MdeModulePkg:System hangs in setup menu
[mirror_edk2.git] / MdeModulePkg / Universal / DisplayEngineDxe / ProcessOptions.c
index 84ae03eea70fb3d01b6f361ddd3efd02b5904cb1..52dc5f29d93c7fd13e0df8c738210924790c2e01 100644 (file)
@@ -2,7 +2,7 @@
 Implementation for handling the User Interface option processing.\r
 \r
 \r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, 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
@@ -1278,19 +1278,31 @@ ProcessOptions (
       switch (MenuOption->Sequence) {\r
       case 0:\r
         *OptionString[0] = LEFT_NUMERIC_DELIMITER;\r
-        UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Month);\r
+        if (QuestionValue->Value.date.Month == 0xff){\r
+          UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"??");\r
+        } else {\r
+          UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Month);\r
+        }\r
         *(OptionString[0] + 3) = DATE_SEPARATOR;\r
         break;\r
 \r
       case 1:\r
         SetUnicodeMem (OptionString[0], 4, L' ');\r
-        UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Day);\r
+        if (QuestionValue->Value.date.Day == 0xff){\r
+          UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"??");\r
+        } else {\r
+          UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Day);\r
+        }\r
         *(OptionString[0] + 6) = DATE_SEPARATOR;\r
         break;\r
 \r
       case 2:\r
         SetUnicodeMem (OptionString[0], 7, L' ');\r
-        UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%04d", QuestionValue->Value.date.Year);\r
+        if (QuestionValue->Value.date.Year == 0xff){\r
+          UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"????");\r
+        } else {\r
+          UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%04d", QuestionValue->Value.date.Year);\r
+        }\r
         *(OptionString[0] + 11) = RIGHT_NUMERIC_DELIMITER;\r
         break;\r
       }\r
@@ -1310,19 +1322,31 @@ ProcessOptions (
       switch (MenuOption->Sequence) {\r
       case 0:\r
         *OptionString[0] = LEFT_NUMERIC_DELIMITER;\r
-        UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Hour);\r
+        if (QuestionValue->Value.time.Hour == 0xff){\r
+          UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"??");\r
+        } else {\r
+          UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Hour);\r
+        }\r
         *(OptionString[0] + 3) = TIME_SEPARATOR;\r
         break;\r
 \r
       case 1:\r
         SetUnicodeMem (OptionString[0], 4, L' ');\r
-        UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Minute);\r
+        if (QuestionValue->Value.time.Minute == 0xff){\r
+          UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"??");\r
+        } else {\r
+          UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Minute);\r
+        }\r
         *(OptionString[0] + 6) = TIME_SEPARATOR;\r
         break;\r
 \r
       case 2:\r
         SetUnicodeMem (OptionString[0], 7, L' ');\r
-        UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Second);\r
+        if (QuestionValue->Value.time.Second == 0xff){\r
+          UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"??");\r
+        } else {\r
+          UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Second);\r
+        }\r
         *(OptionString[0] + 9) = RIGHT_NUMERIC_DELIMITER;\r
         break;\r
       }\r