summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DisplayEngineDxe
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2015-06-17 09:36:35 +0000
committerdandanbi <dandanbi@Edk2>2015-06-17 09:36:35 +0000
commitcc63add853d4b5c16b74b4d4ceb59c015a2adcc4 (patch)
treed9e578def351c4e1eaf50f7ae8dbb58f20efdd3e /MdeModulePkg/Universal/DisplayEngineDxe
parentb269f8956321c598e13c55881d6f8f021bae1829 (diff)
downloadedk2-platforms-cc63add853d4b5c16b74b4d4ceb59c015a2adcc4.tar.xz
MdeModulePkg:System hangs in setup menu
System hangs when RTC time rollover 1999 to 2000 Error processing of GetTime function: If get time fail,the date/time will display ??, and update help info to let user know get time fail. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17651 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DisplayEngineDxe')
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c23
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.unibin16664 -> 17032 bytes
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c38
3 files changed, 52 insertions, 9 deletions
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
index e198a5e957..9f50f832aa 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
@@ -2545,6 +2545,8 @@ UiDisplayMenu (
UINTN BottomRow;
UINTN Index;
CHAR16 *StringPtr;
+ CHAR16 *StringRightPtr;
+ CHAR16 *StringErrorPtr;
CHAR16 *OptionString;
CHAR16 *HelpString;
CHAR16 *HelpHeaderString;
@@ -2579,6 +2581,7 @@ UiDisplayMenu (
EFI_STRING_ID HelpInfo;
UI_EVENT_TYPE EventType;
BOOLEAN SkipHighLight;
+ EFI_HII_VALUE *StatementValue;
EventType = UIEventNone;
Status = EFI_SUCCESS;
@@ -2885,10 +2888,26 @@ UiDisplayMenu (
//
ASSERT(MenuOption != NULL);
HelpInfo = ((EFI_IFR_STATEMENT_HEADER *) ((CHAR8 *)MenuOption->ThisTag->OpCode + sizeof (EFI_IFR_OP_HEADER)))->Help;
+ Statement = MenuOption->ThisTag;
+ StatementValue = &Statement->CurrentValue;
if (HelpInfo == 0 || !IsSelectable (MenuOption)) {
- StringPtr = GetToken (STRING_TOKEN (EMPTY_STRING), gHiiHandle);
+ if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP && StatementValue->Value.date.Month== 0xff)||(Statement->OpCode->OpCode == EFI_IFR_TIME_OP && StatementValue->Value.time.Hour == 0xff)){
+ StringPtr = GetToken (STRING_TOKEN (GET_TIME_FAIL), gHiiHandle);
+ } else {
+ StringPtr = GetToken (STRING_TOKEN (EMPTY_STRING), gHiiHandle);
+ }
} else {
- StringPtr = GetToken (HelpInfo, gFormData->HiiHandle);
+ if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP && StatementValue->Value.date.Month== 0xff)||(Statement->OpCode->OpCode == EFI_IFR_TIME_OP && StatementValue->Value.time.Hour == 0xff)){
+ StringRightPtr = GetToken (HelpInfo, gFormData->HiiHandle);
+ StringErrorPtr = GetToken (STRING_TOKEN (GET_TIME_FAIL), gHiiHandle);
+ StringPtr = AllocateZeroPool ((StrLen (StringRightPtr) + StrLen (StringErrorPtr)+ 1 ) * sizeof (CHAR16));
+ StrCpyS (StringPtr, StrLen (StringRightPtr) + StrLen (StringErrorPtr) + 1, StringRightPtr);
+ StrCatS (StringPtr, StrLen (StringRightPtr) + StrLen (StringErrorPtr) + 1, StringErrorPtr);
+ FreePool (StringRightPtr);
+ FreePool (StringErrorPtr);
+ } else {
+ StringPtr = GetToken (HelpInfo, gFormData->HiiHandle);
+ }
}
}
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni
index 2a06c3d495..5c6ad48433 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni
Binary files differ
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
index 84ae03eea7..52dc5f29d9 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
@@ -2,7 +2,7 @@
Implementation for handling the User Interface option processing.
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1278,19 +1278,31 @@ ProcessOptions (
switch (MenuOption->Sequence) {
case 0:
*OptionString[0] = LEFT_NUMERIC_DELIMITER;
- UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Month);
+ if (QuestionValue->Value.date.Month == 0xff){
+ UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"??");
+ } else {
+ UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Month);
+ }
*(OptionString[0] + 3) = DATE_SEPARATOR;
break;
case 1:
SetUnicodeMem (OptionString[0], 4, L' ');
- UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Day);
+ if (QuestionValue->Value.date.Day == 0xff){
+ UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"??");
+ } else {
+ UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Day);
+ }
*(OptionString[0] + 6) = DATE_SEPARATOR;
break;
case 2:
SetUnicodeMem (OptionString[0], 7, L' ');
- UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%04d", QuestionValue->Value.date.Year);
+ if (QuestionValue->Value.date.Year == 0xff){
+ UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"????");
+ } else {
+ UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%04d", QuestionValue->Value.date.Year);
+ }
*(OptionString[0] + 11) = RIGHT_NUMERIC_DELIMITER;
break;
}
@@ -1310,19 +1322,31 @@ ProcessOptions (
switch (MenuOption->Sequence) {
case 0:
*OptionString[0] = LEFT_NUMERIC_DELIMITER;
- UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Hour);
+ if (QuestionValue->Value.time.Hour == 0xff){
+ UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"??");
+ } else {
+ UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Hour);
+ }
*(OptionString[0] + 3) = TIME_SEPARATOR;
break;
case 1:
SetUnicodeMem (OptionString[0], 4, L' ');
- UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Minute);
+ if (QuestionValue->Value.time.Minute == 0xff){
+ UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"??");
+ } else {
+ UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Minute);
+ }
*(OptionString[0] + 6) = TIME_SEPARATOR;
break;
case 2:
SetUnicodeMem (OptionString[0], 7, L' ');
- UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Second);
+ if (QuestionValue->Value.time.Second == 0xff){
+ UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"??");
+ } else {
+ UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Second);
+ }
*(OptionString[0] + 9) = RIGHT_NUMERIC_DELIMITER;
break;
}