TianoCore EDK2 master
Loading...
Searching...
No Matches
Presentation.c
Go to the documentation of this file.
1
10#include "Setup.h"
11
12BOOLEAN mHiiPackageListUpdated;
13UI_MENU_SELECTION *gCurrentSelection;
14EFI_HII_HANDLE mCurrentHiiHandle = NULL;
15EFI_GUID mCurrentFormSetGuid = {
16 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 }
17};
18UINT16 mCurrentFormId = 0;
19EFI_EVENT mValueChangedEvent = NULL;
20LIST_ENTRY mRefreshEventList = INITIALIZE_LIST_HEAD_VARIABLE (mRefreshEventList);
21UINT16 mCurFakeQestId;
22FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
23BOOLEAN mFinishRetrieveCall = FALSE;
24
36 )
37{
38 EFI_STATUS Status;
39
40 Status = gBS->HandleProtocol (
41 FormSet->DriverHandle,
42 &gEfiHiiConfigAccessProtocolGuid,
43 (VOID **)&FormSet->ConfigAccess
44 );
45 if (EFI_ERROR (Status)) {
46 //
47 // Configuration Driver don't attach ConfigAccess protocol to its HII package
48 // list, then there will be no configuration action required.
49 // Or the ConfigAccess protocol has been uninstalled.
50 //
51 FormSet->ConfigAccess = NULL;
52 }
53
54 return EFI_SUCCESS;
55}
56
68 IN FORM_BROWSER_FORMSET *FormSet,
70 )
71{
72 EFI_STATUS Status;
73 LIST_ENTRY *Link;
74 FORM_EXPRESSION *Expression;
75
76 Link = GetFirstNode (&Form->ExpressionListHead);
77 while (!IsNull (&Form->ExpressionListHead, Link)) {
78 Expression = FORM_EXPRESSION_FROM_LINK (Link);
79 Link = GetNextNode (&Form->ExpressionListHead, Link);
80
81 if ((Expression->Type == EFI_HII_EXPRESSION_INCONSISTENT_IF) ||
82 (Expression->Type == EFI_HII_EXPRESSION_NO_SUBMIT_IF) ||
83 (Expression->Type == EFI_HII_EXPRESSION_WARNING_IF) ||
84 (Expression->Type == EFI_HII_EXPRESSION_WRITE) ||
85 ((Expression->Type == EFI_HII_EXPRESSION_READ) && (Form->FormType != STANDARD_MAP_FORM_TYPE)))
86 {
87 //
88 // Postpone Form validation to Question editing or Form submitting or Question Write or Question Read for nonstandard form.
89 //
90 continue;
91 }
92
93 Status = EvaluateExpression (FormSet, Form, Expression);
94 if (EFI_ERROR (Status)) {
95 return Status;
96 }
97 }
98
99 return EFI_SUCCESS;
100}
101
112 IN EFI_IFR_OP_HEADER *OpCode
113 )
114{
115 FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement;
116 LIST_ENTRY *Link;
117
118 Link = GetFirstNode (&gDisplayFormData.StatementListHead);
119 while (!IsNull (&gDisplayFormData.StatementListHead, Link)) {
120 DisplayStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (Link);
121
122 if (DisplayStatement->OpCode == OpCode) {
123 return DisplayStatement;
124 }
125
126 Link = GetNextNode (&gDisplayFormData.StatementListHead, Link);
127 }
128
129 return NULL;
130}
131
136VOID
138 VOID
139 )
140{
141 LIST_ENTRY *Link;
143
144 while (!IsListEmpty (&mRefreshEventList)) {
145 Link = GetFirstNode (&mRefreshEventList);
146 EventNode = FORM_BROWSER_REFRESH_EVENT_FROM_LINK (Link);
147 RemoveEntryList (&EventNode->Link);
148
149 gBS->CloseEvent (EventNode->RefreshEvent);
150
151 FreePool (EventNode);
152 }
153}
154
162VOID
164 IN OUT FORM_BROWSER_STATEMENT *Statement
165 )
166{
167 GetQuestionValue (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithHiiDriver);
168
169 //
170 // Reset FormPackage update flag
171 //
172 mHiiPackageListUpdated = FALSE;
173
174 //
175 // Question value may be changed, need invoke its Callback()
176 //
177 ProcessCallBackFunction (gCurrentSelection, gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, EFI_BROWSER_ACTION_RETRIEVE, FALSE);
178
179 if (mHiiPackageListUpdated) {
180 //
181 // Package list is updated, force to reparse IFR binary of target Formset
182 //
183 mHiiPackageListUpdated = FALSE;
184 gCurrentSelection->Action = UI_ACTION_REFRESH_FORMSET;
185 }
186}
187
194VOID
195EFIAPI
197 IN EFI_EVENT Event,
198 IN VOID *Context
199 )
200{
201 FORM_BROWSER_STATEMENT *Statement;
202
203 Statement = (FORM_BROWSER_STATEMENT *)Context;
204 UpdateStatement (Statement);
205 gBS->SignalEvent (mValueChangedEvent);
206}
207
214VOID
215EFIAPI
217 IN EFI_EVENT Event,
218 IN VOID *Context
219 )
220{
221 gCurrentSelection->Action = UI_ACTION_REFRESH_FORMSET;
222
223 gBS->SignalEvent (mValueChangedEvent);
224}
225
232VOID
234 IN FORM_BROWSER_STATEMENT *Statement
235 )
236{
237 EFI_STATUS Status;
238 EFI_EVENT RefreshEvent;
240
241 //
242 // If question has refresh guid, create the notify function.
243 //
244 Status = gBS->CreateEventEx (
245 EVT_NOTIFY_SIGNAL,
246 TPL_CALLBACK,
248 Statement,
249 &Statement->RefreshGuid,
250 &RefreshEvent
251 );
252 ASSERT_EFI_ERROR (Status);
253
255 ASSERT (EventNode != NULL);
256 EventNode->RefreshEvent = RefreshEvent;
257 InsertTailList (&mRefreshEventList, &EventNode->Link);
258}
259
266VOID
269 )
270{
271 EFI_STATUS Status;
272 EFI_EVENT RefreshEvent;
274
275 //
276 // If question has refresh guid, create the notify function.
277 //
278 Status = gBS->CreateEventEx (
279 EVT_NOTIFY_SIGNAL,
280 TPL_CALLBACK,
282 Form,
283 &Form->RefreshGuid,
284 &RefreshEvent
285 );
286 ASSERT_EFI_ERROR (Status);
287
289 ASSERT (EventNode != NULL);
290 EventNode->RefreshEvent = RefreshEvent;
291 InsertTailList (&mRefreshEventList, &EventNode->Link);
292}
293
301VOID
303 IN OUT FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement,
304 IN FORM_BROWSER_STATEMENT *Statement
305 )
306{
307 LIST_ENTRY *Link;
308 QUESTION_OPTION *Option;
309 DISPLAY_QUESTION_OPTION *DisplayOption;
310 FORM_DISPLAY_ENGINE_STATEMENT *ParentStatement;
311
312 DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
313 DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
314 DisplayStatement->OpCode = Statement->OpCode;
315 InitializeListHead (&DisplayStatement->NestStatementList);
316 InitializeListHead (&DisplayStatement->OptionListHead);
317
318 if ((EvaluateExpressionList (Statement->Expression, FALSE, NULL, NULL) == ExpressGrayOut) || Statement->Locked) {
319 DisplayStatement->Attribute |= HII_DISPLAY_GRAYOUT;
320 }
321
322 if ((Statement->ValueExpression != NULL) || ((Statement->QuestionFlags & EFI_IFR_FLAG_READ_ONLY) != 0)) {
323 DisplayStatement->Attribute |= HII_DISPLAY_READONLY;
324 }
325
326 //
327 // Initilize the option list in statement.
328 //
329 Link = GetFirstNode (&Statement->OptionListHead);
330 while (!IsNull (&Statement->OptionListHead, Link)) {
331 Option = QUESTION_OPTION_FROM_LINK (Link);
332 Link = GetNextNode (&Statement->OptionListHead, Link);
333 if ((Option->SuppressExpression != NULL) &&
334 ((EvaluateExpressionList (Option->SuppressExpression, FALSE, NULL, NULL) == ExpressSuppress)))
335 {
336 continue;
337 }
338
339 DisplayOption = AllocateZeroPool (sizeof (DISPLAY_QUESTION_OPTION));
340 ASSERT (DisplayOption != NULL);
341
342 DisplayOption->ImageId = Option->ImageId;
343 DisplayOption->Signature = DISPLAY_QUESTION_OPTION_SIGNATURE;
344 DisplayOption->OptionOpCode = Option->OpCode;
345 InsertTailList (&DisplayStatement->OptionListHead, &DisplayOption->Link);
346 }
347
348 CopyMem (&DisplayStatement->CurrentValue, &Statement->HiiValue, sizeof (EFI_HII_VALUE));
349
350 //
351 // Some special op code need an extra buffer to save the data.
352 // Such as string, password, orderedlist...
353 //
354 if (Statement->BufferValue != NULL) {
355 //
356 // Ordered list opcode may not initilized, get default value here.
357 //
358 if ((Statement->OpCode->OpCode == EFI_IFR_ORDERED_LIST_OP) && (GetArrayData (Statement->BufferValue, Statement->ValueType, 0) == 0)) {
359 GetQuestionDefault (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, 0);
360 }
361
362 DisplayStatement->CurrentValue.Buffer = AllocateCopyPool (Statement->StorageWidth, Statement->BufferValue);
363 DisplayStatement->CurrentValue.BufferLen = Statement->StorageWidth;
364 }
365
366 DisplayStatement->SettingChangedFlag = Statement->ValueChanged;
367
368 //
369 // Get the highlight statement for current form.
370 //
371 if (((gCurrentSelection->QuestionId != 0) && (Statement->QuestionId == gCurrentSelection->QuestionId)) ||
372 ((mCurFakeQestId != 0) && (Statement->FakeQuestionId == mCurFakeQestId)))
373 {
374 gDisplayFormData.HighLightedStatement = DisplayStatement;
375 }
376
377 //
378 // Create the refresh event process function.
379 //
380 if (!IsZeroGuid (&Statement->RefreshGuid)) {
382 }
383
384 //
385 // For RTC type of date/time, set default refresh interval to be 1 second.
386 //
387 if (((Statement->Operand == EFI_IFR_DATE_OP) || (Statement->Operand == EFI_IFR_TIME_OP)) && (Statement->Storage == NULL)) {
388 Statement->RefreshInterval = 1;
389 }
390
391 //
392 // Create the refresh guid hook event.
393 // If the statement in this form has refresh event or refresh interval, browser will create this event for display engine.
394 //
395 if ((!IsZeroGuid (&Statement->RefreshGuid)) || (Statement->RefreshInterval != 0)) {
396 gDisplayFormData.FormRefreshEvent = mValueChangedEvent;
397 }
398
399 //
400 // Save the password check function for later use.
401 //
402 if (Statement->Operand == EFI_IFR_PASSWORD_OP) {
403 DisplayStatement->PasswordCheck = PasswordCheck;
404 }
405
406 //
407 // If this statement is nest in the subtitle, insert to the host statement.
408 // else insert to the form it belongs to.
409 //
410 if (Statement->ParentStatement != NULL) {
411 ParentStatement = GetDisplayStatement (Statement->ParentStatement->OpCode);
412 ASSERT (ParentStatement != NULL);
413 InsertTailList (&ParentStatement->NestStatementList, &DisplayStatement->DisplayLink);
414 } else {
415 InsertTailList (&gDisplayFormData.StatementListHead, &DisplayStatement->DisplayLink);
416 }
417}
418
426VOID
427EFIAPI
429 IN EFI_EVENT Event,
430 IN VOID *Context
431 )
432{
433 FORM_BROWSER_STATEMENT *Statement;
434 LIST_ENTRY *Link;
435
436 Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
437 while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
438 Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
439 Link = GetNextNode (&gCurrentSelection->Form->StatementListHead, Link);
440
441 if (Statement->RefreshInterval == 0) {
442 continue;
443 }
444
445 UpdateStatement (Statement);
446 }
447
448 gBS->SignalEvent (mValueChangedEvent);
449}
450
456VOID
458 VOID
459 )
460{
461 BROWSER_HOT_KEY *HotKey;
462 BROWSER_HOT_KEY *CopyKey;
463 LIST_ENTRY *Link;
464
465 Link = GetFirstNode (&gBrowserHotKeyList);
466 while (!IsNull (&gBrowserHotKeyList, Link)) {
467 HotKey = BROWSER_HOT_KEY_FROM_LINK (Link);
468
469 CopyKey = AllocateCopyPool (sizeof (BROWSER_HOT_KEY), HotKey);
470 ASSERT (CopyKey != NULL);
471 CopyKey->KeyData = AllocateCopyPool (sizeof (EFI_INPUT_KEY), HotKey->KeyData);
472 ASSERT (CopyKey->KeyData != NULL);
473 CopyKey->HelpString = AllocateCopyPool (StrSize (HotKey->HelpString), HotKey->HelpString);
474 ASSERT (CopyKey->HelpString != NULL);
475
476 InsertTailList (&gDisplayFormData.HotKeyListHead, &CopyKey->Link);
477
478 Link = GetNextNode (&gBrowserHotKeyList, Link);
479 }
480}
481
492UINT32
494 IN EFI_QUESTION_ID QuestionId
495 )
496{
497 LIST_ENTRY *Link;
498 QUESTION_ATTRIBUTE_OVERRIDE *QuestionDesc;
499
500 //
501 // Return HII_DISPLAY_NONE if input a invalid question id.
502 //
503 if (QuestionId == 0) {
504 return HII_DISPLAY_NONE;
505 }
506
507 Link = GetFirstNode (&mPrivateData.FormBrowserEx2.OverrideQestListHead);
508 while (!IsNull (&mPrivateData.FormBrowserEx2.OverrideQestListHead, Link)) {
509 QuestionDesc = FORM_QUESTION_ATTRIBUTE_OVERRIDE_FROM_LINK (Link);
510 Link = GetNextNode (&mPrivateData.FormBrowserEx2.OverrideQestListHead, Link);
511
512 if ((QuestionDesc->QuestionId == QuestionId) &&
513 (QuestionDesc->FormId == gCurrentSelection->FormId) &&
514 (QuestionDesc->HiiHandle == gCurrentSelection->Handle) &&
515 CompareGuid (&QuestionDesc->FormSetGuid, &gCurrentSelection->FormSetGuid))
516 {
517 return QuestionDesc->Attribute;
518 }
519 }
520
521 return HII_DISPLAY_NONE;
522}
523
530VOID
532 VOID
533 )
534{
535 EFI_STATUS Status;
536 LIST_ENTRY *Link;
537 FORM_BROWSER_STATEMENT *Statement;
538 FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement;
539 UINT8 MinRefreshInterval;
540 EFI_EVENT RefreshIntervalEvent;
542 BOOLEAN FormEditable;
543 UINT32 ExtraAttribute;
544
545 MinRefreshInterval = 0;
546 FormEditable = FALSE;
547
548 //
549 // Process the statement outside the form, these statements are not recognized
550 // by browser core.
551 //
552 Link = GetFirstNode (&gCurrentSelection->FormSet->StatementListOSF);
553 while (!IsNull (&gCurrentSelection->FormSet->StatementListOSF, Link)) {
554 Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
555 Link = GetNextNode (&gCurrentSelection->FormSet->StatementListOSF, Link);
556
557 DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
558 ASSERT (DisplayStatement != NULL);
559 DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
560 DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
561 DisplayStatement->OpCode = Statement->OpCode;
562
563 InitializeListHead (&DisplayStatement->NestStatementList);
564 InitializeListHead (&DisplayStatement->OptionListHead);
565
566 InsertTailList (&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
567 }
568
569 //
570 // treat formset as statement outside the form,get its opcode.
571 //
572 DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
573 ASSERT (DisplayStatement != NULL);
574
575 DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
576 DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
577 DisplayStatement->OpCode = gCurrentSelection->FormSet->OpCode;
578
579 InitializeListHead (&DisplayStatement->NestStatementList);
580 InitializeListHead (&DisplayStatement->OptionListHead);
581
582 InsertTailList (&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
583
584 //
585 // Process the statement in this form.
586 //
587 Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
588 while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
589 Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
590 Link = GetNextNode (&gCurrentSelection->Form->StatementListHead, Link);
591
592 //
593 // This statement can't be show, skip it.
594 //
595 if (EvaluateExpressionList (Statement->Expression, FALSE, NULL, NULL) > ExpressGrayOut) {
596 continue;
597 }
598
599 //
600 // Check the extra attribute.
601 //
602 ExtraAttribute = ProcessQuestionExtraAttr (Statement->QuestionId);
603 if ((ExtraAttribute & HII_DISPLAY_SUPPRESS) != 0) {
604 continue;
605 }
606
607 DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
608 ASSERT (DisplayStatement != NULL);
609
610 //
611 // Initialize this statement and add it to the display form.
612 //
613 InitializeDisplayStatement (DisplayStatement, Statement);
614
615 //
616 // Set the extra attribute.
617 //
618 DisplayStatement->Attribute |= ExtraAttribute;
619
620 if (Statement->Storage != NULL) {
621 FormEditable = TRUE;
622 }
623
624 //
625 // Get the minimal refresh interval value for later use.
626 //
627 if ((Statement->RefreshInterval != 0) &&
628 ((MinRefreshInterval == 0) || (Statement->RefreshInterval < MinRefreshInterval)))
629 {
630 MinRefreshInterval = Statement->RefreshInterval;
631 }
632 }
633
634 //
635 // Create the periodic timer for refresh interval statement.
636 //
637 if (MinRefreshInterval != 0) {
638 Status = gBS->CreateEvent (EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, RefreshIntervalProcess, NULL, &RefreshIntervalEvent);
639 ASSERT_EFI_ERROR (Status);
640 Status = gBS->SetTimer (RefreshIntervalEvent, TimerPeriodic, MinRefreshInterval * ONE_SECOND);
641 ASSERT_EFI_ERROR (Status);
642
644 ASSERT (EventNode != NULL);
645 EventNode->RefreshEvent = RefreshIntervalEvent;
646 InsertTailList (&mRefreshEventList, &EventNode->Link);
647 }
648
649 //
650 // Create the refresh event process function for Form.
651 //
652 if (!IsZeroGuid (&gCurrentSelection->Form->RefreshGuid)) {
653 CreateRefreshEventForForm (gCurrentSelection->Form);
654 if (gDisplayFormData.FormRefreshEvent == NULL) {
655 gDisplayFormData.FormRefreshEvent = mValueChangedEvent;
656 }
657 }
658
659 //
660 // Update hotkey list field.
661 //
662 if ((gBrowserSettingScope == SystemLevel) || FormEditable) {
664 }
665}
666
672VOID
674 VOID
675 )
676{
677 LIST_ENTRY *Link;
678 FORM_BROWSER_FORMSET *LocalFormSet;
679
680 gDisplayFormData.SettingChangedFlag = FALSE;
681
682 if (IsNvUpdateRequiredForForm (gCurrentSelection->Form)) {
683 gDisplayFormData.SettingChangedFlag = TRUE;
684 return;
685 }
686
687 //
688 // Base on the system level to check whether need to show the NV flag.
689 //
690 switch (gBrowserSettingScope) {
691 case SystemLevel:
692 //
693 // Check the maintain list to see whether there is any change.
694 //
695 Link = GetFirstNode (&gBrowserFormSetList);
696 while (!IsNull (&gBrowserFormSetList, Link)) {
697 LocalFormSet = FORM_BROWSER_FORMSET_FROM_LINK (Link);
698 if (IsNvUpdateRequiredForFormSet (LocalFormSet)) {
699 gDisplayFormData.SettingChangedFlag = TRUE;
700 return;
701 }
702
703 Link = GetNextNode (&gBrowserFormSetList, Link);
704 }
705
706 break;
707
708 case FormSetLevel:
709 if (IsNvUpdateRequiredForFormSet (gCurrentSelection->FormSet)) {
710 gDisplayFormData.SettingChangedFlag = TRUE;
711 return;
712 }
713
714 break;
715
716 default:
717 break;
718 }
719}
720
726VOID
728 VOID
729 )
730{
731 EFI_STATUS Status;
732
733 gDisplayFormData.Signature = FORM_DISPLAY_ENGINE_FORM_SIGNATURE;
734 gDisplayFormData.Version = FORM_DISPLAY_ENGINE_VERSION_1;
735 gDisplayFormData.ImageId = 0;
736 gDisplayFormData.AnimationId = 0;
737
738 InitializeListHead (&gDisplayFormData.StatementListHead);
739 InitializeListHead (&gDisplayFormData.StatementListOSF);
740 InitializeListHead (&gDisplayFormData.HotKeyListHead);
741
742 Status = gBS->CreateEvent (
743 EVT_NOTIFY_WAIT,
744 TPL_CALLBACK,
746 NULL,
747 &mValueChangedEvent
748 );
749 ASSERT_EFI_ERROR (Status);
750}
751
757VOID
759 VOID
760 )
761{
762 BROWSER_HOT_KEY *HotKey;
763 LIST_ENTRY *Link;
764
765 while (!IsListEmpty (&gDisplayFormData.HotKeyListHead)) {
766 Link = GetFirstNode (&gDisplayFormData.HotKeyListHead);
767 HotKey = BROWSER_HOT_KEY_FROM_LINK (Link);
768
769 RemoveEntryList (&HotKey->Link);
770
771 FreePool (HotKey->KeyData);
772 FreePool (HotKey->HelpString);
773 FreePool (HotKey);
774 }
775}
776
782VOID
784 VOID
785 )
786{
787 gDisplayFormData.FormTitle = gCurrentSelection->Form->FormTitle;
788 gDisplayFormData.FormId = gCurrentSelection->FormId;
789 gDisplayFormData.HiiHandle = gCurrentSelection->Handle;
790 CopyGuid (&gDisplayFormData.FormSetGuid, &gCurrentSelection->FormSetGuid);
791
792 gDisplayFormData.Attribute = 0;
793 gDisplayFormData.Attribute |= gCurrentSelection->Form->ModalForm ? HII_DISPLAY_MODAL : 0;
794 gDisplayFormData.Attribute |= gCurrentSelection->Form->Locked ? HII_DISPLAY_LOCK : 0;
795
796 gDisplayFormData.FormRefreshEvent = NULL;
797 gDisplayFormData.HighLightedStatement = NULL;
798
800
802}
803
811VOID
813 LIST_ENTRY *StatementList
814 )
815{
816 LIST_ENTRY *Link;
817 LIST_ENTRY *OptionLink;
820
821 //
822 // Free Statements/Questions
823 //
824 while (!IsListEmpty (StatementList)) {
825 Link = GetFirstNode (StatementList);
826 Statement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (Link);
827
828 //
829 // Free Options List
830 //
831 while (!IsListEmpty (&Statement->OptionListHead)) {
832 OptionLink = GetFirstNode (&Statement->OptionListHead);
833 Option = DISPLAY_QUESTION_OPTION_FROM_LINK (OptionLink);
834 RemoveEntryList (&Option->Link);
835 FreePool (Option);
836 }
837
838 //
839 // Free nest statement List
840 //
841 if (!IsListEmpty (&Statement->NestStatementList)) {
842 FreeStatementData (&Statement->NestStatementList);
843 }
844
845 RemoveEntryList (&Statement->DisplayLink);
846 FreePool (Statement);
847 }
848}
849
855VOID
857 VOID
858 )
859{
860 FreeStatementData (&gDisplayFormData.StatementListHead);
861 FreeStatementData (&gDisplayFormData.StatementListOSF);
862
864
866}
867
879 IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement
880 )
881{
882 FORM_BROWSER_STATEMENT *Statement;
883 LIST_ENTRY *Link;
884
885 Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
886 while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
887 Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
888
889 if (Statement->OpCode == DisplayStatement->OpCode) {
890 return Statement;
891 }
892
893 Link = GetNextNode (&gCurrentSelection->Form->StatementListHead, Link);
894 }
895
896 return NULL;
897}
898
906VOID
908 IN FORM_BROWSER_FORMSET *FormSet,
910 )
911{
912 LIST_ENTRY *Link;
913 FORM_BROWSER_STATEMENT *Question;
914
915 Link = GetFirstNode (&Form->StatementListHead);
916 while (!IsNull (&Form->StatementListHead, Link)) {
917 Question = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
918 Link = GetNextNode (&Form->StatementListHead, Link);
919
920 //
921 // For password opcode, not set the the value changed flag.
922 //
923 if (Question->Operand == EFI_IFR_PASSWORD_OP) {
924 continue;
925 }
926
927 IsQuestionValueChanged (FormSet, Form, Question, GetSetValueWithBuffer);
928 }
929}
930
937VOID
939 IN FORM_BROWSER_FORMSET *FormSet
940 )
941{
942 LIST_ENTRY *Link;
943 FORM_BROWSER_FORM *Form;
944
945 Link = GetFirstNode (&FormSet->FormListHead);
946 while (!IsNull (&FormSet->FormListHead, Link)) {
947 Form = FORM_BROWSER_FORM_FROM_LINK (Link);
948 Link = GetNextNode (&FormSet->FormListHead, Link);
949
950 UpdateStatementStatusForForm (FormSet, Form);
951 }
952}
953
962VOID
964 IN FORM_BROWSER_FORMSET *FormSet,
965 IN FORM_BROWSER_FORM *Form,
966 IN BROWSER_SETTING_SCOPE SettingScope
967 )
968{
969 LIST_ENTRY *Link;
970 FORM_BROWSER_FORMSET *LocalFormSet;
971
972 switch (SettingScope) {
973 case SystemLevel:
974 Link = GetFirstNode (&gBrowserFormSetList);
975 while (!IsNull (&gBrowserFormSetList, Link)) {
976 LocalFormSet = FORM_BROWSER_FORMSET_FROM_LINK (Link);
977 Link = GetNextNode (&gBrowserFormSetList, Link);
978 if (!ValidateFormSet (LocalFormSet)) {
979 continue;
980 }
981
982 UpdateStatementStatusForFormSet (LocalFormSet);
983 }
984
985 break;
986
987 case FormSetLevel:
989 break;
990
991 case FormLevel:
992 UpdateStatementStatusForForm (FormSet, Form);
993 break;
994
995 default:
996 break;
997 }
998}
999
1012 IN UINT32 Action,
1013 IN UINT16 DefaultId
1014 )
1015{
1016 //
1017 // This is caused by use press ESC, and it should not combine with other action type.
1018 //
1019 if ((Action & BROWSER_ACTION_FORM_EXIT) == BROWSER_ACTION_FORM_EXIT) {
1020 FindNextMenu (gCurrentSelection, FormLevel);
1021 return EFI_SUCCESS;
1022 }
1023
1024 //
1025 // Below is normal hotkey trigged action, these action maybe combine with each other.
1026 //
1027 if ((Action & BROWSER_ACTION_DISCARD) == BROWSER_ACTION_DISCARD) {
1028 DiscardForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
1029 }
1030
1031 if ((Action & BROWSER_ACTION_DEFAULT) == BROWSER_ACTION_DEFAULT) {
1032 ExtractDefault (gCurrentSelection->FormSet, gCurrentSelection->Form, DefaultId, gBrowserSettingScope, GetDefaultForAll, NULL, FALSE, FALSE);
1033 UpdateStatementStatus (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
1034 }
1035
1036 if ((Action & BROWSER_ACTION_SUBMIT) == BROWSER_ACTION_SUBMIT) {
1037 SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
1038 }
1039
1040 if ((Action & BROWSER_ACTION_RESET) == BROWSER_ACTION_RESET) {
1041 gResetRequiredFormLevel = TRUE;
1042 gResetRequiredSystemLevel = TRUE;
1043 }
1044
1045 if ((Action & BROWSER_ACTION_EXIT) == BROWSER_ACTION_EXIT) {
1046 //
1047 // Form Exit without saving, Similar to ESC Key.
1048 // FormSet Exit without saving, Exit SendForm.
1049 // System Exit without saving, CallExitHandler and Exit SendForm.
1050 //
1051 DiscardForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
1052 if ((gBrowserSettingScope == FormLevel) || (gBrowserSettingScope == FormSetLevel)) {
1053 FindNextMenu (gCurrentSelection, gBrowserSettingScope);
1054 } else if (gBrowserSettingScope == SystemLevel) {
1055 if (ExitHandlerFunction != NULL) {
1056 ExitHandlerFunction ();
1057 }
1058
1059 gCurrentSelection->Action = UI_ACTION_EXIT;
1060 }
1061 }
1062
1063 return EFI_SUCCESS;
1064}
1065
1076BOOLEAN
1078 IN EFI_HII_HANDLE HiiHandle,
1079 IN EFI_GUID *FormSetGuid
1080 )
1081{
1082 EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList;
1083 UINTN BufferSize;
1084 UINT32 Offset;
1085 UINT32 Offset2;
1086 UINT32 PackageListLength;
1087 EFI_HII_PACKAGE_HEADER PackageHeader;
1088 UINT8 *Package;
1089 UINT8 *OpCodeData;
1090 EFI_STATUS Status;
1091 BOOLEAN FindGuid;
1092
1093 BufferSize = 0;
1094 HiiPackageList = NULL;
1095 FindGuid = FALSE;
1096
1097 Status = mHiiDatabase->ExportPackageLists (mHiiDatabase, HiiHandle, &BufferSize, HiiPackageList);
1098 if (Status == EFI_BUFFER_TOO_SMALL) {
1099 HiiPackageList = AllocatePool (BufferSize);
1100 ASSERT (HiiPackageList != NULL);
1101
1102 Status = mHiiDatabase->ExportPackageLists (mHiiDatabase, HiiHandle, &BufferSize, HiiPackageList);
1103 }
1104
1105 if (EFI_ERROR (Status) || (HiiPackageList == NULL)) {
1106 return FALSE;
1107 }
1108
1109 //
1110 // Get Form package from this HII package List
1111 //
1112 Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
1113 Offset2 = 0;
1114 CopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32));
1115
1116 while (Offset < PackageListLength) {
1117 Package = ((UINT8 *)HiiPackageList) + Offset;
1118 CopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
1119 Offset += PackageHeader.Length;
1120
1121 if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {
1122 //
1123 // Search FormSet in this Form Package
1124 //
1125 Offset2 = sizeof (EFI_HII_PACKAGE_HEADER);
1126 while (Offset2 < PackageHeader.Length) {
1127 OpCodeData = Package + Offset2;
1128
1129 if (((EFI_IFR_OP_HEADER *)OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) {
1130 if (CompareGuid (FormSetGuid, (EFI_GUID *)(OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
1131 FindGuid = TRUE;
1132 break;
1133 }
1134 }
1135
1136 Offset2 += ((EFI_IFR_OP_HEADER *)OpCodeData)->Length;
1137 }
1138 }
1139
1140 if (FindGuid) {
1141 break;
1142 }
1143 }
1144
1145 FreePool (HiiPackageList);
1146
1147 return FindGuid;
1148}
1149
1166 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
1167 IN EFI_GUID *FormsetGuid
1168 )
1169{
1170 EFI_STATUS Status;
1171 EFI_DEVICE_PATH_PROTOCOL *TmpDevicePath;
1172 UINTN Index;
1173 EFI_HANDLE Handle;
1174 EFI_HANDLE DriverHandle;
1175 EFI_HII_HANDLE *HiiHandles;
1176 EFI_HII_HANDLE HiiHandle;
1177
1178 ASSERT (DevicePath != NULL);
1179
1180 TmpDevicePath = DevicePath;
1181 //
1182 // Locate Device Path Protocol handle buffer
1183 //
1184 Status = gBS->LocateDevicePath (
1185 &gEfiDevicePathProtocolGuid,
1186 &TmpDevicePath,
1187 &DriverHandle
1188 );
1189 if (EFI_ERROR (Status) || !IsDevicePathEnd (TmpDevicePath)) {
1190 return NULL;
1191 }
1192
1193 //
1194 // Retrieve all HII Handles from HII database
1195 //
1196 HiiHandles = HiiGetHiiHandles (NULL);
1197 if (HiiHandles == NULL) {
1198 return NULL;
1199 }
1200
1201 //
1202 // Search Hii Handle by Driver Handle
1203 //
1204 HiiHandle = NULL;
1205 for (Index = 0; HiiHandles[Index] != NULL; Index++) {
1206 Status = mHiiDatabase->GetPackageListHandle (
1207 mHiiDatabase,
1208 HiiHandles[Index],
1209 &Handle
1210 );
1211 if (!EFI_ERROR (Status) && (Handle == DriverHandle)) {
1212 if (GetFormsetGuidFromHiiHandle (HiiHandles[Index], FormsetGuid)) {
1213 HiiHandle = HiiHandles[Index];
1214 break;
1215 }
1216
1217 if (HiiHandle != NULL) {
1218 break;
1219 }
1220 }
1221 }
1222
1223 FreePool (HiiHandles);
1224 return HiiHandle;
1225}
1226
1242 EFI_GUID *ComparingGuid
1243 )
1244{
1245 EFI_HII_HANDLE *HiiHandles;
1246 EFI_HII_HANDLE HiiHandle;
1247 UINTN Index;
1248
1249 ASSERT (ComparingGuid != NULL);
1250
1251 HiiHandle = NULL;
1252 //
1253 // Get all the Hii handles
1254 //
1255 HiiHandles = HiiGetHiiHandles (NULL);
1256 ASSERT (HiiHandles != NULL);
1257
1258 //
1259 // Search for formset of each class type
1260 //
1261 for (Index = 0; HiiHandles[Index] != NULL; Index++) {
1262 if (GetFormsetGuidFromHiiHandle (HiiHandles[Index], ComparingGuid)) {
1263 HiiHandle = HiiHandles[Index];
1264 break;
1265 }
1266
1267 if (HiiHandle != NULL) {
1268 break;
1269 }
1270 }
1271
1272 FreePool (HiiHandles);
1273
1274 return HiiHandle;
1275}
1276
1290BOOLEAN
1292 IN OUT UI_MENU_SELECTION *Selection,
1293 IN BROWSER_SETTING_SCOPE Scope
1294 )
1295{
1296 BOOLEAN RetValue;
1297 EFI_STATUS Status;
1298
1299 RetValue = TRUE;
1300 switch (mFormDisplay->ConfirmDataChange ()) {
1301 case BROWSER_ACTION_DISCARD:
1302 DiscardForm (Selection->FormSet, Selection->Form, Scope);
1303 break;
1304
1305 case BROWSER_ACTION_SUBMIT:
1306 Status = SubmitForm (Selection->FormSet, Selection->Form, Scope);
1307 if (EFI_ERROR (Status)) {
1308 RetValue = FALSE;
1309 }
1310
1311 break;
1312
1313 case BROWSER_ACTION_NONE:
1314 RetValue = FALSE;
1315 break;
1316
1317 default:
1318 //
1319 // if Invalid value return, process same as BROWSER_ACTION_NONE.
1320 //
1321 RetValue = FALSE;
1322 break;
1323 }
1324
1325 return RetValue;
1326}
1327
1335VOID
1337 IN OUT UI_MENU_SELECTION *Selection
1338 )
1339{
1340 FORM_ENTRY_INFO *CurrentMenu;
1341 FORM_ENTRY_INFO *ParentMenu;
1342
1343 CurrentMenu = Selection->CurrentMenu;
1344 ParentMenu = UiFindParentMenu (CurrentMenu, FormSetLevel);
1345
1346 if (ParentMenu != NULL) {
1347 CopyMem (&Selection->FormSetGuid, &ParentMenu->FormSetGuid, sizeof (EFI_GUID));
1348 Selection->Handle = ParentMenu->HiiHandle;
1349 Selection->FormId = ParentMenu->FormId;
1350 Selection->QuestionId = ParentMenu->QuestionId;
1351 } else {
1352 Selection->FormId = CurrentMenu->FormId;
1353 Selection->QuestionId = CurrentMenu->QuestionId;
1354 }
1355
1356 Selection->Statement = NULL;
1357}
1358
1370 IN OUT FORM_BROWSER_STATEMENT *Statement,
1371 IN OUT UI_MENU_SELECTION *Selection
1372 )
1373{
1374 CHAR16 *StringPtr;
1375 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
1376 FORM_BROWSER_FORM *RefForm;
1377 EFI_STATUS Status;
1378 EFI_HII_HANDLE HiiHandle;
1379
1380 Status = EFI_SUCCESS;
1381 StringPtr = NULL;
1382 HiiHandle = NULL;
1383
1384 //
1385 // Prepare the device path check, get the device path info first.
1386 //
1387 if (Statement->HiiValue.Value.ref.DevicePath != 0) {
1388 StringPtr = GetToken (Statement->HiiValue.Value.ref.DevicePath, Selection->FormSet->HiiHandle);
1389 }
1390
1391 //
1392 // Check whether the device path string is a valid string.
1393 //
1394 if ((Statement->HiiValue.Value.ref.DevicePath != 0) && (StringPtr != NULL) && (StringPtr[0] != L'\0')) {
1395 if (Selection->Form->ModalForm) {
1396 return Status;
1397 }
1398
1399 //
1400 // Goto another Hii Package list
1401 //
1402 if (mPathFromText != NULL) {
1403 DevicePath = mPathFromText->ConvertTextToDevicePath (StringPtr);
1404 if (DevicePath != NULL) {
1405 HiiHandle = DevicePathToHiiHandle (DevicePath, &Statement->HiiValue.Value.ref.FormSetGuid);
1406 FreePool (DevicePath);
1407 }
1408
1409 FreePool (StringPtr);
1410 } else {
1411 //
1412 // Not found the EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL protocol.
1413 //
1414 PopupErrorMessage (BROWSER_PROTOCOL_NOT_FOUND, NULL, NULL, NULL);
1415 FreePool (StringPtr);
1416 return Status;
1417 }
1418
1419 if (HiiHandle != Selection->Handle) {
1420 //
1421 // Goto another Formset, check for uncommitted data
1422 //
1423 if (((gBrowserSettingScope == FormLevel) || (gBrowserSettingScope == FormSetLevel)) &&
1424 IsNvUpdateRequiredForFormSet (Selection->FormSet))
1425 {
1426 if (!ProcessChangedData (Selection, FormSetLevel)) {
1427 return EFI_SUCCESS;
1428 }
1429 }
1430 }
1431
1432 Selection->Action = UI_ACTION_REFRESH_FORMSET;
1433 Selection->Handle = HiiHandle;
1434 if (Selection->Handle == NULL) {
1435 //
1436 // If target Hii Handle not found, exit current formset.
1437 //
1438 FindParentFormSet (Selection);
1439 return EFI_SUCCESS;
1440 }
1441
1442 CopyMem (&Selection->FormSetGuid, &Statement->HiiValue.Value.ref.FormSetGuid, sizeof (EFI_GUID));
1443 Selection->FormId = Statement->HiiValue.Value.ref.FormId;
1444 Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId;
1445 } else if (!IsZeroGuid (&Statement->HiiValue.Value.ref.FormSetGuid)) {
1446 if (Selection->Form->ModalForm) {
1447 return Status;
1448 }
1449
1450 if (!CompareGuid (&Statement->HiiValue.Value.ref.FormSetGuid, &Selection->FormSetGuid)) {
1451 //
1452 // Goto another Formset, check for uncommitted data
1453 //
1454 if (((gBrowserSettingScope == FormLevel) || (gBrowserSettingScope == FormSetLevel)) &&
1455 IsNvUpdateRequiredForFormSet (Selection->FormSet))
1456 {
1457 if (!ProcessChangedData (Selection, FormSetLevel)) {
1458 return EFI_SUCCESS;
1459 }
1460 }
1461 }
1462
1463 Selection->Action = UI_ACTION_REFRESH_FORMSET;
1464 Selection->Handle = FormSetGuidToHiiHandle (&Statement->HiiValue.Value.ref.FormSetGuid);
1465 if (Selection->Handle == NULL) {
1466 //
1467 // If target Hii Handle not found, exit current formset.
1468 //
1469 FindParentFormSet (Selection);
1470 return EFI_SUCCESS;
1471 }
1472
1473 CopyMem (&Selection->FormSetGuid, &Statement->HiiValue.Value.ref.FormSetGuid, sizeof (EFI_GUID));
1474 Selection->FormId = Statement->HiiValue.Value.ref.FormId;
1475 Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId;
1476 } else if (Statement->HiiValue.Value.ref.FormId != 0) {
1477 //
1478 // Goto another Form, check for uncommitted data
1479 //
1480 if (Statement->HiiValue.Value.ref.FormId != Selection->FormId) {
1481 if (((gBrowserSettingScope == FormLevel) && IsNvUpdateRequiredForForm (Selection->Form))) {
1482 if (!ProcessChangedData (Selection, FormLevel)) {
1483 return EFI_SUCCESS;
1484 }
1485 }
1486 }
1487
1488 RefForm = IdToForm (Selection->FormSet, Statement->HiiValue.Value.ref.FormId);
1489 if ((RefForm != NULL) && (RefForm->SuppressExpression != NULL)) {
1490 if (EvaluateExpressionList (RefForm->SuppressExpression, TRUE, Selection->FormSet, RefForm) != ExpressFalse) {
1491 //
1492 // Form is suppressed.
1493 //
1494 PopupErrorMessage (BROWSER_FORM_SUPPRESS, NULL, NULL, NULL);
1495 return EFI_SUCCESS;
1496 }
1497 }
1498
1499 Selection->FormId = Statement->HiiValue.Value.ref.FormId;
1500 Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId;
1501 } else if (Statement->HiiValue.Value.ref.QuestionId != 0) {
1502 Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId;
1503 }
1504
1505 return Status;
1506}
1507
1520 IN UI_MENU_SELECTION *Selection,
1521 IN FORM_BROWSER_STATEMENT *Question
1522 )
1523{
1524 EFI_STATUS Status;
1525 CHAR16 *ConfigResp;
1526 CHAR16 *Progress;
1527
1528 if (Question->QuestionConfig == 0) {
1529 return EFI_SUCCESS;
1530 }
1531
1532 //
1533 // Get <ConfigResp>
1534 //
1535 ConfigResp = GetToken (Question->QuestionConfig, Selection->FormSet->HiiHandle);
1536 if (ConfigResp == NULL) {
1537 return EFI_NOT_FOUND;
1538 } else if (ConfigResp[0] == L'\0') {
1539 return EFI_SUCCESS;
1540 }
1541
1542 //
1543 // Send config to Configuration Driver
1544 //
1545 Status = mHiiConfigRouting->RouteConfig (
1546 mHiiConfigRouting,
1547 ConfigResp,
1548 &Progress
1549 );
1550
1551 return Status;
1552}
1553
1565 IN USER_INPUT *UserInput
1566 )
1567{
1568 EFI_STATUS Status;
1569 FORM_BROWSER_STATEMENT *Statement;
1570
1571 Status = EFI_SUCCESS;
1572 Statement = NULL;
1573
1574 //
1575 // When Exit from FormDisplay function, one of the below two cases must be true.
1576 //
1577 ASSERT (UserInput->Action != 0 || UserInput->SelectedStatement != NULL);
1578
1579 //
1580 // Remove the last highligh question id, this id will update when show next form.
1581 //
1582 gCurrentSelection->QuestionId = 0;
1583 if (UserInput->SelectedStatement != NULL) {
1584 Statement = GetBrowserStatement (UserInput->SelectedStatement);
1585 ASSERT (Statement != NULL);
1586
1587 //
1588 // This question is the current user select one,record it and later
1589 // show it as the highlight question.
1590 //
1591 gCurrentSelection->CurrentMenu->QuestionId = Statement->QuestionId;
1592 //
1593 // For statement like text, actio, it not has question id.
1594 // So use FakeQuestionId to save the question.
1595 //
1596 if (gCurrentSelection->CurrentMenu->QuestionId == 0) {
1597 mCurFakeQestId = Statement->FakeQuestionId;
1598 } else {
1599 mCurFakeQestId = 0;
1600 }
1601 }
1602
1603 //
1604 // First process the Action field in USER_INPUT.
1605 //
1606 if (UserInput->Action != 0) {
1607 Status = ProcessAction (UserInput->Action, UserInput->DefaultId);
1608 gCurrentSelection->Statement = NULL;
1609 } else {
1610 ASSERT (Statement != NULL);
1611 gCurrentSelection->Statement = Statement;
1612 switch (Statement->Operand) {
1613 case EFI_IFR_REF_OP:
1614 Status = ProcessGotoOpCode (Statement, gCurrentSelection);
1615 break;
1616
1617 case EFI_IFR_ACTION_OP:
1618 //
1619 // Process the Config string <ConfigResp>
1620 //
1621 Status = ProcessQuestionConfig (gCurrentSelection, Statement);
1622 break;
1623
1624 case EFI_IFR_RESET_BUTTON_OP:
1625 //
1626 // Reset Question to default value specified by DefaultId
1627 //
1628 Status = ExtractDefault (gCurrentSelection->FormSet, NULL, Statement->DefaultId, FormSetLevel, GetDefaultForAll, NULL, FALSE, FALSE);
1629 UpdateStatementStatus (gCurrentSelection->FormSet, NULL, FormSetLevel);
1630 break;
1631
1632 default:
1633 switch (Statement->Operand) {
1634 case EFI_IFR_STRING_OP:
1635 DeleteString (Statement->HiiValue.Value.string, gCurrentSelection->FormSet->HiiHandle);
1636 Statement->HiiValue.Value.string = UserInput->InputValue.Value.string;
1637 CopyMem (Statement->BufferValue, UserInput->InputValue.Buffer, (UINTN)UserInput->InputValue.BufferLen);
1638 FreePool (UserInput->InputValue.Buffer);
1639 break;
1640
1641 case EFI_IFR_PASSWORD_OP:
1642 if (UserInput->InputValue.Buffer == NULL) {
1643 //
1644 // User not input new password, just return.
1645 //
1646 break;
1647 }
1648
1649 DeleteString (Statement->HiiValue.Value.string, gCurrentSelection->FormSet->HiiHandle);
1650 Statement->HiiValue.Value.string = UserInput->InputValue.Value.string;
1651 CopyMem (Statement->BufferValue, UserInput->InputValue.Buffer, (UINTN)UserInput->InputValue.BufferLen);
1652 ZeroMem (UserInput->InputValue.Buffer, (UINTN)UserInput->InputValue.BufferLen);
1653 FreePool (UserInput->InputValue.Buffer);
1654 //
1655 // Two password match, send it to Configuration Driver
1656 //
1657 if ((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) {
1658 PasswordCheck (NULL, UserInput->SelectedStatement, (CHAR16 *)Statement->BufferValue);
1659 //
1660 // Clean the value after saved it.
1661 //
1662 ZeroMem (Statement->BufferValue, (UINTN)UserInput->InputValue.BufferLen);
1663 HiiSetString (gCurrentSelection->FormSet->HiiHandle, Statement->HiiValue.Value.string, (CHAR16 *)Statement->BufferValue, NULL);
1664 } else {
1665 SetQuestionValue (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithHiiDriver);
1666 }
1667
1668 break;
1669
1670 case EFI_IFR_ORDERED_LIST_OP:
1671 CopyMem (Statement->BufferValue, UserInput->InputValue.Buffer, UserInput->InputValue.BufferLen);
1672 break;
1673
1674 default:
1675 CopyMem (&Statement->HiiValue, &UserInput->InputValue, sizeof (EFI_HII_VALUE));
1676 break;
1677 }
1678
1679 break;
1680 }
1681 }
1682
1683 return Status;
1684}
1685
1695 VOID
1696 )
1697{
1698 EFI_STATUS Status;
1699 USER_INPUT UserInput;
1700 FORM_ENTRY_INFO *CurrentMenu;
1701
1702 ZeroMem (&UserInput, sizeof (USER_INPUT));
1703
1704 //
1705 // Update the menu history data.
1706 //
1707 CurrentMenu = UiFindMenuList (gCurrentSelection->Handle, &gCurrentSelection->FormSetGuid, gCurrentSelection->FormId);
1708 if (CurrentMenu == NULL) {
1709 //
1710 // Current menu not found, add it to the menu tree
1711 //
1712 CurrentMenu = UiAddMenuList (
1713 gCurrentSelection->Handle,
1714 &gCurrentSelection->FormSetGuid,
1715 gCurrentSelection->FormId,
1716 gCurrentSelection->QuestionId
1717 );
1718 ASSERT (CurrentMenu != NULL);
1719 }
1720
1721 //
1722 // Back up the form view history data for this form.
1723 //
1724 UiCopyMenuList (&gCurrentSelection->Form->FormViewListHead, &mPrivateData.FormBrowserEx2.FormViewHistoryHead);
1725
1726 gCurrentSelection->CurrentMenu = CurrentMenu;
1727
1728 if (gCurrentSelection->QuestionId == 0) {
1729 //
1730 // Highlight not specified, fetch it from cached menu
1731 //
1732 gCurrentSelection->QuestionId = CurrentMenu->QuestionId;
1733 }
1734
1735 Status = EvaluateFormExpressions (gCurrentSelection->FormSet, gCurrentSelection->Form);
1736 if (EFI_ERROR (Status)) {
1737 return Status;
1738 }
1739
1741
1742 ASSERT (gDisplayFormData.BrowserStatus == BROWSER_SUCCESS);
1743 Status = mFormDisplay->FormDisplay (&gDisplayFormData, &UserInput);
1744 if (EFI_ERROR (Status)) {
1746 return Status;
1747 }
1748
1749 CheckConfigAccess (gCurrentSelection->FormSet);
1750
1751 Status = ProcessUserInput (&UserInput);
1753 return Status;
1754}
1755
1783EFIAPI
1785 IN UINT8 PackageType,
1786 IN CONST EFI_GUID *PackageGuid,
1788 IN EFI_HII_HANDLE Handle,
1790 )
1791{
1792 mHiiPackageListUpdated = TRUE;
1793
1794 return EFI_SUCCESS;
1795}
1796
1803BOOLEAN
1805 IN FORM_BROWSER_FORMSET *FormSet
1806 )
1807{
1808 LIST_ENTRY *Link;
1809 FORM_BROWSER_FORM *Form;
1810 BOOLEAN RetVal;
1811
1812 //
1813 // Not finished question initialization, return FALSE.
1814 //
1815 if (!FormSet->QuestionInited) {
1816 return FALSE;
1817 }
1818
1819 RetVal = FALSE;
1820
1821 Link = GetFirstNode (&FormSet->FormListHead);
1822 while (!IsNull (&FormSet->FormListHead, Link)) {
1823 Form = FORM_BROWSER_FORM_FROM_LINK (Link);
1824
1825 RetVal = IsNvUpdateRequiredForForm (Form);
1826 if (RetVal) {
1827 break;
1828 }
1829
1830 Link = GetNextNode (&FormSet->FormListHead, Link);
1831 }
1832
1833 return RetVal;
1834}
1835
1842BOOLEAN
1844 IN FORM_BROWSER_FORM *Form
1845 )
1846{
1847 LIST_ENTRY *Link;
1848 FORM_BROWSER_STATEMENT *Statement;
1849
1850 Link = GetFirstNode (&Form->StatementListHead);
1851 while (!IsNull (&Form->StatementListHead, Link)) {
1852 Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
1853
1854 if (Statement->ValueChanged) {
1855 return TRUE;
1856 }
1857
1858 Link = GetNextNode (&Form->StatementListHead, Link);
1859 }
1860
1861 return FALSE;
1862}
1863
1877BOOLEAN
1879 IN OUT UI_MENU_SELECTION *Selection,
1880 IN BROWSER_SETTING_SCOPE SettingLevel
1881 )
1882{
1883 FORM_ENTRY_INFO *CurrentMenu;
1884 FORM_ENTRY_INFO *ParentMenu;
1885 BROWSER_SETTING_SCOPE Scope;
1886
1887 CurrentMenu = Selection->CurrentMenu;
1888 Scope = FormSetLevel;
1889
1890 ParentMenu = UiFindParentMenu (CurrentMenu, SettingLevel);
1891 while (ParentMenu != NULL && !ValidateHiiHandle (ParentMenu->HiiHandle)) {
1892 ParentMenu = UiFindParentMenu (ParentMenu, SettingLevel);
1893 }
1894
1895 if (ParentMenu != NULL) {
1896 if (CompareGuid (&CurrentMenu->FormSetGuid, &ParentMenu->FormSetGuid)) {
1897 Scope = FormLevel;
1898 } else {
1899 Scope = FormSetLevel;
1900 }
1901 }
1902
1903 //
1904 // Form Level Check whether the data is changed.
1905 //
1906 if (((gBrowserSettingScope == FormLevel) && IsNvUpdateRequiredForForm (Selection->Form)) ||
1907 ((gBrowserSettingScope == FormSetLevel) && IsNvUpdateRequiredForFormSet (Selection->FormSet) && (Scope == FormSetLevel)))
1908 {
1909 if (!ProcessChangedData (Selection, gBrowserSettingScope)) {
1910 return FALSE;
1911 }
1912 }
1913
1914 if (ParentMenu != NULL) {
1915 //
1916 // ParentMenu is found. Then, go to it.
1917 //
1918 if (Scope == FormLevel) {
1919 Selection->Action = UI_ACTION_REFRESH_FORM;
1920 } else {
1921 Selection->Action = UI_ACTION_REFRESH_FORMSET;
1922 CopyMem (&Selection->FormSetGuid, &ParentMenu->FormSetGuid, sizeof (EFI_GUID));
1923 Selection->Handle = ParentMenu->HiiHandle;
1924 }
1925
1926 Selection->Statement = NULL;
1927
1928 Selection->FormId = ParentMenu->FormId;
1929 Selection->QuestionId = ParentMenu->QuestionId;
1930
1931 //
1932 // Clear highlight record for this menu
1933 //
1934 CurrentMenu->QuestionId = 0;
1935 return FALSE;
1936 }
1937
1938 //
1939 // Current in root page, exit the SendForm
1940 //
1941 Selection->Action = UI_ACTION_EXIT;
1942
1943 return TRUE;
1944}
1945
1955BOOLEAN
1957 IN EFI_HANDLE DriverHandle
1958 )
1959{
1960 EFI_STATUS Status;
1961
1962 Status = gBS->DisconnectController (DriverHandle, NULL, NULL);
1963 if (!EFI_ERROR (Status)) {
1964 Status = gBS->ConnectController (DriverHandle, NULL, NULL, TRUE);
1965 }
1966
1967 return Status == EFI_SUCCESS;
1968}
1969
1988 IN OUT UI_MENU_SELECTION *Selection,
1989 IN FORM_BROWSER_FORMSET *FormSet,
1990 IN FORM_BROWSER_FORM *Form,
1991 IN FORM_BROWSER_STATEMENT *Question,
1992 IN EFI_BROWSER_ACTION Action,
1993 IN BOOLEAN SkipSaveOrDiscard
1994 )
1995{
1996 EFI_STATUS Status;
1997 EFI_STATUS InternalStatus;
1998 EFI_BROWSER_ACTION_REQUEST ActionRequest;
1999 EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
2000 EFI_HII_VALUE *HiiValue;
2002 FORM_BROWSER_STATEMENT *Statement;
2003 BOOLEAN SubmitFormIsRequired;
2004 BOOLEAN DiscardFormIsRequired;
2005 BOOLEAN NeedExit;
2006 LIST_ENTRY *Link;
2007 BROWSER_SETTING_SCOPE SettingLevel;
2008 EFI_IFR_TYPE_VALUE BackUpValue;
2009 UINT8 *BackUpBuffer;
2010 CHAR16 *NewString;
2011
2012 ConfigAccess = FormSet->ConfigAccess;
2013 SubmitFormIsRequired = FALSE;
2014 SettingLevel = FormSetLevel;
2015 DiscardFormIsRequired = FALSE;
2016 NeedExit = FALSE;
2017 Status = EFI_SUCCESS;
2018 ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
2019 BackUpBuffer = NULL;
2020
2021 if (ConfigAccess == NULL) {
2022 return EFI_SUCCESS;
2023 }
2024
2025 Link = GetFirstNode (&Form->StatementListHead);
2026 while (!IsNull (&Form->StatementListHead, Link)) {
2027 Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
2028 Link = GetNextNode (&Form->StatementListHead, Link);
2029
2030 //
2031 // if Question != NULL, only process the question. Else, process all question in this form.
2032 //
2033 if ((Question != NULL) && (Statement != Question)) {
2034 continue;
2035 }
2036
2037 if ((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != EFI_IFR_FLAG_CALLBACK) {
2038 continue;
2039 }
2040
2041 //
2042 // Check whether Statement is disabled.
2043 //
2044 if (Statement->Expression != NULL) {
2045 if (EvaluateExpressionList (Statement->Expression, TRUE, FormSet, Form) == ExpressDisable) {
2046 continue;
2047 }
2048 }
2049
2050 HiiValue = &Statement->HiiValue;
2051 TypeValue = &HiiValue->Value;
2052 if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {
2053 //
2054 // For OrderedList, passing in the value buffer to Callback()
2055 //
2056 TypeValue = (EFI_IFR_TYPE_VALUE *)Statement->BufferValue;
2057 }
2058
2059 //
2060 // If EFI_BROWSER_ACTION_CHANGING type, back up the new question value.
2061 //
2062 if (Action == EFI_BROWSER_ACTION_CHANGING) {
2063 if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {
2064 BackUpBuffer = AllocateCopyPool (Statement->StorageWidth, Statement->BufferValue);
2065 ASSERT (BackUpBuffer != NULL);
2066 } else {
2067 CopyMem (&BackUpValue, &HiiValue->Value, sizeof (EFI_IFR_TYPE_VALUE));
2068 }
2069 }
2070
2071 ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
2072 Status = ConfigAccess->Callback (
2073 ConfigAccess,
2074 Action,
2075 Statement->QuestionId,
2076 HiiValue->Type,
2077 TypeValue,
2078 &ActionRequest
2079 );
2080 if (!EFI_ERROR (Status)) {
2081 //
2082 // Need to sync the value between Statement->HiiValue->Value and Statement->BufferValue
2083 //
2084 if (HiiValue->Type == EFI_IFR_TYPE_STRING) {
2085 NewString = GetToken (Statement->HiiValue.Value.string, FormSet->HiiHandle);
2086 ASSERT (NewString != NULL);
2087
2088 ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth);
2089 if (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth) {
2090 ZeroMem (Statement->BufferValue, Statement->StorageWidth);
2091 CopyMem (Statement->BufferValue, NewString, StrSize (NewString));
2092 } else {
2093 CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth);
2094 }
2095
2097 }
2098
2099 //
2100 // Only for EFI_BROWSER_ACTION_CHANGED need to handle this ActionRequest.
2101 //
2102 switch (Action) {
2103 case EFI_BROWSER_ACTION_CHANGED:
2104 switch (ActionRequest) {
2105 case EFI_BROWSER_ACTION_REQUEST_RESET:
2106 DiscardFormIsRequired = TRUE;
2107 gResetRequiredFormLevel = TRUE;
2108 gResetRequiredSystemLevel = TRUE;
2109 NeedExit = TRUE;
2110 break;
2111
2112 case EFI_BROWSER_ACTION_REQUEST_SUBMIT:
2113 SubmitFormIsRequired = TRUE;
2114 NeedExit = TRUE;
2115 break;
2116
2117 case EFI_BROWSER_ACTION_REQUEST_EXIT:
2118 DiscardFormIsRequired = TRUE;
2119 NeedExit = TRUE;
2120 break;
2121
2122 case EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT:
2123 SubmitFormIsRequired = TRUE;
2124 SettingLevel = FormLevel;
2125 NeedExit = TRUE;
2126 break;
2127
2128 case EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT:
2129 DiscardFormIsRequired = TRUE;
2130 SettingLevel = FormLevel;
2131 NeedExit = TRUE;
2132 break;
2133
2134 case EFI_BROWSER_ACTION_REQUEST_FORM_APPLY:
2135 SubmitFormIsRequired = TRUE;
2136 SettingLevel = FormLevel;
2137 break;
2138
2139 case EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD:
2140 DiscardFormIsRequired = TRUE;
2141 SettingLevel = FormLevel;
2142 break;
2143
2144 case EFI_BROWSER_ACTION_REQUEST_RECONNECT:
2145 gCallbackReconnect = TRUE;
2146 break;
2147
2148 case EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY:
2149 Status = SetQuestionValue (
2150 gCurrentSelection->FormSet,
2151 gCurrentSelection->Form,
2152 Statement,
2153 GetSetValueWithHiiDriver
2154 );
2155 break;
2156
2157 default:
2158 break;
2159 }
2160
2161 break;
2162
2163 case EFI_BROWSER_ACTION_CHANGING:
2164 //
2165 // Do the question validation.
2166 //
2167 Status = ValueChangedValidation (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement);
2168 if (!EFI_ERROR (Status)) {
2169 //
2170 // check whether the question value changed compared with edit buffer before updating edit buffer
2171 // if changed, set the ValueChanged flag to TRUE,in order to trig the CHANGED callback function
2172 //
2173 IsQuestionValueChanged (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer);
2174 //
2175 // According the spec, return value from call back of "changing" and
2176 // "retrieve" should update to the question's temp buffer.
2177 //
2178 SetQuestionValue (FormSet, Form, Statement, GetSetValueWithEditBuffer);
2179 }
2180
2181 break;
2182
2183 case EFI_BROWSER_ACTION_RETRIEVE:
2184 //
2185 // According the spec, return value from call back of "changing" and
2186 // "retrieve" should update to the question's temp buffer.
2187 //
2188 SetQuestionValue (FormSet, Form, Statement, GetSetValueWithEditBuffer);
2189 break;
2190
2191 default:
2192 break;
2193 }
2194 } else {
2195 //
2196 // If the callback returns EFI_UNSUPPORTED for EFI_BROWSER_ACTION_CHANGING,
2197 // then the browser will use the value passed to Callback() and ignore the
2198 // value returned by Callback().
2199 //
2200 if ((Action == EFI_BROWSER_ACTION_CHANGING) && (Status == EFI_UNSUPPORTED)) {
2201 if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {
2202 CopyMem (Statement->BufferValue, BackUpBuffer, Statement->StorageWidth);
2203 } else {
2204 CopyMem (&HiiValue->Value, &BackUpValue, sizeof (EFI_IFR_TYPE_VALUE));
2205 }
2206
2207 //
2208 // Do the question validation.
2209 //
2210 InternalStatus = ValueChangedValidation (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement);
2211 if (!EFI_ERROR (InternalStatus)) {
2212 //
2213 // check whether the question value changed compared with edit buffer before updating edit buffer
2214 // if changed, set the ValueChanged flag to TRUE,in order to trig the CHANGED callback function
2215 //
2216 IsQuestionValueChanged (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer);
2217 SetQuestionValue (FormSet, Form, Statement, GetSetValueWithEditBuffer);
2218 }
2219 }
2220
2221 //
2222 // According the spec, return fail from call back of "changing" and
2223 // "retrieve", should restore the question's value.
2224 //
2225 if ((Action == EFI_BROWSER_ACTION_CHANGING) && (Status != EFI_UNSUPPORTED)) {
2226 if (Statement->Storage != NULL) {
2227 GetQuestionValue (FormSet, Form, Statement, GetSetValueWithEditBuffer);
2228 } else if ((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) {
2229 ProcessCallBackFunction (Selection, FormSet, Form, Question, EFI_BROWSER_ACTION_RETRIEVE, FALSE);
2230 }
2231 }
2232
2233 if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
2234 GetQuestionValue (FormSet, Form, Statement, GetSetValueWithEditBuffer);
2235 }
2236
2237 if (Status == EFI_UNSUPPORTED) {
2238 //
2239 // If return EFI_UNSUPPORTED, also consider Hii driver suceess deal with it.
2240 //
2241 Status = EFI_SUCCESS;
2242 }
2243 }
2244
2245 if (BackUpBuffer != NULL) {
2246 FreePool (BackUpBuffer);
2247 }
2248
2249 //
2250 // If Question != NULL, means just process one question
2251 // and if code reach here means this question has finished
2252 // processing, so just break.
2253 //
2254 if (Question != NULL) {
2255 break;
2256 }
2257 }
2258
2259 if (gCallbackReconnect && (EFI_BROWSER_ACTION_CHANGED == Action)) {
2260 //
2261 // Confirm changes with user first.
2262 //
2263 if (IsNvUpdateRequiredForFormSet (FormSet)) {
2264 if (BROWSER_ACTION_DISCARD == PopupErrorMessage (BROWSER_RECONNECT_SAVE_CHANGES, NULL, NULL, NULL)) {
2265 gCallbackReconnect = FALSE;
2266 DiscardFormIsRequired = TRUE;
2267 } else {
2268 SubmitFormIsRequired = TRUE;
2269 }
2270 } else {
2271 PopupErrorMessage (BROWSER_RECONNECT_REQUIRED, NULL, NULL, NULL);
2272 }
2273
2274 //
2275 // Exit current formset before do the reconnect.
2276 //
2277 NeedExit = TRUE;
2278 SettingLevel = FormSetLevel;
2279 }
2280
2281 if (SubmitFormIsRequired && !SkipSaveOrDiscard) {
2282 SubmitForm (FormSet, Form, SettingLevel);
2283 }
2284
2285 if (DiscardFormIsRequired && !SkipSaveOrDiscard) {
2286 DiscardForm (FormSet, Form, SettingLevel);
2287 }
2288
2289 if (NeedExit) {
2290 FindNextMenu (Selection, SettingLevel);
2291 }
2292
2293 return Status;
2294}
2295
2311 IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess,
2312 IN FORM_BROWSER_STATEMENT *Statement,
2313 IN FORM_BROWSER_FORMSET *FormSet
2314 )
2315{
2316 EFI_STATUS Status;
2317 EFI_BROWSER_ACTION_REQUEST ActionRequest;
2318 EFI_HII_VALUE *HiiValue;
2320 CHAR16 *NewString;
2321
2322 Status = EFI_SUCCESS;
2323 ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
2324
2325 if (((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != EFI_IFR_FLAG_CALLBACK) || (ConfigAccess == NULL)) {
2326 return EFI_UNSUPPORTED;
2327 }
2328
2329 HiiValue = &Statement->HiiValue;
2330 TypeValue = &HiiValue->Value;
2331 if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {
2332 //
2333 // For OrderedList, passing in the value buffer to Callback()
2334 //
2335 TypeValue = (EFI_IFR_TYPE_VALUE *)Statement->BufferValue;
2336 }
2337
2338 ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
2339 Status = ConfigAccess->Callback (
2340 ConfigAccess,
2341 EFI_BROWSER_ACTION_RETRIEVE,
2342 Statement->QuestionId,
2343 HiiValue->Type,
2344 TypeValue,
2345 &ActionRequest
2346 );
2347 if (!EFI_ERROR (Status) && (HiiValue->Type == EFI_IFR_TYPE_STRING)) {
2348 NewString = GetToken (Statement->HiiValue.Value.string, FormSet->HiiHandle);
2349 ASSERT (NewString != NULL);
2350
2351 ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth);
2352 if (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth) {
2353 ZeroMem (Statement->BufferValue, Statement->StorageWidth);
2354 CopyMem (Statement->BufferValue, NewString, StrSize (NewString));
2355 } else {
2356 CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth);
2357 }
2358
2360 }
2361
2362 return Status;
2363}
2364
2380 IN OUT UI_MENU_SELECTION *Selection
2381 )
2382{
2383 EFI_STATUS Status;
2384 LIST_ENTRY *Link;
2385 EFI_HANDLE NotifyHandle;
2386 FORM_BROWSER_STATEMENT *Statement;
2387 EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
2388
2389 ConfigAccess = Selection->FormSet->ConfigAccess;
2390
2391 //
2392 // Register notify for Form package update
2393 //
2394 Status = mHiiDatabase->RegisterPackageNotify (
2395 mHiiDatabase,
2396 EFI_HII_PACKAGE_FORMS,
2397 NULL,
2399 EFI_HII_DATABASE_NOTIFY_REMOVE_PACK,
2400 &NotifyHandle
2401 );
2402 if (EFI_ERROR (Status)) {
2403 return Status;
2404 }
2405
2406 //
2407 // Initialize current settings of Questions in this FormSet
2408 //
2409 InitializeCurrentSetting (Selection->FormSet);
2410
2411 //
2412 // Initilize Action field.
2413 //
2414 Selection->Action = UI_ACTION_REFRESH_FORM;
2415
2416 //
2417 // Clean the mCurFakeQestId value is formset refreshed.
2418 //
2419 mCurFakeQestId = 0;
2420
2421 do {
2422 //
2423 // Reset Status to prevent the next break from returning incorrect error status.
2424 //
2425 Status = EFI_SUCCESS;
2426
2427 //
2428 // IFR is updated, force to reparse the IFR binary
2429 // This check is shared by EFI_BROWSER_ACTION_FORM_CLOSE and
2430 // EFI_BROWSER_ACTION_RETRIEVE, so code place here.
2431 //
2432 if (mHiiPackageListUpdated) {
2433 Selection->Action = UI_ACTION_REFRESH_FORMSET;
2434 mHiiPackageListUpdated = FALSE;
2435 break;
2436 }
2437
2438 //
2439 // Initialize Selection->Form
2440 //
2441 if (Selection->FormId == 0) {
2442 //
2443 // Zero FormId indicates display the first Form in a FormSet
2444 //
2445 Link = GetFirstNode (&Selection->FormSet->FormListHead);
2446
2447 Selection->Form = FORM_BROWSER_FORM_FROM_LINK (Link);
2448 Selection->FormId = Selection->Form->FormId;
2449 } else {
2450 Selection->Form = IdToForm (Selection->FormSet, Selection->FormId);
2451 }
2452
2453 if (Selection->Form == NULL) {
2454 //
2455 // No Form to display
2456 //
2457 Status = EFI_NOT_FOUND;
2458 goto Done;
2459 }
2460
2461 //
2462 // Check Form is suppressed.
2463 //
2464 if (Selection->Form->SuppressExpression != NULL) {
2465 if (EvaluateExpressionList (Selection->Form->SuppressExpression, TRUE, Selection->FormSet, Selection->Form) == ExpressSuppress) {
2466 //
2467 // Form is suppressed.
2468 //
2469 PopupErrorMessage (BROWSER_FORM_SUPPRESS, NULL, NULL, NULL);
2470 Status = EFI_NOT_FOUND;
2471 goto Done;
2472 }
2473 }
2474
2475 //
2476 // Before display new form, invoke ConfigAccess.Callback() with EFI_BROWSER_ACTION_FORM_OPEN
2477 // for each question with callback flag.
2478 // New form may be the first form, or the different form after another form close.
2479 //
2480 if (((Selection->Handle != mCurrentHiiHandle) ||
2481 (!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||
2482 (Selection->FormId != mCurrentFormId)))
2483 {
2484 //
2485 // Update Retrieve flag.
2486 //
2487 mFinishRetrieveCall = FALSE;
2488
2489 //
2490 // Keep current form information
2491 //
2492 mCurrentHiiHandle = Selection->Handle;
2493 CopyGuid (&mCurrentFormSetGuid, &Selection->FormSetGuid);
2494 mCurrentFormId = Selection->FormId;
2495
2496 if (ConfigAccess != NULL) {
2497 Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);
2498 if (EFI_ERROR (Status)) {
2499 goto Done;
2500 }
2501
2502 //
2503 // IFR is updated during callback of EFI_BROWSER_ACTION_FORM_OPEN, force to reparse the IFR binary
2504 //
2505 if (mHiiPackageListUpdated) {
2506 Selection->Action = UI_ACTION_REFRESH_FORMSET;
2507 mHiiPackageListUpdated = FALSE;
2508 break;
2509 }
2510 }
2511 }
2512
2513 //
2514 // Load Questions' Value for display
2515 //
2516 Status = LoadFormSetConfig (Selection, Selection->FormSet);
2517 if (EFI_ERROR (Status)) {
2518 goto Done;
2519 }
2520
2521 if (!mFinishRetrieveCall) {
2522 //
2523 // Finish call RETRIEVE callback for this form.
2524 //
2525 mFinishRetrieveCall = TRUE;
2526
2527 if (ConfigAccess != NULL) {
2528 Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_RETRIEVE, FALSE);
2529 if (EFI_ERROR (Status)) {
2530 goto Done;
2531 }
2532
2533 //
2534 // IFR is updated during callback of open form, force to reparse the IFR binary
2535 //
2536 if (mHiiPackageListUpdated) {
2537 Selection->Action = UI_ACTION_REFRESH_FORMSET;
2538 mHiiPackageListUpdated = FALSE;
2539 break;
2540 }
2541 }
2542 }
2543
2544 //
2545 // Display form
2546 //
2547 Status = DisplayForm ();
2548 if (EFI_ERROR (Status)) {
2549 goto Done;
2550 }
2551
2552 //
2553 // Check Selected Statement (if press ESC, Selection->Statement will be NULL)
2554 //
2555 Statement = Selection->Statement;
2556 if (Statement != NULL) {
2557 if ((ConfigAccess != NULL) &&
2558 ((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) &&
2559 (Statement->Operand != EFI_IFR_PASSWORD_OP))
2560 {
2561 Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);
2562 if (Statement->Operand == EFI_IFR_REF_OP) {
2563 //
2564 // Process dynamic update ref opcode.
2565 //
2566 if (!EFI_ERROR (Status)) {
2567 Status = ProcessGotoOpCode (Statement, Selection);
2568 }
2569
2570 //
2571 // Callback return error status or status return from process goto opcode.
2572 //
2573 if (EFI_ERROR (Status)) {
2574 //
2575 // Cross reference will not be taken, restore all essential field
2576 //
2577 Selection->Handle = mCurrentHiiHandle;
2578 CopyMem (&Selection->FormSetGuid, &mCurrentFormSetGuid, sizeof (EFI_GUID));
2579 Selection->FormId = mCurrentFormId;
2580 Selection->QuestionId = 0;
2581 Selection->Action = UI_ACTION_REFRESH_FORM;
2582 }
2583 }
2584
2585 if (!EFI_ERROR (Status) &&
2586 (Statement->Operand != EFI_IFR_REF_OP) &&
2587 ((Statement->Storage == NULL) || ((Statement->Storage != NULL) && Statement->ValueChanged)))
2588 {
2589 //
2590 // Only question value has been changed, browser will trig CHANGED callback.
2591 //
2592 ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGED, FALSE);
2593 //
2594 // check whether the question value changed compared with buffer value
2595 // if doesn't change ,set the ValueChanged flag to FALSE ,in order not to display the "configuration changed "information on the screen
2596 //
2597 IsQuestionValueChanged (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithBuffer);
2598 }
2599 } else {
2600 //
2601 // Do the question validation.
2602 //
2603 Status = ValueChangedValidation (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement);
2604 if (!EFI_ERROR (Status) && (Statement->Operand != EFI_IFR_PASSWORD_OP)) {
2605 SetQuestionValue (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer);
2606 //
2607 // Verify whether question value has checked, update the ValueChanged flag in Question.
2608 //
2609 IsQuestionValueChanged (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithBuffer);
2610 }
2611 }
2612
2613 //
2614 // If question has EFI_IFR_FLAG_RESET_REQUIRED/EFI_IFR_FLAG_RECONNECT_REQUIRED flag and without storage
2615 // and process question success till here, trig the gResetFlag/gFlagReconnect.
2616 //
2617 if ((Status == EFI_SUCCESS) &&
2618 (Statement->Storage == NULL))
2619 {
2620 if ((Statement->QuestionFlags & EFI_IFR_FLAG_RESET_REQUIRED) != 0) {
2621 gResetRequiredFormLevel = TRUE;
2622 gResetRequiredSystemLevel = TRUE;
2623 }
2624
2625 if ((Statement->QuestionFlags & EFI_IFR_FLAG_RECONNECT_REQUIRED) != 0) {
2626 gFlagReconnect = TRUE;
2627 }
2628 }
2629 }
2630
2631 //
2632 // Check whether Exit flag is TRUE.
2633 //
2634 if (gExitRequired) {
2635 switch (gBrowserSettingScope) {
2636 case SystemLevel:
2637 Selection->Action = UI_ACTION_EXIT;
2638 break;
2639
2640 case FormSetLevel:
2641 case FormLevel:
2642 FindNextMenu (Selection, gBrowserSettingScope);
2643 break;
2644
2645 default:
2646 break;
2647 }
2648
2649 gExitRequired = FALSE;
2650 }
2651
2652 //
2653 // Before exit the form, invoke ConfigAccess.Callback() with EFI_BROWSER_ACTION_FORM_CLOSE
2654 // for each question with callback flag.
2655 //
2656 if ((ConfigAccess != NULL) &&
2657 ((Selection->Action == UI_ACTION_EXIT) ||
2658 (Selection->Handle != mCurrentHiiHandle) ||
2659 (!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||
2660 (Selection->FormId != mCurrentFormId)))
2661 {
2662 Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_CLOSE, FALSE);
2663 if (EFI_ERROR (Status)) {
2664 goto Done;
2665 }
2666 }
2667 } while (Selection->Action == UI_ACTION_REFRESH_FORM);
2668
2669Done:
2670 //
2671 // Reset current form information to the initial setting when error happens or form exit.
2672 //
2673 if (EFI_ERROR (Status) || (Selection->Action == UI_ACTION_EXIT)) {
2674 mCurrentHiiHandle = NULL;
2675 CopyGuid (&mCurrentFormSetGuid, &gZeroGuid);
2676 mCurrentFormId = 0;
2677 }
2678
2679 //
2680 // Unregister notify for Form package update
2681 //
2682 mHiiDatabase->UnregisterPackageNotify (
2683 mHiiDatabase,
2684 NotifyHandle
2685 );
2686 return Status;
2687}
UINT64 UINTN
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
Definition: LinkedList.c:443
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
Definition: String.c:72
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
Definition: LinkedList.c:403
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
Definition: LinkedList.c:333
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
Definition: LinkedList.c:298
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
Definition: LinkedList.c:590
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
Definition: LinkedList.c:182
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
Definition: BaseLib.h:2904
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
Definition: LinkedList.c:259
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
Definition: MemLibGuid.c:73
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
Definition: MemLibGuid.c:39
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
BOOLEAN EFIAPI IsZeroGuid(IN CONST GUID *Guid)
Definition: MemLibGuid.c:156
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STATUS EvaluateExpression(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_EXPRESSION *Expression)
Definition: Expression.c:2536
EXPRESS_RESULT EvaluateExpressionList(IN FORM_EXPRESSION_LIST *ExpList, IN BOOLEAN Evaluate, IN FORM_BROWSER_FORMSET *FormSet OPTIONAL, IN FORM_BROWSER_FORM *Form OPTIONAL)
Definition: Expression.c:3732
FORM_BROWSER_FORM * IdToForm(IN FORM_BROWSER_FORMSET *FormSet, IN UINT16 FormId)
Definition: Expression.c:767
CHAR16 * GetToken(IN EFI_STRING_ID Token, IN EFI_HII_HANDLE HiiHandle)
Definition: FormDisplay.c:191
UINT64 GetArrayData(IN VOID *Array, IN UINT8 Type, IN UINTN Index)
EFI_HII_HANDLE *EFIAPI HiiGetHiiHandles(IN CONST EFI_GUID *PackageListGuid OPTIONAL)
Definition: HiiLib.c:286
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)
Definition: HiiString.c:52
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
UINTN EFI_HII_DATABASE_NOTIFY_TYPE
Definition: HiiDatabase.h:24
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_HII_HANDLE DevicePathToHiiHandle(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_GUID *FormsetGuid)
EFI_STATUS ProcessQuestionConfig(IN UI_MENU_SELECTION *Selection, IN FORM_BROWSER_STATEMENT *Question)
VOID FreeDisplayFormData(VOID)
Definition: Presentation.c:856
VOID FindParentFormSet(IN OUT UI_MENU_SELECTION *Selection)
BOOLEAN GetFormsetGuidFromHiiHandle(IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid)
FORM_BROWSER_STATEMENT * GetBrowserStatement(IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement)
Definition: Presentation.c:878
VOID EFIAPI RefreshEventNotifyForForm(IN EFI_EVENT Event, IN VOID *Context)
Definition: Presentation.c:216
BOOLEAN FindNextMenu(IN OUT UI_MENU_SELECTION *Selection, IN BROWSER_SETTING_SCOPE SettingLevel)
VOID UpdateStatementStatusForFormSet(IN FORM_BROWSER_FORMSET *FormSet)
Definition: Presentation.c:938
VOID InitializeDisplayFormData(VOID)
Definition: Presentation.c:727
BOOLEAN IsNvUpdateRequiredForForm(IN FORM_BROWSER_FORM *Form)
VOID FreeRefreshEvent(VOID)
Definition: Presentation.c:137
VOID UpdateStatementStatus(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN BROWSER_SETTING_SCOPE SettingScope)
Definition: Presentation.c:963
VOID EFIAPI RefreshEventNotifyForStatement(IN EFI_EVENT Event, IN VOID *Context)
Definition: Presentation.c:196
EFI_STATUS ProcessAction(IN UINT32 Action, IN UINT16 DefaultId)
VOID EFIAPI RefreshIntervalProcess(IN EFI_EVENT Event, IN VOID *Context)
Definition: Presentation.c:428
VOID CreateRefreshEventForForm(IN FORM_BROWSER_FORM *Form)
Definition: Presentation.c:267
EFI_STATUS ProcessRetrieveForQuestion(IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess, IN FORM_BROWSER_STATEMENT *Statement, IN FORM_BROWSER_FORMSET *FormSet)
VOID FreeHotkeyList(VOID)
Definition: Presentation.c:758
EFI_HII_HANDLE FormSetGuidToHiiHandle(EFI_GUID *ComparingGuid)
VOID CreateRefreshEventForStatement(IN FORM_BROWSER_STATEMENT *Statement)
Definition: Presentation.c:233
EFI_STATUS CheckConfigAccess(IN FORM_BROWSER_FORMSET *FormSet)
Definition: Presentation.c:34
VOID FreeStatementData(LIST_ENTRY *StatementList)
Definition: Presentation.c:812
BOOLEAN ReconnectController(IN EFI_HANDLE DriverHandle)
UINT32 ProcessQuestionExtraAttr(IN EFI_QUESTION_ID QuestionId)
Definition: Presentation.c:493
EFI_STATUS SetupBrowser(IN OUT UI_MENU_SELECTION *Selection)
VOID InitializeDisplayStatement(IN OUT FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement, IN FORM_BROWSER_STATEMENT *Statement)
Definition: Presentation.c:302
EFI_STATUS ProcessGotoOpCode(IN OUT FORM_BROWSER_STATEMENT *Statement, IN OUT UI_MENU_SELECTION *Selection)
EFI_STATUS EFIAPI FormUpdateNotify(IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, IN CONST EFI_HII_PACKAGE_HEADER *Package, IN EFI_HII_HANDLE Handle, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType)
VOID UpdateStatementStatusForForm(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
Definition: Presentation.c:907
VOID UpdateDataChangedFlag(VOID)
Definition: Presentation.c:673
EFI_STATUS ProcessCallBackFunction(IN OUT UI_MENU_SELECTION *Selection, IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN FORM_BROWSER_STATEMENT *Question, IN EFI_BROWSER_ACTION Action, IN BOOLEAN SkipSaveOrDiscard)
FORM_DISPLAY_ENGINE_STATEMENT * GetDisplayStatement(IN EFI_IFR_OP_HEADER *OpCode)
Definition: Presentation.c:111
VOID UpdateHotkeyList(VOID)
Definition: Presentation.c:457
VOID UpdateDisplayFormData(VOID)
Definition: Presentation.c:783
BOOLEAN ProcessChangedData(IN OUT UI_MENU_SELECTION *Selection, IN BROWSER_SETTING_SCOPE Scope)
EFI_STATUS DisplayForm(VOID)
VOID AddStatementToDisplayForm(VOID)
Definition: Presentation.c:531
BOOLEAN IsNvUpdateRequiredForFormSet(IN FORM_BROWSER_FORMSET *FormSet)
VOID UpdateStatement(IN OUT FORM_BROWSER_STATEMENT *Statement)
Definition: Presentation.c:163
EFI_STATUS EvaluateFormExpressions(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
Definition: Presentation.c:67
EFI_STATUS ProcessUserInput(IN USER_INPUT *UserInput)
EFI_STATUS SubmitForm(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN BROWSER_SETTING_SCOPE SettingScope)
Definition: Setup.c:3859
EFI_STATUS DiscardForm(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN BROWSER_SETTING_SCOPE SettingScope)
Definition: Setup.c:3208
FORM_ENTRY_INFO * UiFindMenuList(IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid, IN UINT16 FormId)
Definition: Setup.c:149
VOID InitializeCurrentSetting(IN OUT FORM_BROWSER_FORMSET *FormSet)
Definition: Setup.c:5784
FORM_ENTRY_INFO * UiFindParentMenu(IN FORM_ENTRY_INFO *CurrentMenu, IN BROWSER_SETTING_SCOPE SettingLevel)
Definition: Setup.c:213
EFI_STATUS LoadFormSetConfig(IN OUT UI_MENU_SELECTION *Selection, IN FORM_BROWSER_FORMSET *FormSet)
Definition: Setup.c:5181
EFI_STATUS ValueChangedValidation(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN FORM_BROWSER_STATEMENT *Question)
Definition: Setup.c:2364
BOOLEAN ValidateFormSet(FORM_BROWSER_FORMSET *FormSet)
Definition: Setup.c:2751
EFI_STATUS DeleteString(IN EFI_STRING_ID StringId, IN EFI_HII_HANDLE HiiHandle)
Definition: Setup.c:1004
EFI_STATUS GetQuestionDefault(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN FORM_BROWSER_STATEMENT *Question, IN UINT16 DefaultId)
Definition: Setup.c:4233
BOOLEAN ValidateHiiHandle(EFI_HII_HANDLE HiiHandle)
Definition: Setup.c:2712
EFI_STATUS ExtractDefault(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN UINT16 DefaultId, IN BROWSER_SETTING_SCOPE SettingScope, IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope, IN BROWSER_STORAGE *Storage OPTIONAL, IN BOOLEAN RetrieveValueFirst, IN BOOLEAN SkipGetAltCfg)
Definition: Setup.c:4844
EFI_STATUS EFIAPI PasswordCheck(IN FORM_DISPLAY_ENGINE_FORM *Form, IN FORM_DISPLAY_ENGINE_STATEMENT *Statement, IN EFI_STRING PasswordString OPTIONAL)
Definition: Setup.c:6292
UINT32 PopupErrorMessage(IN UINT32 BrowserStatus, IN EFI_HII_HANDLE HiiHandle, IN EFI_IFR_OP_HEADER *OpCode OPTIONAL, IN CHAR16 *ErrorString)
Definition: Setup.c:399
FORM_ENTRY_INFO * UiAddMenuList(IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid, IN UINT16 FormId, IN UINT16 QuestionId)
Definition: Setup.c:85
BOOLEAN IsQuestionValueChanged(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_BROWSER_STATEMENT *Question, IN GET_SET_QUESTION_VALUE_WITH GetValueFrom)
Definition: Setup.c:5011
EFI_STATUS SetQuestionValue(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_BROWSER_STATEMENT *Question, IN GET_SET_QUESTION_VALUE_WITH SetValueTo)
Definition: Setup.c:1913
EFI_STATUS GetQuestionValue(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_BROWSER_STATEMENT *Question, IN GET_SET_QUESTION_VALUE_WITH GetValueFrom)
Definition: Setup.c:1581
EFI_STRING_ID NewString(IN CHAR16 *String, IN EFI_HII_HANDLE HiiHandle)
Definition: Setup.c:981
VOID UiCopyMenuList(OUT LIST_ENTRY *NewMenuListHead, IN LIST_ENTRY *CurrentMenuListHead)
Definition: Setup.c:289
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
VOID * EFI_HII_HANDLE
VOID EFIAPI EfiEventEmptyFunction(IN EFI_EVENT Event, IN VOID *Context)
Definition: UefiLib.c:354
@ TimerPeriodic
Definition: UefiSpec.h:535
Definition: Base.h:213
EFI_STRING_ID string
EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION.