12#define MAX_TIME_OUT_LEN 0x10
25 IN OUT CHAR16 *Destination,
32 for (Length = 0; Destination[Length] != 0; Length++) {
41 Destination[Length] = NARROW_CHAR;
44 StrCpyS (Destination + Length, DestMax - Length, Source);
64 switch (Value->Type) {
65 case EFI_IFR_TYPE_NUM_SIZE_8:
66 RetVal = Value->Value.u8;
69 case EFI_IFR_TYPE_NUM_SIZE_16:
70 RetVal = Value->Value.u16;
73 case EFI_IFR_TYPE_NUM_SIZE_32:
74 RetVal = Value->Value.u32;
77 case EFI_IFR_TYPE_BOOLEAN:
78 RetVal = Value->Value.b;
81 case EFI_IFR_TYPE_DATE:
82 RetVal = *(UINT64 *)&Value->Value.date;
85 case EFI_IFR_TYPE_TIME:
86 RetVal = (*(UINT64 *)&Value->Value.time) & 0xffffff;
90 RetVal = Value->Value.u64;
114 switch (Value->Type) {
115 case EFI_IFR_TYPE_BUFFER:
116 case EFI_IFR_TYPE_DATE:
117 case EFI_IFR_TYPE_TIME:
118 case EFI_IFR_TYPE_REF:
140 switch (Value->Type) {
141 case EFI_IFR_TYPE_NUM_SIZE_8:
142 case EFI_IFR_TYPE_NUM_SIZE_16:
143 case EFI_IFR_TYPE_NUM_SIZE_32:
144 case EFI_IFR_TYPE_NUM_SIZE_64:
145 case EFI_IFR_TYPE_BOOLEAN:
171 switch (Value->Type) {
172 case EFI_IFR_TYPE_BUFFER:
173 *Buf = Value->Buffer;
174 *BufLen = Value->BufferLen;
177 case EFI_IFR_TYPE_DATE:
178 *Buf = (UINT8 *)(&Value->Value.date);
182 case EFI_IFR_TYPE_TIME:
183 *Buf = (UINT8 *)(&Value->Value.time);
187 case EFI_IFR_TYPE_REF:
188 *Buf = (UINT8 *)(&Value->Value.ref);
230 if ((Value1->Type == EFI_IFR_TYPE_STRING) && (Value2->Type == EFI_IFR_TYPE_STRING)) {
231 if ((Value1->Value.string == 0) || (Value2->Value.string == 0)) {
235 return EFI_INVALID_PARAMETER;
238 if (Value1->Value.string == Value2->Value.string) {
243 Str1 =
GetToken (Value1->Value.string, HiiHandle);
248 return EFI_NOT_FOUND;
251 Str2 =
GetToken (Value2->Value.string, HiiHandle);
254 return EFI_NOT_FOUND;
257 *Result =
StrCmp (Str1, Str2);
272 Len = Buf1Len > Buf2Len ? Buf2Len : Buf1Len;
274 if ((*Result == 0) && (Buf1Len != Buf2Len)) {
279 *Result = Buf1Len > Buf2Len ? 1 : -1;
292 }
else if (Temp64 < 0) {
301 return EFI_UNSUPPORTED;
326 while (!
IsNull (&Question->OptionListHead, Link)) {
327 Option = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
330 Value.Type = Option->OptionOpCode->Type;
337 Link =
GetNextNode (&Question->OptionListHead, Link);
362 ASSERT (Array !=
NULL);
366 case EFI_IFR_TYPE_NUM_SIZE_8:
367 Data = (UINT64)*(((UINT8 *)Array) + Index);
370 case EFI_IFR_TYPE_NUM_SIZE_16:
371 Data = (UINT64)*(((UINT16 *)Array) + Index);
374 case EFI_IFR_TYPE_NUM_SIZE_32:
375 Data = (UINT64)*(((UINT32 *)Array) + Index);
378 case EFI_IFR_TYPE_NUM_SIZE_64:
379 Data = (UINT64)*(((UINT64 *)Array) + Index);
406 ASSERT (Array !=
NULL);
409 case EFI_IFR_TYPE_NUM_SIZE_8:
410 *(((UINT8 *)Array) + Index) = (UINT8)Value;
413 case EFI_IFR_TYPE_NUM_SIZE_16:
414 *(((UINT16 *)Array) + Index) = (UINT16)Value;
417 case EFI_IFR_TYPE_NUM_SIZE_32:
418 *(((UINT32 *)Array) + Index) = (UINT32)Value;
421 case EFI_IFR_TYPE_NUM_SIZE_64:
422 *(((UINT64 *)Array) + Index) = (UINT64)Value;
454 ASSERT (Array !=
NULL);
460 case EFI_IFR_TYPE_NUM_SIZE_8:
461 ValueComp = (UINT8)Value;
464 case EFI_IFR_TYPE_NUM_SIZE_16:
465 ValueComp = (UINT16)Value;
468 case EFI_IFR_TYPE_NUM_SIZE_32:
469 ValueComp = (UINT32)Value;
472 case EFI_IFR_TYPE_NUM_SIZE_64:
473 ValueComp = (UINT64)Value;
481 while ((TmpValue =
GetArrayData (Array, Type, Count)) != 0) {
482 if (ValueComp == TmpValue) {
510 IN OUT CHAR16 *FormattedNumber,
519 if (BufferSize < (21 *
sizeof (CHAR16))) {
520 return EFI_BUFFER_TOO_SMALL;
523 QuestionValue = &Question->CurrentValue;
526 Value = (INT64)QuestionValue->Value.u64;
527 switch (NumericOp->Flags & EFI_IFR_DISPLAY) {
528 case EFI_IFR_DISPLAY_INT_DEC:
529 switch (QuestionValue->Type) {
530 case EFI_IFR_NUMERIC_SIZE_1:
531 Value = (INT64)((INT8)QuestionValue->Value.u8);
534 case EFI_IFR_NUMERIC_SIZE_2:
535 Value = (INT64)((INT16)QuestionValue->Value.u16);
538 case EFI_IFR_NUMERIC_SIZE_4:
539 Value = (INT64)((INT32)QuestionValue->Value.u32);
542 case EFI_IFR_NUMERIC_SIZE_8:
556 case EFI_IFR_DISPLAY_UINT_DEC:
560 case EFI_IFR_DISPLAY_UINT_HEX:
565 return EFI_UNSUPPORTED;
597 UINTN DimensionsWidth;
598 UINTN DimensionsHeight;
600 DimensionsWidth = gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn;
601 DimensionsHeight = gStatementDimensions.BottomRow - gStatementDimensions.TopRow;
605 if ((RequestedWidth + 2) > DimensionsWidth) {
606 RequestedWidth = DimensionsWidth - 2;
613 Start = (DimensionsWidth - RequestedWidth - 2) / 2 + gStatementDimensions.LeftColumn + 1;
614 End = Start + RequestedWidth + 1;
616 Top = ((DimensionsHeight - NumberOfLines - 2) / 2) + gStatementDimensions.TopRow - 1;
617 Bottom = Top + NumberOfLines + 2;
619 Character = BOXDRAW_DOWN_RIGHT;
621 Character = BOXDRAW_HORIZONTAL;
622 for (Index = Start; Index + 2 < End; Index++) {
626 Character = BOXDRAW_DOWN_LEFT;
628 Character = BOXDRAW_VERTICAL;
631 for (Index = Top; Index + 2 < Bottom; Index++, Count++) {
632 String =
VA_ARG (Marker, CHAR16 *);
646 if (String[0] == L
' ') {
653 if (String[0] == CHAR_NULL) {
658 ((DimensionsWidth -
GetStringWidth (String) / 2) / 2) + gStatementDimensions.LeftColumn + 1,
667 Character = BOXDRAW_UP_RIGHT;
669 Character = BOXDRAW_HORIZONTAL;
670 for (Index = Start; Index + 2 < End; Index++) {
674 Character = BOXDRAW_UP_LEFT;
735 CHAR16 TimeOutString[MAX_TIME_OUT_LEN];
739 if (*(EventInfo->TimeOut) == 0) {
740 gBS->CloseEvent (Event);
742 gBS->SignalEvent (EventInfo->SyncEvent);
746 UnicodeSPrint (TimeOutString, MAX_TIME_OUT_LEN, L
"%d", *(EventInfo->TimeOut));
748 CreateDialog (
NULL, gEmptyString, EventInfo->ErrorInfo, gPressEnter, gEmptyString, TimeOutString,
NULL);
750 *(EventInfo->TimeOut) -= 1;
768 CreateDialog (&Key, gEmptyString, gPassowordInvalid, gPressEnter, gEmptyString,
NULL);
769 }
while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
794 Question = MenuOption->ThisTag;
796 Maximum = PasswordInfo->MaxSize;
806 Status = Question->PasswordCheck (gFormData, Question, StringPtr);
811 if (Status == EFI_UNSUPPORTED) {
813 CreateDialog (&Key, gEmptyString, gPasswordUnsupported, gPressEnter, gEmptyString,
NULL);
814 }
while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
821 if (EFI_ERROR (Status)) {
825 Status =
ReadString (MenuOption, gPromptForPassword, StringPtr);
826 if (EFI_ERROR (Status)) {
827 ZeroMem (StringPtr, (Maximum + 1) *
sizeof (CHAR16));
835 Status = Question->PasswordCheck (gFormData, Question, StringPtr);
836 if (EFI_ERROR (Status)) {
837 if (Status == EFI_NOT_READY) {
846 ZeroMem (StringPtr, (Maximum + 1) *
sizeof (CHAR16));
855 ZeroMem (StringPtr, (Maximum + 1) *
sizeof (CHAR16));
856 Status =
ReadString (MenuOption, gPromptForNewPassword, StringPtr);
857 if (EFI_ERROR (Status)) {
861 Question->PasswordCheck (gFormData, Question,
NULL);
862 ZeroMem (StringPtr, (Maximum + 1) *
sizeof (CHAR16));
872 Status =
ReadString (MenuOption, gConfirmPassword, TempString);
873 if (EFI_ERROR (Status)) {
877 Question->PasswordCheck (gFormData, Question,
NULL);
878 ZeroMem (StringPtr, (Maximum + 1) *
sizeof (CHAR16));
879 ZeroMem (TempString, (Maximum + 1) *
sizeof (CHAR16));
888 if (
StrCmp (StringPtr, TempString) == 0) {
889 gUserInput->InputValue.Buffer =
AllocateCopyPool (Question->CurrentValue.BufferLen, StringPtr);
890 gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
891 gUserInput->InputValue.Type = Question->CurrentValue.Type;
899 Question->PasswordCheck (gFormData, Question,
NULL);
905 CreateDialog (&Key, gEmptyString, gConfirmError, gPressEnter, gEmptyString,
NULL);
906 }
while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
908 Status = EFI_INVALID_PARAMETER;
911 ZeroMem (TempString, (Maximum + 1) *
sizeof (CHAR16));
912 ZeroMem (StringPtr, (Maximum + 1) *
sizeof (CHAR16));
930 CHAR16 *FormTitleStr;
931 CHAR16 *FormSetTitleStr;
932 CHAR16 *OneOfOptionStr;
933 CHAR16 *QuestionName;
944 UINTN FormsetBufferSize;
946 Question = MenuOption->ThisTag;
949 FormSetTitleStr =
GetToken (FormsetBuffer->FormSetTitle, gFormData->HiiHandle);
950 FormTitleStr =
GetToken (gFormData->FormTitle, gFormData->HiiHandle);
952 DEBUG ((DEBUG_ERROR,
"\n[%a]: Mismatch Formset : Formset Guid = %g, FormSet title = %s\n", gEfiCallerBaseName, &gFormData->FormSetGuid, FormSetTitleStr));
953 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch Form : FormId = %d, Form title = %s.\n", gEfiCallerBaseName, gFormData->FormId, FormTitleStr));
956 if (Question->OpCode->OpCode == EFI_IFR_ORDERED_LIST_OP) {
959 Option = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
960 ValueType = Option->OptionOpCode->Type;
961 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch Error : OrderedList value in the array doesn't match with option value.\n", gEfiCallerBaseName));
962 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch OrderedList: Name = %s.\n", gEfiCallerBaseName, QuestionName));
963 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch OrderedList: OrderedList array value :\n", gEfiCallerBaseName));
966 for (Index = 0; Index < OrderList->MaxContainers; Index++) {
967 ValueArray = Question->CurrentValue.Buffer;
968 HiiValue.Value.u64 =
GetArrayData (ValueArray, ValueType, Index);
969 DEBUG ((DEBUG_ERROR,
" Value[%d] =%ld.\n", Index, HiiValue.Value.u64));
971 }
else if (Question->OpCode->OpCode == EFI_IFR_ONE_OF_OP) {
972 QuestionName =
GetToken (((
EFI_IFR_ONE_OF *)MenuOption->ThisTag->OpCode)->Question.Header.Prompt, gFormData->HiiHandle);
973 QuestionValue = &Question->CurrentValue;
974 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch Error : OneOf value doesn't match with option value.\n", gEfiCallerBaseName));
975 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch OneOf : Name = %s.\n", gEfiCallerBaseName, QuestionName));
976 switch (QuestionValue->Type) {
977 case EFI_IFR_TYPE_NUM_SIZE_64:
978 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch OneOf : OneOf value = %ld.\n", gEfiCallerBaseName, QuestionValue->Value.u64));
981 case EFI_IFR_TYPE_NUM_SIZE_32:
982 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch OneOf : OneOf value = %d.\n", gEfiCallerBaseName, QuestionValue->Value.u32));
985 case EFI_IFR_TYPE_NUM_SIZE_16:
986 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch OneOf : OneOf value = %d.\n", gEfiCallerBaseName, QuestionValue->Value.u16));
989 case EFI_IFR_TYPE_NUM_SIZE_8:
990 DEBUG ((DEBUG_ERROR,
"[%a]: Mismatch OneOf : OneOf value = %d.\n", gEfiCallerBaseName, QuestionValue->Value.u8));
1001 while (!
IsNull (&Question->OptionListHead, Link)) {
1002 Option = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1003 OneOfOptionStr =
GetToken (Option->OptionOpCode->Option, gFormData->HiiHandle);
1004 switch (Option->OptionOpCode->Type) {
1005 case EFI_IFR_TYPE_NUM_SIZE_64:
1006 DEBUG ((DEBUG_ERROR,
"[%a]: Option %d : Option Value = %ld, Option Name = %s.\n", gEfiCallerBaseName, Index, Option->OptionOpCode->Value.u64, OneOfOptionStr));
1009 case EFI_IFR_TYPE_NUM_SIZE_32:
1010 DEBUG ((DEBUG_ERROR,
"[%a]: Option %d : Option Value = %d, Option Name = %s.\n", gEfiCallerBaseName, Index, Option->OptionOpCode->Value.u32, OneOfOptionStr));
1013 case EFI_IFR_TYPE_NUM_SIZE_16:
1014 DEBUG ((DEBUG_ERROR,
"[%a]: Option %d : Option Value = %d, Option Name = %s.\n", gEfiCallerBaseName, Index, Option->OptionOpCode->Value.u16, OneOfOptionStr));
1017 case EFI_IFR_TYPE_NUM_SIZE_8:
1018 DEBUG ((DEBUG_ERROR,
"[%a]: Option %d : Option Value = %d, Option Name = %s.\n", gEfiCallerBaseName, Index, Option->OptionOpCode->Value.u8, OneOfOptionStr));
1026 Link =
GetNextNode (&Question->OptionListHead, Link);
1046 IN BOOLEAN Selected,
1047 OUT CHAR16 **OptionString,
1048 IN BOOLEAN SkipErrorValue
1055 CHAR16 FormattedNumber[21];
1057 CHAR16 Character[2];
1069 BOOLEAN ValueInvalid;
1075 Character[1] = L
'\0';
1076 *OptionString =
NULL;
1077 ValueInvalid =
FALSE;
1079 ZeroMem (FormattedNumber, 21 *
sizeof (CHAR16));
1080 BufferSize = (gOptionBlockWidth + 1) * 2 * gStatementDimensions.BottomRow;
1082 Question = MenuOption->ThisTag;
1083 QuestionValue = &Question->CurrentValue;
1085 switch (Question->OpCode->OpCode) {
1086 case EFI_IFR_ORDERED_LIST_OP:
1098 OneOfOption = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1100 ValueType = OneOfOption->OptionOpCode->Type;
1101 ValueArray = Question->CurrentValue.Buffer;
1113 MaxLen = OrderList->MaxContainers * BufferSize /
sizeof (CHAR16);
1115 ASSERT (*OptionString);
1117 HiiValue.Type = ValueType;
1118 HiiValue.Value.u64 = 0;
1119 for (Index = 0; Index < OrderList->MaxContainers; Index++) {
1120 HiiValue.Value.u64 =
GetArrayData (ValueArray, ValueType, Index);
1121 if (HiiValue.Value.u64 == 0) {
1129 if (OneOfOption ==
NULL) {
1135 if (SkipErrorValue) {
1146 CreateDialog (&Key, gEmptyString, gOptionMismatch, gPressEnter, gEmptyString,
NULL);
1147 }
while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
1153 gUserInput->SelectedStatement = Question;
1156 ASSERT (ValueArray !=
NULL);
1157 gUserInput->InputValue.Buffer = ValueArray;
1158 gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
1159 gUserInput->InputValue.Type = Question->CurrentValue.Type;
1163 while (!
IsNull (&Question->OptionListHead, Link) && Index2 < OrderList->MaxContainers) {
1164 Option = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1165 Link =
GetNextNode (&Question->OptionListHead, Link);
1166 SetArrayData (ValueArray, ValueType, Index2, Option->OptionOpCode->Value.u64);
1173 *OptionString =
NULL;
1174 return EFI_NOT_FOUND;
1177 Character[0] = LEFT_ONEOF_DELIMITER;
1178 NewStrCat (OptionString[0], MaxLen, Character);
1179 StringPtr =
GetToken (OneOfOption->OptionOpCode->Option, gFormData->HiiHandle);
1180 ASSERT (StringPtr !=
NULL);
1181 NewStrCat (OptionString[0], MaxLen, StringPtr);
1182 Character[0] = RIGHT_ONEOF_DELIMITER;
1183 NewStrCat (OptionString[0], MaxLen, Character);
1184 Character[0] = CHAR_CARRIAGE_RETURN;
1185 NewStrCat (OptionString[0], MaxLen, Character);
1192 if (Index >= OrderList->MaxContainers) {
1200 while (!
IsNull (&Question->OptionListHead, Link)) {
1201 OneOfOption = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1202 Link =
GetNextNode (&Question->OptionListHead, Link);
1204 if (
FindArrayData (ValueArray, ValueType, OneOfOption->OptionOpCode->Value.u64,
NULL)) {
1213 if (SkipErrorValue) {
1217 Character[0] = LEFT_ONEOF_DELIMITER;
1218 NewStrCat (OptionString[0], MaxLen, Character);
1219 StringPtr =
GetToken (OneOfOption->OptionOpCode->Option, gFormData->HiiHandle);
1220 ASSERT (StringPtr !=
NULL);
1221 NewStrCat (OptionString[0], MaxLen, StringPtr);
1222 Character[0] = RIGHT_ONEOF_DELIMITER;
1223 NewStrCat (OptionString[0], MaxLen, Character);
1224 Character[0] = CHAR_CARRIAGE_RETURN;
1225 NewStrCat (OptionString[0], MaxLen, Character);
1231 if (!ValueInvalid) {
1232 ValueInvalid =
TRUE;
1237 CreateDialog (&Key, gEmptyString, gOptionMismatch, gPressEnter, gEmptyString,
NULL);
1238 }
while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
1244 gUserInput->SelectedStatement = Question;
1246 ValueArray =
AllocateCopyPool (Question->CurrentValue.BufferLen, Question->CurrentValue.Buffer);
1247 ASSERT (ValueArray !=
NULL);
1248 gUserInput->InputValue.Buffer = ValueArray;
1249 gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
1250 gUserInput->InputValue.Type = Question->CurrentValue.Type;
1253 SetArrayData (ValueArray, ValueType, Index++, OneOfOption->OptionOpCode->Value.u64);
1258 *OptionString =
NULL;
1259 return EFI_NOT_FOUND;
1265 case EFI_IFR_ONE_OF_OP:
1279 MaxLen = BufferSize /
sizeof (CHAR16);
1281 ASSERT (*OptionString);
1284 if (OneOfOption ==
NULL) {
1290 if (SkipErrorValue) {
1295 OneOfOption = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1301 CreateDialog (&Key, gEmptyString, gOptionMismatch, gPressEnter, gEmptyString,
NULL);
1302 }
while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
1309 Option = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1311 gUserInput->InputValue.Type = Option->OptionOpCode->Type;
1312 switch (gUserInput->InputValue.Type) {
1313 case EFI_IFR_TYPE_NUM_SIZE_8:
1314 gUserInput->InputValue.Value.u8 = Option->OptionOpCode->Value.u8;
1316 case EFI_IFR_TYPE_NUM_SIZE_16:
1317 CopyMem (&gUserInput->InputValue.Value.u16, &Option->OptionOpCode->Value.u16, sizeof (UINT16));
1319 case EFI_IFR_TYPE_NUM_SIZE_32:
1320 CopyMem (&gUserInput->InputValue.Value.u32, &Option->OptionOpCode->Value.u32, sizeof (UINT32));
1322 case EFI_IFR_TYPE_NUM_SIZE_64:
1323 CopyMem (&gUserInput->InputValue.Value.u64, &Option->OptionOpCode->Value.u64, sizeof (UINT64));
1330 gUserInput->SelectedStatement = Question;
1333 *OptionString =
NULL;
1334 return EFI_NOT_FOUND;
1338 Character[0] = LEFT_ONEOF_DELIMITER;
1339 NewStrCat (OptionString[0], MaxLen, Character);
1340 StringPtr =
GetToken (OneOfOption->OptionOpCode->Option, gFormData->HiiHandle);
1341 ASSERT (StringPtr !=
NULL);
1342 NewStrCat (OptionString[0], MaxLen, StringPtr);
1343 Character[0] = RIGHT_ONEOF_DELIMITER;
1344 NewStrCat (OptionString[0], MaxLen, Character);
1351 case EFI_IFR_CHECKBOX_OP:
1356 gUserInput->InputValue.Type = QuestionValue->Type;
1357 gUserInput->InputValue.Value.b = (BOOLEAN)(QuestionValue->Value.b ?
FALSE :
TRUE);
1365 ASSERT (*OptionString);
1367 *OptionString[0] = LEFT_CHECKBOX_DELIMITER;
1369 if (QuestionValue->Value.b) {
1370 *(OptionString[0] + 1) = CHECK_ON;
1372 *(OptionString[0] + 1) = CHECK_OFF;
1375 *(OptionString[0] + 2) = RIGHT_CHECKBOX_DELIMITER;
1380 case EFI_IFR_NUMERIC_OP:
1388 ASSERT (*OptionString);
1390 *OptionString[0] = LEFT_NUMERIC_DELIMITER;
1397 CopyMem (OptionString[0] + 1, FormattedNumber, Number);
1399 *(OptionString[0] + Number / 2) = RIGHT_NUMERIC_DELIMITER;
1404 case EFI_IFR_DATE_OP:
1412 ASSERT (*OptionString);
1414 switch (MenuOption->Sequence) {
1416 *OptionString[0] = LEFT_NUMERIC_DELIMITER;
1417 if (QuestionValue->Value.date.Month == 0xff) {
1418 UnicodeSPrint (OptionString[0] + 1, 21 *
sizeof (CHAR16), L
"??");
1420 UnicodeSPrint (OptionString[0] + 1, 21 *
sizeof (CHAR16), L
"%02d", QuestionValue->Value.date.Month);
1423 *(OptionString[0] + 3) = DATE_SEPARATOR;
1428 if (QuestionValue->Value.date.Day == 0xff) {
1429 UnicodeSPrint (OptionString[0] + 4, 21 *
sizeof (CHAR16), L
"??");
1431 UnicodeSPrint (OptionString[0] + 4, 21 *
sizeof (CHAR16), L
"%02d", QuestionValue->Value.date.Day);
1434 *(OptionString[0] + 6) = DATE_SEPARATOR;
1439 if (QuestionValue->Value.date.Year == 0xff) {
1440 UnicodeSPrint (OptionString[0] + 7, 21 *
sizeof (CHAR16), L
"????");
1442 UnicodeSPrint (OptionString[0] + 7, 21 *
sizeof (CHAR16), L
"%04d", QuestionValue->Value.date.Year);
1445 *(OptionString[0] + 11) = RIGHT_NUMERIC_DELIMITER;
1452 case EFI_IFR_TIME_OP:
1460 ASSERT (*OptionString);
1462 switch (MenuOption->Sequence) {
1464 *OptionString[0] = LEFT_NUMERIC_DELIMITER;
1465 if (QuestionValue->Value.time.Hour == 0xff) {
1466 UnicodeSPrint (OptionString[0] + 1, 21 *
sizeof (CHAR16), L
"??");
1468 UnicodeSPrint (OptionString[0] + 1, 21 *
sizeof (CHAR16), L
"%02d", QuestionValue->Value.time.Hour);
1471 *(OptionString[0] + 3) = TIME_SEPARATOR;
1476 if (QuestionValue->Value.time.Minute == 0xff) {
1477 UnicodeSPrint (OptionString[0] + 4, 21 *
sizeof (CHAR16), L
"??");
1479 UnicodeSPrint (OptionString[0] + 4, 21 *
sizeof (CHAR16), L
"%02d", QuestionValue->Value.time.Minute);
1482 *(OptionString[0] + 6) = TIME_SEPARATOR;
1487 if (QuestionValue->Value.time.Second == 0xff) {
1488 UnicodeSPrint (OptionString[0] + 7, 21 *
sizeof (CHAR16), L
"??");
1490 UnicodeSPrint (OptionString[0] + 7, 21 *
sizeof (CHAR16), L
"%02d", QuestionValue->Value.time.Second);
1493 *(OptionString[0] + 9) = RIGHT_NUMERIC_DELIMITER;
1500 case EFI_IFR_STRING_OP:
1502 StringPtr =
AllocateZeroPool (Question->CurrentValue.BufferLen + sizeof (CHAR16));
1504 CopyMem (StringPtr, Question->CurrentValue.Buffer, Question->CurrentValue.BufferLen);
1506 Status =
ReadString (MenuOption, gPromptForData, StringPtr);
1507 if (EFI_ERROR (Status)) {
1512 gUserInput->InputValue.Buffer =
AllocateCopyPool (Question->CurrentValue.BufferLen, StringPtr);
1513 gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
1514 gUserInput->InputValue.Type = Question->CurrentValue.Type;
1520 ASSERT (*OptionString);
1522 if (((CHAR16 *)Question->CurrentValue.Buffer)[0] == 0x0000) {
1523 *(OptionString[0]) =
'_';
1525 if (Question->CurrentValue.BufferLen < BufferSize) {
1526 BufferSize = Question->CurrentValue.BufferLen;
1529 CopyMem (OptionString[0], (CHAR16 *)Question->CurrentValue.Buffer, BufferSize);
1535 case EFI_IFR_PASSWORD_OP:
1561 IN CHAR16 *StringPtr,
1562 OUT CHAR16 **FormattedString,
1563 OUT UINT16 *EachLineWidth,
1568 CHAR16 *OutputString;
1573 UINT16 MaxStringLen;
1586 LineWidth = (UINT16)(gHelpBlockWidth - 1);
1591 while ((StringLen =
GetLineByWidth (StringPtr, LineWidth, &GlyphWidth, &Index, &OutputString)) != 0) {
1592 if (StringLen > MaxStringLen) {
1593 MaxStringLen = StringLen;
1600 *EachLineWidth = MaxStringLen;
1602 *FormattedString =
AllocateZeroPool (TotalRowNum * MaxStringLen *
sizeof (CHAR16));
1603 ASSERT (*FormattedString !=
NULL);
1610 while ((StringLen =
GetLineByWidth (StringPtr, LineWidth, &GlyphWidth, &Index, &OutputString)) != 0) {
1611 CopyMem (*FormattedString + CheckedNum * MaxStringLen, OutputString, StringLen *
sizeof (CHAR16));
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI CreateDialog(OUT EFI_INPUT_KEY *Key OPTIONAL,...)
UINT8 EFIAPI GetPopupInverseColor(VOID)
UINT8 EFIAPI GetPopupColor(VOID)
VOID EFIAPI ClearLines(IN UINTN LeftColumn, IN UINTN RightColumn, IN UINTN TopRow, IN UINTN BottomRow, IN UINTN TextAttribute)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STRING_ID EFIAPI HiiSetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId OPTIONAL, IN CONST EFI_STRING String, IN CONST CHAR8 *SupportedLanguages OPTIONAL)
EFI_STATUS EFIAPI HiiGetFormSetFromHiiHandle(IN EFI_HII_HANDLE Handle, OUT EFI_IFR_FORM_SET **Buffer, OUT UINTN *BufferSize)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
#define VA_ARG(Marker, TYPE)
#define VA_START(Marker, Parameter)
#define OFFSET_OF(TYPE, Field)
#define DEBUG(Expression)
#define EFI_NOT_AVAILABLE_YET
UINTN ProcessHelpString(IN CHAR16 *StringPtr, OUT CHAR16 **FormattedString, OUT UINT16 *EachLineWidth, IN UINTN RowCount)
VOID EFIAPI RefreshTimeOutProcess(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS CompareHiiValue(IN EFI_HII_VALUE *Value1, IN EFI_HII_VALUE *Value2, OUT INTN *Result, IN EFI_HII_HANDLE HiiHandle OPTIONAL)
VOID EFIAPI CreateMultiStringPopUp(IN UINTN RequestedWidth, IN UINTN NumberOfLines,...)
BOOLEAN FindArrayData(IN VOID *Array, IN UINT8 Type, IN UINT64 Value, OUT UINTN *Index OPTIONAL)
VOID EFIAPI EmptyEventProcess(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS ProcessOptions(IN UI_MENU_OPTION *MenuOption, IN BOOLEAN Selected, OUT CHAR16 **OptionString, IN BOOLEAN SkipErrorValue)
BOOLEAN IsTypeInUINT64(IN EFI_HII_VALUE *Value)
VOID PasswordInvalid(VOID)
UINT64 HiiValueToUINT64(IN EFI_HII_VALUE *Value)
EFI_STATUS PrintFormattedNumber(IN FORM_DISPLAY_ENGINE_STATEMENT *Question, IN OUT CHAR16 *FormattedNumber, IN UINTN BufferSize)
BOOLEAN IsTypeInBuffer(IN EFI_HII_VALUE *Value)
EFI_STATUS PasswordProcess(IN UI_MENU_OPTION *MenuOption)
VOID CreateSharedPopUp(IN UINTN RequestedWidth, IN UINTN NumberOfLines, IN VA_LIST Marker)
VOID PrintMismatchMenuInfo(IN UI_MENU_OPTION *MenuOption)
UINT64 GetArrayData(IN VOID *Array, IN UINT8 Type, IN UINTN Index)
VOID SetArrayData(IN VOID *Array, IN UINT8 Type, IN UINTN Index, IN UINT64 Value)
VOID GetBufAndLenForValue(IN EFI_HII_VALUE *Value, OUT UINT8 **Buf, OUT UINT16 *BufLen)
DISPLAY_QUESTION_OPTION * ValueToOption(IN FORM_DISPLAY_ENGINE_STATEMENT *Question, IN EFI_HII_VALUE *OptionValue)
VOID NewStrCat(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CHAR16 *Source)
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
EFI_STRING_ID string
EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION.