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
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user