Add more comments for IntelFramework's header files.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Library / FrameworkIfrSupportLib.h
1 /** @file
2 Library class name: FrameworkIfrSupportLib
3
4 FrameworkIfrSupportLib is designed for produce IFR operation interface .
5 The IFR format follows framework specification.
6
7 Copyright (c) 2006, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17
18 #ifndef _IFRSUPPORTLIBRARY_H
19 #define _IFRSUPPORTLIBRARY_H
20
21 #define DEFAULT_FORM_BUFFER_SIZE 0xFFFF
22 #define DEFAULT_STRING_BUFFER_SIZE 0xFFFF
23
24 #pragma pack(1)
25 typedef struct {
26 CHAR16 *OptionString; // Passed in string to generate a token for in a truly dynamic form creation
27 STRING_REF StringToken; // This is used when creating a single op-code without generating a StringToken (have one already)
28 UINT16 Value;
29 UINT8 Flags;
30 UINT16 Key;
31 } IFR_OPTION;
32 #pragma pack()
33
34 EFI_STATUS
35 GetCurrentLanguage (
36 OUT CHAR16 *Lang
37 )
38 /*++
39
40 Routine Description:
41
42 Determine what is the current language setting
43
44 Arguments:
45
46 Lang - Pointer of system language
47
48 Returns:
49
50 Status code
51
52 --*/
53 ;
54
55 EFI_STATUS
56 AddString (
57 IN VOID *StringBuffer,
58 IN CHAR16 *Language,
59 IN CHAR16 *String,
60 IN OUT STRING_REF *StringToken
61 )
62 /*++
63
64 Routine Description:
65
66 Add a string to the incoming buffer and return the token and offset data
67
68 Arguments:
69
70 StringBuffer - The incoming buffer
71
72 Language - Currrent language
73
74 String - The string to be added
75
76 StringToken - The index where the string placed
77
78 Returns:
79
80 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
81
82 EFI_SUCCESS - String successfully added to the incoming buffer
83
84 --*/
85 ;
86
87 EFI_STATUS
88 AddOpCode (
89 IN VOID *FormBuffer,
90 IN OUT VOID *OpCodeData
91 )
92 /*++
93
94 Routine Description:
95
96 Add op-code data to the FormBuffer
97
98 Arguments:
99
100 FormBuffer - Form buffer to be inserted to
101
102 OpCodeData - Op-code data to be inserted
103
104 Returns:
105
106 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
107
108 EFI_SUCCESS - Op-code data successfully inserted
109
110 --*/
111 ;
112
113 EFI_STATUS
114 CreateFormSet (
115 IN CHAR16 *FormSetTitle,
116 IN EFI_GUID *Guid,
117 IN UINT8 Class,
118 IN UINT8 SubClass,
119 IN OUT VOID **FormBuffer,
120 IN OUT VOID **StringBuffer
121 )
122 /*++
123
124 Routine Description:
125
126 Create a formset
127
128 Arguments:
129
130 FormSetTitle - Title of formset
131
132 Guid - Guid of formset
133
134 Class - Class of formset
135
136 SubClass - Sub class of formset
137
138 FormBuffer - Pointer of the formset created
139
140 StringBuffer - Pointer of FormSetTitile string created
141
142 Returns:
143
144 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
145
146 EFI_SUCCESS - Formset successfully created
147
148 --*/
149 ;
150
151 EFI_STATUS
152 CreateForm (
153 IN CHAR16 *FormTitle,
154 IN UINT16 FormId,
155 IN OUT VOID *FormBuffer,
156 IN OUT VOID *StringBuffer
157 )
158 /*++
159
160 Routine Description:
161
162 Create a form
163
164 Arguments:
165
166 FormTitle - Title of the form
167
168 FormId - Id of the form
169
170 FormBuffer - Pointer of the form created
171
172 StringBuffer - Pointer of FormTitil string created
173
174 Returns:
175
176 EFI_SUCCESS - Form successfully created
177
178 --*/
179 ;
180
181 EFI_STATUS
182 CreateSubTitle (
183 IN CHAR16 *SubTitle,
184 IN OUT VOID *FormBuffer,
185 IN OUT VOID *StringBuffer
186 )
187 /*++
188
189 Routine Description:
190
191 Create a SubTitle
192
193 Arguments:
194
195 SubTitle - Sub title to be created
196
197 FormBuffer - Where this subtitle to add to
198
199 StringBuffer - String buffer created for subtitle
200
201 Returns:
202
203 EFI_SUCCESS - Subtitle successfully created
204
205 --*/
206 ;
207
208 EFI_STATUS
209 CreateText (
210 IN CHAR16 *String,
211 IN CHAR16 *String2,
212 IN CHAR16 *String3,
213 IN UINT8 Flags,
214 IN UINT16 Key,
215 IN OUT VOID *FormBuffer,
216 IN OUT VOID *StringBuffer
217 )
218 /*++
219
220 Routine Description:
221
222 Create a line of text
223
224 Arguments:
225
226 String - First string of the text
227
228 String2 - Second string of the text
229
230 String3 - Help string of the text
231
232 Flags - Flag of the text
233
234 Key - Key of the text
235
236 FormBuffer - The form where this text adds to
237
238 StringBuffer - String buffer created for String, String2 and String3
239
240 Returns:
241
242 EFI_SUCCESS - Text successfully created
243
244 --*/
245 ;
246
247 EFI_STATUS
248 CreateGoto (
249 IN UINT16 FormId,
250 IN CHAR16 *Prompt,
251 IN OUT VOID *FormBuffer,
252 IN OUT VOID *StringBuffer
253 )
254 /*++
255
256 Routine Description:
257
258 Create a hyperlink
259
260 Arguments:
261
262 FormId - Form ID of the hyperlink
263
264 Prompt - Prompt of the hyperlink
265
266 FormBuffer - The form where this hyperlink adds to
267
268 StringBuffer - String buffer created for Prompt
269
270 Returns:
271
272 EFI_SUCCESS - Hyperlink successfully created
273
274 --*/
275 ;
276
277 EFI_STATUS
278 CreateOneOf (
279 IN UINT16 QuestionId,
280 IN UINT8 DataWidth,
281 IN CHAR16 *Prompt,
282 IN CHAR16 *Help,
283 IN IFR_OPTION *OptionsList,
284 IN UINTN OptionCount,
285 IN OUT VOID *FormBuffer,
286 IN OUT VOID *StringBuffer
287 )
288 /*++
289
290 Routine Description:
291
292 Create a one-of question with a set of options to choose from. The
293 OptionsList is a pointer to a null-terminated list of option descriptions.
294
295 Arguments:
296
297 QuestionId - Question ID of the one-of box
298
299 DataWidth - DataWidth of the one-of box
300
301 Prompt - Prompt of the one-of box
302
303 Help - Help of the one-of box
304
305 OptionsList - Each string in it is an option of the one-of box
306
307 OptionCount - Option string count
308
309 FormBuffer - The form where this one-of box adds to
310
311 StringBuffer - String buffer created for Prompt, Help and Option strings
312
313 Returns:
314
315 EFI_DEVICE_ERROR - DataWidth > 2
316
317 EFI_SUCCESS - One-Of box successfully created.
318
319 --*/
320 ;
321
322 EFI_STATUS
323 CreateOrderedList (
324 IN UINT16 QuestionId,
325 IN UINT8 MaxEntries,
326 IN CHAR16 *Prompt,
327 IN CHAR16 *Help,
328 IN IFR_OPTION *OptionsList,
329 IN UINTN OptionCount,
330 IN OUT VOID *FormBuffer,
331 IN OUT VOID *StringBuffer
332 )
333 /*++
334
335 Routine Description:
336
337 Create a one-of question with a set of options to choose from. The
338 OptionsList is a pointer to a null-terminated list of option descriptions.
339
340 Arguments:
341
342 QuestionId - Question ID of the ordered list
343
344 MaxEntries - MaxEntries of the ordered list
345
346 Prompt - Prompt of the ordered list
347
348 Help - Help of the ordered list
349
350 OptionsList - Each string in it is an option of the ordered list
351
352 OptionCount - Option string count
353
354 FormBuffer - The form where this ordered list adds to
355
356 StringBuffer - String buffer created for Prompt, Help and Option strings
357
358 Returns:
359
360 EFI_SUCCESS - Ordered list successfully created.
361
362 --*/
363 ;
364
365 EFI_STATUS
366 CreateCheckBox (
367 IN UINT16 QuestionId,
368 IN UINT8 DataWidth,
369 IN CHAR16 *Prompt,
370 IN CHAR16 *Help,
371 IN UINT8 Flags,
372 IN OUT VOID *FormBuffer,
373 IN OUT VOID *StringBuffer
374 )
375 /*++
376
377 Routine Description:
378
379 Create a checkbox
380
381 Arguments:
382
383 QuestionId - Question ID of the check box
384
385 DataWidth - DataWidth of the check box
386
387 Prompt - Prompt of the check box
388
389 Help - Help of the check box
390
391 Flags - Flags of the check box
392
393 FormBuffer - The form where this check box adds to
394
395 StringBuffer - String buffer created for Prompt and Help.
396
397 Returns:
398
399 EFI_DEVICE_ERROR - DataWidth > 1
400
401 EFI_SUCCESS - Check box successfully created
402
403 --*/
404 ;
405
406 EFI_STATUS
407 CreateNumeric (
408 IN UINT16 QuestionId,
409 IN UINT8 DataWidth,
410 IN CHAR16 *Prompt,
411 IN CHAR16 *Help,
412 IN UINT16 Minimum,
413 IN UINT16 Maximum,
414 IN UINT16 Step,
415 IN UINT16 Default,
416 IN UINT8 Flags,
417 IN UINT16 Key,
418 IN OUT VOID *FormBuffer,
419 IN OUT VOID *StringBuffer
420 )
421 /*++
422
423 Routine Description:
424
425 Create a numeric
426
427 Arguments:
428
429 QuestionId - Question ID of the numeric
430
431 DataWidth - DataWidth of the numeric
432
433 Prompt - Prompt of the numeric
434
435 Help - Help of the numeric
436
437 Minimum - Minumun boundary of the numeric
438
439 Maximum - Maximum boundary of the numeric
440
441 Step - Step of the numeric
442
443 Default - Default value
444
445 Flags - Flags of the numeric
446
447 Key - Key of the numeric
448
449 FormBuffer - The form where this numeric adds to
450
451 StringBuffer - String buffer created for Prompt and Help.
452
453 Returns:
454
455 EFI_DEVICE_ERROR - DataWidth > 2
456
457 EFI_SUCCESS - Numeric is successfully created
458
459 --*/
460 ;
461
462 EFI_STATUS
463 CreateString (
464 IN UINT16 QuestionId,
465 IN UINT8 DataWidth,
466 IN CHAR16 *Prompt,
467 IN CHAR16 *Help,
468 IN UINT8 MinSize,
469 IN UINT8 MaxSize,
470 IN UINT8 Flags,
471 IN UINT16 Key,
472 IN OUT VOID *FormBuffer,
473 IN OUT VOID *StringBuffer
474 )
475 /*++
476
477 Routine Description:
478
479 Create a string
480
481 Arguments:
482
483 QuestionId - Question ID of the string
484
485 DataWidth - DataWidth of the string
486
487 Prompt - Prompt of the string
488
489 Help - Help of the string
490
491 MinSize - Min size boundary of the string
492
493 MaxSize - Max size boundary of the string
494
495 Flags - Flags of the string
496
497 Key - Key of the string
498
499 FormBuffer - The form where this string adds to
500
501 StringBuffer - String buffer created for Prompt and Help.
502
503 Returns:
504
505 EFI_SUCCESS - String successfully created.
506
507 --*/
508 ;
509
510 EFI_STATUS
511 ExtractDataFromHiiHandle (
512 IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,
513 IN OUT UINT16 *ImageLength,
514 OUT UINT8 *DefaultImage,
515 OUT EFI_GUID *Guid
516 )
517 /*++
518
519 Routine Description:
520
521 Extract information pertaining to the HiiHandle
522
523 Arguments:
524
525 HiiHandle - Hii handle
526
527 ImageLength - For input, length of DefaultImage;
528 For output, length of actually required
529
530 DefaultImage - Image buffer prepared by caller
531
532 Guid - Guid information about the form
533
534 Returns:
535
536 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
537
538 EFI_BUFFER_TOO_SMALL - DefualtImage has no enough ImageLength
539
540 EFI_SUCCESS - Successfully extract data from Hii database.
541
542
543 --*/
544 ;
545
546 FRAMEWORK_EFI_HII_HANDLE
547 FindHiiHandle (
548 IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL
549 IN EFI_GUID *Guid
550 )
551 /*++
552
553 Routine Description:
554 Finds HII handle for given pack GUID previously registered with the HII.
555
556 Arguments:
557 HiiProtocol - pointer to pointer to HII protocol interface.
558 If NULL, the interface will be found but not returned.
559 If it points to NULL, the interface will be found and
560 written back to the pointer that is pointed to.
561 Guid - The GUID of the pack that registered with the HII.
562
563 Returns:
564 Handle to the HII pack previously registered by the memory driver.
565
566 --*/
567 ;
568
569 EFI_STATUS
570 CreateSubTitleOpCode (
571 IN STRING_REF StringToken,
572 IN OUT VOID *FormBuffer
573 )
574 /*++
575
576 Routine Description:
577
578 Create a SubTitle opcode independent of string creation
579 This is used primarily by users who need to create just one particular valid op-code and the string
580 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
581 location to pre-defined forms in HII)
582
583 Arguments:
584
585 StringToken - StringToken of the subtitle
586
587 FormBuffer - Output of subtitle as a form
588
589 Returns:
590
591 EFI_SUCCESS - Subtitle created to be a form
592
593 --*/
594 ;
595
596 EFI_STATUS
597 CreateTextOpCode (
598 IN STRING_REF StringToken,
599 IN STRING_REF StringTokenTwo,
600 IN STRING_REF StringTokenThree,
601 IN UINT8 Flags,
602 IN UINT16 Key,
603 IN OUT VOID *FormBuffer
604 )
605 /*++
606
607 Routine Description:
608
609 Create a Text opcode independent of string creation
610 This is used primarily by users who need to create just one particular valid op-code and the string
611 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
612 location to pre-defined forms in HII)
613
614 Arguments:
615
616 StringToken - First string token of the text
617
618 StringTokenTwo - Second string token of the text
619
620 StringTokenThree - Help string token of the text
621
622 Flags - Flag of the text
623
624 Key - Key of the text
625
626 FormBuffer - Output of text as a form
627
628 Returns:
629
630 EFI_SUCCESS - Text created to be a form
631
632 --*/
633 ;
634
635 EFI_STATUS
636 CreateGotoOpCode (
637 IN UINT16 FormId,
638 IN STRING_REF StringToken,
639 IN STRING_REF StringTokenTwo,
640 IN UINT8 Flags,
641 IN UINT16 Key,
642 IN OUT VOID *FormBuffer
643 )
644 /*++
645
646 Routine Description:
647
648 Create a hyperlink opcode independent of string creation
649 This is used primarily by users who need to create just one particular valid op-code and the string
650 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
651 location to pre-defined forms in HII)
652
653 Arguments:
654
655 FormId - Form ID of the hyperlink
656
657 StringToken - Prompt string token of the hyperlink
658
659 StringTokenTwo - Help string token of the hyperlink
660
661 Flags - Flags of the hyperlink
662
663 Key - Key of the hyperlink
664
665 FormBuffer - Output of hyperlink as a form
666
667 Returns:
668
669 EFI_SUCCESS - Hyperlink created to be a form
670
671 --*/
672 ;
673
674 EFI_STATUS
675 CreateOneOfOpCode (
676 IN UINT16 QuestionId,
677 IN UINT8 DataWidth,
678 IN STRING_REF PromptToken,
679 IN STRING_REF HelpToken,
680 IN IFR_OPTION *OptionsList,
681 IN UINTN OptionCount,
682 IN OUT VOID *FormBuffer
683 )
684 /*++
685
686 Routine Description:
687
688 Create a one-of opcode with a set of option op-codes to choose from independent of string creation.
689 This is used primarily by users who need to create just one particular valid op-code and the string
690 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
691 location to pre-defined forms in HII)
692
693 OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
694 has been filled in since this routine will not generate StringToken values.
695
696 Arguments:
697
698 QuestionId - Question ID of the one-of box
699
700 DataWidth - DataWidth of the one-of box
701
702 PromptToken - Prompt string token of the one-of box
703
704 HelpToken - Help string token of the one-of box
705
706 OptionsList - Each string in it is an option of the one-of box
707
708 OptionCount - Option string count
709
710 FormBuffer - Output of One-Of box as a form
711
712 Returns:
713
714 EFI_SUCCESS - One-Of box created to be a form
715
716 EFI_DEVICE_ERROR - DataWidth > 2
717
718 --*/
719 ;
720
721 EFI_STATUS
722 CreateOrderedListOpCode (
723 IN UINT16 QuestionId,
724 IN UINT8 MaxEntries,
725 IN STRING_REF PromptToken,
726 IN STRING_REF HelpToken,
727 IN IFR_OPTION *OptionsList,
728 IN UINTN OptionCount,
729 IN OUT VOID *FormBuffer
730 )
731 /*++
732
733 Routine Description:
734
735 Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.
736 This is used primarily by users who need to create just one particular valid op-code and the string
737 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
738 location to pre-defined forms in HII)
739
740 OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
741 has been filled in since this routine will not generate StringToken values.
742
743 Arguments:
744
745 QuestionId - Question ID of the ordered list
746
747 MaxEntries - MaxEntries of the ordered list
748
749 PromptToken - Prompt string token of the ordered list
750
751 HelpToken - Help string token of the ordered list
752
753 OptionsList - Each string in it is an option of the ordered list
754
755 OptionCount - Option string count
756
757 FormBuffer - Output of ordered list as a form
758
759 Returns:
760
761 EFI_SUCCESS - Ordered list created to be a form
762
763 --*/
764 ;
765
766 EFI_STATUS
767 CreateCheckBoxOpCode (
768 IN UINT16 QuestionId,
769 IN UINT8 DataWidth,
770 IN STRING_REF PromptToken,
771 IN STRING_REF HelpToken,
772 IN UINT8 Flags,
773 IN UINT16 Key,
774 IN OUT VOID *FormBuffer
775 )
776 /*++
777
778 Routine Description:
779
780 Create a checkbox opcode independent of string creation
781 This is used primarily by users who need to create just one particular valid op-code and the string
782 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
783 location to pre-defined forms in HII)
784
785 Arguments:
786
787 QuestionId - Question ID of the check box
788
789 DataWidth - DataWidth of the check box
790
791 PromptToken - Prompt string token of the check box
792
793 HelpToken - Help string token of the check box
794
795 Flags - Flags of the check box
796
797 Key - Key of the check box
798
799 FormBuffer - Output of the check box as a form
800
801 Returns:
802
803 EFI_SUCCESS - Checkbox created to be a form
804
805 EFI_DEVICE_ERROR - DataWidth > 1
806
807 --*/
808 ;
809
810 EFI_STATUS
811 CreateNumericOpCode (
812 IN UINT16 QuestionId,
813 IN UINT8 DataWidth,
814 IN STRING_REF PromptToken,
815 IN STRING_REF HelpToken,
816 IN UINT16 Minimum,
817 IN UINT16 Maximum,
818 IN UINT16 Step,
819 IN UINT16 Default,
820 IN UINT8 Flags,
821 IN UINT16 Key,
822 IN OUT VOID *FormBuffer
823 )
824 /*++
825
826 Routine Description:
827
828 Create a numeric opcode independent of string creation
829 This is used primarily by users who need to create just one particular valid op-code and the string
830 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
831 location to pre-defined forms in HII)
832
833 Arguments:
834
835 QuestionId - Question ID of the numeric
836
837 DataWidth - DataWidth of the numeric
838
839 PromptToken - Prompt string token of the numeric
840
841 HelpToken - Help string token of the numeric
842
843 Minimum - Minumun boundary of the numeric
844
845 Maximum - Maximum boundary of the numeric
846
847 Step - Step of the numeric
848
849 Default - Default value of the numeric
850
851 Flags - Flags of the numeric
852
853 Key - Key of the numeric
854
855 FormBuffer - Output of the numeric as a form
856
857 Returns:
858
859 EFI_SUCCESS - The numeric created to be a form.
860
861 EFI_DEVICE_ERROR - DataWidth > 2
862
863 --*/
864 ;
865
866 EFI_STATUS
867 CreateStringOpCode (
868 IN UINT16 QuestionId,
869 IN UINT8 DataWidth,
870 IN STRING_REF PromptToken,
871 IN STRING_REF HelpToken,
872 IN UINT8 MinSize,
873 IN UINT8 MaxSize,
874 IN UINT8 Flags,
875 IN UINT16 Key,
876 IN OUT VOID *FormBuffer
877 )
878 /*++
879
880 Routine Description:
881
882 Create a numeric opcode independent of string creation
883 This is used primarily by users who need to create just one particular valid op-code and the string
884 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
885 location to pre-defined forms in HII)
886
887 Arguments:
888
889 QuestionId - Question ID of the string
890
891 DataWidth - DataWidth of the string
892
893 PromptToken - Prompt token of the string
894
895 HelpToken - Help token of the string
896
897 MinSize - Min size boundary of the string
898
899 MaxSize - Max size boundary of the string
900
901 Flags - Flags of the string
902
903 Key - Key of the string
904
905 FormBuffer - Output of the string as a form
906
907 Returns:
908
909 EFI_SUCCESS - String created to be a form.
910
911 --*/
912 ;
913
914 EFI_STATUS
915 ValidateDataFromHiiHandle (
916 IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,
917 OUT BOOLEAN *Results
918 )
919 /*++
920
921 Routine Description:
922
923 Validate that the data associated with the HiiHandle in NVRAM is within
924 the reasonable parameters for that FormSet. Values for strings and passwords
925 are not verified due to their not having the equivalent of valid range settings.
926
927 Arguments:
928
929 HiiHandle - Handle of the HII database entry to query
930
931 Results - If return Status is EFI_SUCCESS, Results provides valid data
932 TRUE = NVRAM Data is within parameters
933 FALSE = NVRAM Data is NOT within parameters
934
935 Returns:
936
937 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
938
939 EFI_SUCCESS - Data successfully validated
940 --*/
941 ;
942
943 EFI_STATUS
944 CreateBannerOpCode (
945 IN UINT16 Title,
946 IN UINT16 LineNumber,
947 IN UINT8 Alignment,
948 IN OUT VOID *FormBuffer
949 )
950 /*++
951
952 Routine Description:
953
954 Create a banner opcode. This is primarily used by the FrontPage implementation from BDS.
955
956 Arguments:
957
958 Title - Title of the banner
959
960 LineNumber - LineNumber of the banner
961
962 Alignment - Alignment of the banner
963
964 FormBuffer - Output of banner as a form
965
966 Returns:
967
968 EFI_SUCCESS - Banner created to be a form.
969
970 --*/
971 ;
972
973 VOID
974 EfiLibHiiVariablePackGetMap (
975 IN EFI_HII_VARIABLE_PACK *Pack,
976 OUT CHAR16 **Name, OPTIONAL
977 OUT EFI_GUID **Guid, OPTIONAL
978 OUT UINT16 *Id, OPTIONAL
979 OUT VOID **Var, OPTIONAL
980 OUT UINTN *Size OPTIONAL
981 )
982 /*++
983
984 Routine Description:
985
986 Extracts a variable form a Pack.
987
988 Arguments:
989
990 Pack - List of variables
991 Name - Name of the variable/map
992 Guid - GUID of the variable/map
993 Var - Pointer to the variable/map
994 Size - Size of the variable/map in bytes
995
996 Returns:
997
998 VOID.
999
1000 --*/
1001 ;
1002
1003 UINTN
1004 EfiLibHiiVariablePackListGetMapCnt (
1005 IN EFI_HII_VARIABLE_PACK_LIST *List
1006 )
1007 /*++
1008
1009 Routine Description:
1010
1011 Finds a count of the variables/maps in the List.
1012
1013 Arguments:
1014
1015 List - List of variables
1016
1017 Returns:
1018
1019 Number of Map in the variable pack list.
1020
1021 --*/
1022 ;
1023
1024 typedef VOID (EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK) (
1025 IN CHAR16 *Name,
1026 IN EFI_GUID *Guid,
1027 IN UINT16 Id,
1028 IN VOID *Var,
1029 IN UINTN Size
1030 )
1031 /*++
1032
1033 Routine Description:
1034
1035 type definition for the callback to be
1036 used with EfiLibHiiVariablePackListForEachVar().
1037
1038 Arguments:
1039
1040 Id - Variable/Map ID
1041 Name - Name of the variable/map
1042 Guid - GUID of the variable/map
1043 Var - Pointer to the variable/map
1044 Size - Size of the variable/map in bytes
1045
1046 Returns:
1047
1048 VOID
1049
1050 --*/
1051 ;
1052
1053 VOID
1054 EfiLibHiiVariablePackListForEachVar (
1055 IN EFI_HII_VARIABLE_PACK_LIST *List,
1056 IN EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK *Callback
1057 )
1058 /*++
1059
1060 Routine Description:
1061
1062 Will iterate all variable/maps as appearing
1063 in List and for each, it will call the Callback.
1064
1065 Arguments:
1066
1067 List - List of variables
1068 Callback - Routine to be called for each iterated variable.
1069
1070 Returns:
1071
1072 VOID
1073
1074 --*/
1075 ;
1076
1077 EFI_STATUS
1078 EfiLibHiiVariablePackListGetMapByIdx (
1079 IN UINTN Idx,
1080 IN EFI_HII_VARIABLE_PACK_LIST *List,
1081 OUT CHAR16 **Name, OPTIONAL
1082 OUT EFI_GUID **Guid, OPTIONAL
1083 OUT UINT16 *Id, OPTIONAL
1084 OUT VOID **Var,
1085 OUT UINTN *Size
1086 )
1087 /*++
1088
1089 Routine Description:
1090
1091 Finds a variable form List given
1092 the order number as appears in the List.
1093
1094 Arguments:
1095
1096 Idx - The index of the variable/map to retrieve
1097 List - List of variables
1098 Name - Name of the variable/map
1099 Guid - GUID of the variable/map
1100 Var - Pointer to the variable/map
1101 Size - Size of the variable/map in bytes
1102
1103 Returns:
1104
1105 EFI_SUCCESS - Variable is found, OUT parameters are valid
1106 EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid
1107
1108 --*/
1109 ;
1110
1111 EFI_STATUS
1112 EfiLibHiiVariablePackListGetMapById (
1113 IN UINT16 Id,
1114 IN EFI_HII_VARIABLE_PACK_LIST *List,
1115 OUT CHAR16 **Name, OPTIONAL
1116 OUT EFI_GUID **Guid, OPTIONAL
1117 OUT VOID **Var,
1118 OUT UINTN *Size
1119 )
1120 /*++
1121
1122 Routine Description:
1123
1124 Finds a variable form List given the
1125 order number as appears in the List.
1126
1127 Arguments:
1128
1129 Id - The ID of the variable/map to retrieve
1130 List - List of variables
1131 Name - Name of the variable/map
1132 Guid - GUID of the variable/map
1133 Var - Pointer to the variable/map
1134 Size - Size of the variable/map in bytes
1135
1136 Returns:
1137
1138 EFI_SUCCESS - Variable is found, OUT parameters are valid
1139 EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid
1140
1141 --*/
1142 ;
1143
1144 EFI_STATUS
1145 EfiLibHiiVariablePackListGetMap (
1146 IN EFI_HII_VARIABLE_PACK_LIST *List,
1147 IN CHAR16 *Name,
1148 IN EFI_GUID *Guid,
1149 OUT UINT16 *Id,
1150 OUT VOID **Var,
1151 OUT UINTN *Size
1152 )
1153 /*++
1154
1155 Routine Description:
1156
1157 Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.
1158
1159 Arguments:
1160
1161 List - List of variables
1162 Name - Name of the variable/map to be found
1163 Guid - GUID of the variable/map to be found
1164 Var - Pointer to the variable/map found
1165 Size - Size of the variable/map in bytes found
1166
1167 Returns:
1168
1169 EFI_SUCCESS - variable is found, OUT parameters are valid
1170 EFI_NOT_FOUND - variable is not found, OUT parameters are not valid
1171
1172 --*/
1173 ;
1174
1175 EFI_STATUS
1176 EfiLibHiiVariableRetrieveFromNv (
1177 IN CHAR16 *Name,
1178 IN EFI_GUID *Guid,
1179 IN UINTN Size,
1180 OUT VOID **Var
1181 )
1182 /*++
1183
1184 Routine Description:
1185 Finds out if a variable of specific Name/Guid/Size exists in NV.
1186 If it does, it will retrieve it into the Var.
1187
1188 Arguments:
1189 Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
1190 Var - Variable will be retrieved into buffer pointed by this pointer.
1191 If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.
1192 Returns:
1193 EFI_SUCCESS - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.
1194 EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
1195 EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
1196
1197 --*/
1198 ;
1199
1200 ////
1201 //// Variable override support.
1202 ////
1203
1204 EFI_STATUS
1205 EfiLibHiiVariableOverrideIfSuffix (
1206 IN CHAR16 *Suffix,
1207 IN CHAR16 *Name,
1208 IN EFI_GUID *Guid,
1209 IN UINTN Size,
1210 OUT VOID *Var
1211 )
1212 /*++
1213
1214 Routine Description:
1215 Overrrides the variable with NV data if found.
1216 But it only does it if the Name ends with specified Suffix.
1217 For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",
1218 the Suffix matches the end of Name, so the variable will be loaded from NV
1219 provided the variable exists and the GUID and Size matches.
1220
1221 Arguments:
1222 Suffix - Suffix the Name should end with.
1223 Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
1224 Var - Variable will be retrieved into this buffer.
1225 Caller is responsible for providing storage of exactly Size size in bytes.
1226 Returns:
1227 EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.
1228 EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.
1229 EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
1230 EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
1231
1232 --*/
1233 ;
1234
1235 EFI_STATUS
1236 EfiLibHiiVariableOverrideBySuffix (
1237 IN CHAR16 *Suffix,
1238 IN CHAR16 *Name,
1239 IN EFI_GUID *Guid,
1240 IN UINTN Size,
1241 OUT VOID *Var
1242 )
1243 /*++
1244
1245 Routine Description:
1246 Overrrides the variable with NV data if found.
1247 But it only does it if the NV contains the same variable with Name is appended with Suffix.
1248 For example, if Suffix="MyOverride" and the Name="XyzSetup",
1249 the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"
1250 will be loaded from NV provided the variable exists and the GUID and Size matches.
1251
1252 Arguments:
1253 Suffix - Suffix the variable will be appended with.
1254 Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
1255 Var - Variable will be retrieved into this buffer.
1256 Caller is responsible for providing storage of exactly Size size in bytes.
1257
1258 Returns:
1259 EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.
1260 EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
1261 EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
1262
1263 --*/
1264 ;
1265
1266 #endif