]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrLibrary.h
Remove unrecognized chars in comment in source file.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / UefiEfiIfrSupportLib / UefiIfrLibrary.h
1 /*++
2
3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 UefiIfrLibrary.h
15
16 Abstract:
17
18 The file contain all library function for Ifr Operations.
19
20 --*/
21
22 #ifndef _IFRLIBRARY_H
23 #define _IFRLIBRARY_H
24
25 #include "Tiano.h"
26 #include "EfiDriverLib.h"
27 #include "TianoHii.h"
28
29 #include EFI_PROTOCOL_DEFINITION (HiiFont)
30 #include EFI_PROTOCOL_DEFINITION (HiiImage)
31 #include EFI_PROTOCOL_DEFINITION (HiiString)
32 #include EFI_PROTOCOL_DEFINITION (HiiDatabase)
33 #include EFI_PROTOCOL_DEFINITION (HiiConfigRouting)
34 #include EFI_PROTOCOL_DEFINITION (HiiConfigAccess)
35 #include EFI_PROTOCOL_DEFINITION (FormBrowser2)
36 #include EFI_PROTOCOL_DEFINITION (SimpleTextOut)
37
38 #include EFI_GUID_DEFINITION (GlobalVariable)
39
40 #define IFR_LIB_DEFAULT_STRING_SIZE 0x200
41
42 //
43 // The architectural variable "Lang" and "LangCodes" are deprecated in UEFI
44 // specification. While, UEFI specification also states that these deprecated
45 // variables may be provided for backwards compatibility.
46 // If "LANG_SUPPORT" is defined, "Lang" and "LangCodes" will be produced;
47 // If "LANG_SUPPORT" is undefined, "Lang" and "LangCodes" will not be produced.
48 //
49 #define LANG_SUPPORT
50
51 #define EFI_LANGUAGE_VARIABLE L"Lang"
52 #define EFI_LANGUAGE_CODES_VARIABLE L"LangCodes"
53
54 #define UEFI_LANGUAGE_VARIABLE L"PlatformLang"
55 #define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes"
56
57 //
58 // Limited buffer size recommended by RFC4646 (4.3. Length Considerations)
59 // (42 characters plus a NULL terminator)
60 //
61 #define RFC_3066_ENTRY_SIZE (42 + 1)
62 #define ISO_639_2_ENTRY_SIZE 3
63
64 #define INVALID_VARSTORE_ID 0
65
66 #define QUESTION_FLAGS (EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY)
67 #define QUESTION_FLAGS_MASK (~QUESTION_FLAGS)
68
69 extern EFI_GUID mIfrVendorGuid;
70 extern EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;
71 extern EFI_HII_STRING_PROTOCOL *gIfrLibHiiString;
72
73 #pragma pack(1)
74 typedef struct {
75 EFI_STRING_ID StringToken;
76 EFI_IFR_TYPE_VALUE Value;
77 UINT8 Flags;
78 } IFR_OPTION;
79 #pragma pack()
80
81 typedef struct {
82 VENDOR_DEVICE_PATH VendorDevicePath;
83 UINT32 MonotonicCount;
84 } HII_VENDOR_DEVICE_PATH_NODE;
85
86 typedef struct {
87 HII_VENDOR_DEVICE_PATH_NODE Node;
88 EFI_DEVICE_PATH_PROTOCOL End;
89 } HII_VENDOR_DEVICE_PATH;
90
91 typedef struct {
92 //
93 // Buffer size allocated for Data.
94 //
95 UINT32 BufferSize;
96
97 //
98 // Offset in Data to append the newly created opcode binary.
99 // It will be adjusted automatically in Create***OpCode(), and should be
100 // initialized to 0 before invocation of a serial of Create***OpCode()
101 //
102 UINT32 Offset;
103
104 //
105 // The destination buffer for created op-codes
106 //
107 UINT8 *Data;
108 } EFI_HII_UPDATE_DATA;
109
110 VOID
111 LocateHiiProtocols (
112 VOID
113 )
114 /*++
115
116 Routine Description:
117 This function locate Hii relative protocols for later usage.
118
119 Arguments:
120 None.
121
122 Returns:
123 None.
124
125 --*/
126 ;
127
128 //
129 // Exported Library functions
130 //
131 EFI_STATUS
132 CreateEndOpCode (
133 IN OUT EFI_HII_UPDATE_DATA *Data
134 )
135 /*++
136
137 Routine Description:
138 Create EFI_IFR_END_OP opcode.
139
140 Arguments:
141 Data - Destination for the created opcode binary
142
143 Returns:
144 EFI_SUCCESS - Opcode create success
145
146 --*/
147 ;
148
149 EFI_STATUS
150 CreateDefaultOpCode (
151 IN EFI_IFR_TYPE_VALUE *Value,
152 IN UINT8 Type,
153 IN OUT EFI_HII_UPDATE_DATA *Data
154 )
155 /*++
156
157 Routine Description:
158 Create EFI_IFR_DEFAULT_OP opcode.
159
160 Arguments:
161 Value - Value for the default
162 Type - Type for the default
163 Data - Destination for the created opcode binary
164
165 Returns:
166 EFI_SUCCESS - Opcode create success
167
168 --*/
169 ;
170
171 EFI_STATUS
172 CreateActionOpCode (
173 IN EFI_QUESTION_ID QuestionId,
174 IN EFI_STRING_ID Prompt,
175 IN EFI_STRING_ID Help,
176 IN UINT8 QuestionFlags,
177 IN EFI_STRING_ID QuestionConfig,
178 IN OUT EFI_HII_UPDATE_DATA *Data
179 )
180 /*++
181
182 Routine Description:
183 Create EFI_IFR_ACTION_OP opcode.
184
185 Arguments:
186 QuestionId - Question ID
187 Prompt - String ID for Prompt
188 Help - String ID for Help
189 QuestionFlags - Flags in Question Header
190 QuestionConfig - String ID for configuration
191 Data - Destination for the created opcode binary
192
193 Returns:
194 EFI_SUCCESS - Opcode create success
195
196 --*/
197 ;
198
199 EFI_STATUS
200 CreateSubTitleOpCode (
201 IN EFI_STRING_ID Prompt,
202 IN EFI_STRING_ID Help,
203 IN UINT8 Flags,
204 IN UINT8 Scope,
205 IN OUT EFI_HII_UPDATE_DATA *Data
206 )
207 /*++
208
209 Routine Description:
210 Create EFI_IFR_SUBTITLE_OP opcode.
211
212 Arguments:
213 Prompt - String ID for Prompt
214 Help - String ID for Help
215 Flags - Subtitle opcode flags
216 Scope - Subtitle Scope bit
217 Data - Destination for the created opcode binary
218
219 Returns:
220 EFI_SUCCESS - Opcode create success
221
222 --*/
223 ;
224
225 EFI_STATUS
226 CreateTextOpCode (
227 IN EFI_STRING_ID Prompt,
228 IN EFI_STRING_ID Help,
229 IN EFI_STRING_ID TextTwo,
230 IN OUT EFI_HII_UPDATE_DATA *Data
231 )
232 /*++
233
234 Routine Description:
235 Create EFI_IFR_TEXT_OP opcode.
236
237 Arguments:
238 Prompt - String ID for Prompt
239 Help - String ID for Help
240 TextTwo - String ID for text two
241 Data - Destination for the created opcode binary
242
243 Returns:
244 EFI_SUCCESS - Opcode create success
245
246 --*/
247 ;
248
249 EFI_STATUS
250 CreateGotoOpCode (
251 IN EFI_FORM_ID FormId,
252 IN EFI_STRING_ID Prompt,
253 IN EFI_STRING_ID Help,
254 IN UINT8 QuestionFlags,
255 IN EFI_QUESTION_ID QuestionId,
256 IN OUT EFI_HII_UPDATE_DATA *Data
257 )
258 /*++
259
260 Routine Description:
261 Create EFI_IFR_REF_OP opcode.
262
263 Arguments:
264 FormId - Destination Form ID
265 Prompt - String ID for Prompt
266 Help - String ID for Help
267 QuestionFlags - Flags in Question Header
268 QuestionId - Question ID
269 Data - Destination for the created opcode binary
270
271 Returns:
272 EFI_SUCCESS - Opcode create success
273
274 --*/
275 ;
276
277 EFI_STATUS
278 CreateOneOfOptionOpCode (
279 IN UINTN OptionCount,
280 IN IFR_OPTION *OptionsList,
281 IN UINT8 Type,
282 IN OUT EFI_HII_UPDATE_DATA *Data
283 )
284 ;
285
286 EFI_STATUS
287 CreateOneOfOpCode (
288 IN EFI_QUESTION_ID QuestionId,
289 IN EFI_VARSTORE_ID VarStoreId,
290 IN UINT16 VarOffset,
291 IN EFI_STRING_ID Prompt,
292 IN EFI_STRING_ID Help,
293 IN UINT8 QuestionFlags,
294 IN UINT8 OneOfFlags,
295 IN IFR_OPTION *OptionsList,
296 IN UINTN OptionCount,
297 IN OUT EFI_HII_UPDATE_DATA *Data
298 )
299 /*++
300
301 Routine Description:
302 Create EFI_IFR_ONE_OF_OP opcode.
303
304 Arguments:
305 QuestionId - Question ID
306 VarStoreId - Storage ID
307 VarOffset - Offset in Storage
308 Prompt - String ID for Prompt
309 Help - String ID for Help
310 QuestionFlags - Flags in Question Header
311 OneOfFlags - Flags for oneof opcode
312 OptionsList - List of options
313 OptionCount - Number of options in option list
314 Data - Destination for the created opcode binary
315
316 Returns:
317 EFI_SUCCESS - Opcode create success
318
319 --*/
320 ;
321
322 EFI_STATUS
323 CreateOrderedListOpCode (
324 IN EFI_QUESTION_ID QuestionId,
325 IN EFI_VARSTORE_ID VarStoreId,
326 IN UINT16 VarOffset,
327 IN EFI_STRING_ID Prompt,
328 IN EFI_STRING_ID Help,
329 IN UINT8 QuestionFlags,
330 IN UINT8 Flags,
331 IN UINT8 DataType,
332 IN UINT8 MaxContainers,
333 IN IFR_OPTION *OptionsList,
334 IN UINTN OptionCount,
335 IN OUT EFI_HII_UPDATE_DATA *Data
336 )
337 /*++
338
339 Routine Description:
340 Create EFI_IFR_ORDERED_LIST_OP opcode.
341
342 Arguments:
343 QuestionId - Question ID
344 VarStoreId - Storage ID
345 VarOffset - Offset in Storage
346 Prompt - String ID for Prompt
347 Help - String ID for Help
348 QuestionFlags - Flags in Question Header
349 Flags - Flags for ordered list opcode
350 DataType - Type for option value
351 MaxContainers - Maximum count for options in this ordered list
352 OptionsList - List of options
353 OptionCount - Number of options in option list
354 Data - Destination for the created opcode binary
355
356 Returns:
357 EFI_SUCCESS - Opcode create success
358
359 --*/
360 ;
361
362 EFI_STATUS
363 CreateCheckBoxOpCode (
364 IN EFI_QUESTION_ID QuestionId,
365 IN EFI_VARSTORE_ID VarStoreId,
366 IN UINT16 VarOffset,
367 IN EFI_STRING_ID Prompt,
368 IN EFI_STRING_ID Help,
369 IN UINT8 QuestionFlags,
370 IN UINT8 CheckBoxFlags,
371 IN OUT EFI_HII_UPDATE_DATA *Data
372 )
373 /*++
374
375 Routine Description:
376 Create EFI_IFR_CHECKBOX_OP opcode.
377
378 Arguments:
379 QuestionId - Question ID
380 VarStoreId - Storage ID
381 VarOffset - Offset in Storage
382 Prompt - String ID for Prompt
383 Help - String ID for Help
384 QuestionFlags - Flags in Question Header
385 CheckBoxFlags - Flags for checkbox opcode
386 Data - Destination for the created opcode binary
387
388 Returns:
389 EFI_SUCCESS - Opcode create success
390
391 --*/
392 ;
393
394 EFI_STATUS
395 CreateNumericOpCode (
396 IN EFI_QUESTION_ID QuestionId,
397 IN EFI_VARSTORE_ID VarStoreId,
398 IN UINT16 VarOffset,
399 IN EFI_STRING_ID Prompt,
400 IN EFI_STRING_ID Help,
401 IN UINT8 QuestionFlags,
402 IN UINT8 NumericFlags,
403 IN UINT64 Minimum,
404 IN UINT64 Maximum,
405 IN UINT64 Step,
406 IN UINT64 Default,
407 IN OUT EFI_HII_UPDATE_DATA *Data
408 )
409 /*++
410
411 Routine Description:
412 Create EFI_IFR_NUMERIC_OP opcode.
413
414 Arguments:
415 QuestionId - Question ID
416 VarStoreId - Storage ID
417 VarOffset - Offset in Storage
418 Prompt - String ID for Prompt
419 Help - String ID for Help
420 QuestionFlags - Flags in Question Header
421 NumericFlags - Flags for numeric opcode
422 Minimum - Numeric minimum value
423 Maximum - Numeric maximum value
424 Step - Numeric step for edit
425 Default - Numeric default value
426 Data - Destination for the created opcode binary
427
428 Returns:
429 EFI_SUCCESS - Opcode create success
430
431 --*/
432 ;
433
434 EFI_STATUS
435 CreateStringOpCode (
436 IN EFI_QUESTION_ID QuestionId,
437 IN EFI_VARSTORE_ID VarStoreId,
438 IN UINT16 VarOffset,
439 IN EFI_STRING_ID Prompt,
440 IN EFI_STRING_ID Help,
441 IN UINT8 QuestionFlags,
442 IN UINT8 StringFlags,
443 IN UINT8 MinSize,
444 IN UINT8 MaxSize,
445 IN OUT EFI_HII_UPDATE_DATA *Data
446 )
447 /*++
448
449 Routine Description:
450 Create EFI_IFR_STRING_OP opcode.
451
452 Arguments:
453 QuestionId - Question ID
454 VarStoreId - Storage ID
455 VarOffset - Offset in Storage
456 Prompt - String ID for Prompt
457 Help - String ID for Help
458 QuestionFlags - Flags in Question Header
459 StringFlags - Flags for string opcode
460 MinSize - String minimum length
461 MaxSize - String maximum length
462 Data - Destination for the created opcode binary
463
464 Returns:
465 EFI_SUCCESS - Opcode create success
466
467 --*/
468 ;
469
470 EFI_STATUS
471 CreateBannerOpCode (
472 IN EFI_STRING_ID Title,
473 IN UINT16 LineNumber,
474 IN UINT8 Alignment,
475 IN OUT EFI_HII_UPDATE_DATA *Data
476 )
477 /*++
478
479 Routine Description:
480 Create GUIDed opcode for banner.
481
482 Arguments:
483 Title - String ID for title
484 LineNumber - Line number for this banner
485 Alignment - Alignment for this banner, left, center or right
486 Data - Destination for the created opcode binary
487
488 Returns:
489 EFI_SUCCESS - Opcode create success
490
491 --*/
492 ;
493
494 EFI_HII_PACKAGE_LIST_HEADER *
495 PreparePackageList (
496 IN UINTN NumberOfPackages,
497 IN EFI_GUID *GuidId,
498 ...
499 )
500 /*++
501
502 Routine Description:
503 Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.
504
505 Arguments:
506 NumberOfPackages - Number of packages.
507 GuidId - Package GUID.
508
509 Returns:
510 Pointer of EFI_HII_PACKAGE_LIST_HEADER.
511
512 --*/
513 ;
514
515 EFI_STATUS
516 CreateHiiDriverHandle (
517 OUT EFI_HANDLE *DriverHandle
518 )
519 /*++
520
521 Routine Description:
522 The HII driver handle passed in for HiiDatabase.NewPackageList() requires
523 that there should be DevicePath Protocol installed on it.
524 This routine create a virtual Driver Handle by installing a vendor device
525 path on it, so as to use it to invoke HiiDatabase.NewPackageList().
526
527 Arguments:
528 DriverHandle - Handle to be returned
529
530 Returns:
531 EFI_SUCCESS - Handle destroy success.
532 EFI_OUT_OF_RESOURCES - Not enough memory.
533
534 --*/
535 ;
536
537 EFI_STATUS
538 DestroyHiiDriverHandle (
539 IN EFI_HANDLE DriverHandle
540 )
541 /*++
542
543 Routine Description:
544 Destroy the Driver Handle created by CreateHiiDriverHandle().
545
546 Arguments:
547 DriverHandle - Handle returned by CreateHiiDriverHandle()
548
549 Returns:
550 EFI_SUCCESS - Handle destroy success.
551 other - Handle destroy fail.
552
553 --*/
554 ;
555
556 EFI_HII_HANDLE
557 DevicePathToHiiHandle (
558 IN EFI_HII_DATABASE_PROTOCOL *HiiDatabase,
559 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
560 )
561 /*++
562
563 Routine Description:
564 Find HII Handle associated with given Device Path.
565
566 Arguments:
567 HiiDatabase - Point to EFI_HII_DATABASE_PROTOCOL instance.
568 DevicePath - Device Path associated with the HII package list handle.
569
570 Returns:
571 Handle - HII package list Handle associated with the Device Path.
572 NULL - Hii Package list handle is not found.
573
574 --*/
575 ;
576
577 EFI_STATUS
578 ExtractDefault(
579 IN VOID *Buffer,
580 IN UINTN *BufferSize,
581 UINTN Number,
582 ...
583 )
584 /*++
585
586 Routine Description:
587 Configure the buffer accrording to ConfigBody strings.
588
589 Arguments:
590 DefaultId - the ID of default.
591 Buffer - the start address of buffer.
592 BufferSize - the size of buffer.
593 Number - the number of the strings.
594
595 Returns:
596 EFI_BUFFER_TOO_SMALL - the BufferSize is too small to operate.
597 EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0.
598 EFI_SUCCESS - Operation successful.
599
600 --*/
601 ;
602
603 EFI_STATUS
604 ExtractGuidFromHiiHandle (
605 IN EFI_HII_HANDLE Handle,
606 OUT EFI_GUID *Guid
607 )
608 /*++
609
610 Routine Description:
611 Extract Hii package list GUID for given HII handle.
612
613 Arguments:
614 HiiHandle - Hii handle
615 Guid - Package list GUID
616
617 Returns:
618 EFI_SUCCESS - Successfully extract GUID from Hii database.
619
620 --*/
621 ;
622
623 EFI_STATUS
624 ExtractClassFromHiiHandle (
625 IN EFI_HII_HANDLE Handle,
626 OUT UINT16 *Class,
627 OUT EFI_STRING_ID *FormSetTitle,
628 OUT EFI_STRING_ID *FormSetHelp
629 )
630 /*++
631
632 Routine Description:
633 Extract formset class for given HII handle.
634
635 Arguments:
636 HiiHandle - Hii handle
637 Class - Class of the formset
638 FormSetTitle - Formset title string
639 FormSetHelp - Formset help string
640
641 Returns:
642 EFI_SUCCESS - Successfully extract Class for specified Hii handle.
643
644 --*/
645 ;
646
647 EFI_STATUS
648 BufferToHexString (
649 IN OUT CHAR16 *Str,
650 IN UINT8 *Buffer,
651 IN UINTN BufferSize
652 )
653 /*++
654
655 Routine Description:
656 Converts binary buffer to Unicode string in reversed byte order to BufToHexString().
657
658 Arguments:
659 Str - String for output
660 Buffer - Binary buffer.
661 BufferSize - Size of the buffer in bytes.
662
663 Returns:
664 EFI_SUCCESS - The function completed successfully.
665
666 --*/
667 ;
668
669 EFI_STATUS
670 HexStringToBuffer (
671 IN OUT UINT8 *Buffer,
672 IN OUT UINTN *BufferSize,
673 IN CHAR16 *Str
674 )
675 /*++
676
677 Routine Description:
678 Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().
679
680 Arguments:
681 Buffer - Pointer to buffer that receives the data.
682 BufferSize - Length in bytes of the buffer to hold converted data.
683 If routine return with EFI_SUCCESS, containing length of converted data.
684 If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
685 Str - String to be converted from.
686
687 Returns:
688 EFI_SUCCESS - The function completed successfully.
689
690 --*/
691 ;
692
693 EFI_STATUS
694 ConstructConfigHdr (
695 IN OUT CHAR16 *ConfigHdr,
696 IN OUT UINTN *StrBufferLen,
697 IN EFI_GUID *Guid,
698 IN CHAR16 *Name, OPTIONAL
699 IN EFI_HANDLE *DriverHandle
700 )
701 /*++
702
703 Routine Description:
704 Construct <ConfigHdr> using routing information GUID/NAME/PATH.
705
706 Arguments:
707 ConfigHdr - Pointer to the ConfigHdr string.
708 StrBufferLen - On input: Length in bytes of buffer to hold the ConfigHdr string. Includes tailing '\0' character.
709 On output:
710 If return EFI_SUCCESS, containing length of ConfigHdr string buffer.
711 If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
712 Guid - Routing information: GUID.
713 Name - Routing information: NAME.
714 DriverHandle - Driver handle which contains the routing information: PATH.
715
716 Returns:
717 EFI_SUCCESS - Routine success.
718 EFI_BUFFER_TOO_SMALL - The ConfigHdr string buffer is too small.
719
720 --*/
721 ;
722
723 BOOLEAN
724 FindBlockName (
725 IN OUT CHAR16 *String,
726 UINTN Offset,
727 UINTN Width
728 )
729 /*++
730
731 Routine Description:
732 Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.
733
734 Arguments:
735 String - The string to be searched in.
736 Offset - Offset in BlockName.
737 Width - Width in BlockName.
738
739 Returns:
740 TRUE - Block name found.
741 FALSE - Block name not found.
742
743 --*/
744 ;
745
746 EFI_STATUS
747 GetBrowserData (
748 EFI_GUID *VariableGuid, OPTIONAL
749 CHAR16 *VariableName, OPTIONAL
750 UINTN *BufferSize,
751 UINT8 *Buffer
752 )
753 /*++
754
755 Routine Description:
756 This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.
757
758 Arguments:
759 VariableGuid - An optional field to indicate the target variable GUID name to use.
760 VariableName - An optional field to indicate the target human-readable variable name.
761 BufferSize - On input: Length in bytes of buffer to hold retrived data.
762 On output:
763 If return EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
764 Buffer - Buffer to hold retrived data.
765
766 Returns:
767 EFI_SUCCESS - Routine success.
768 EFI_BUFFER_TOO_SMALL - The intput buffer is too small.
769
770 --*/
771 ;
772
773 EFI_STATUS
774 GetHiiHandles (
775 IN OUT UINTN *HandleBufferLength,
776 OUT EFI_HII_HANDLE **HiiHandleBuffer
777 )
778 /*++
779
780 Routine Description:
781 Determines the handles that are currently active in the database.
782 It's the caller's responsibility to free handle buffer.
783
784 Arguments:
785 HiiDatabase - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
786 HandleBufferLength - On input, a pointer to the length of the handle buffer. On output,
787 the length of the handle buffer that is required for the handles found.
788 HiiHandleBuffer - Pointer to an array of Hii Handles returned.
789
790 Returns:
791 EFI_SUCCESS - Get an array of Hii Handles successfully.
792 EFI_INVALID_PARAMETER - Hii is NULL.
793 EFI_NOT_FOUND - Database not found.
794
795 --*/
796 ;
797
798 EFI_STATUS
799 SetBrowserData (
800 EFI_GUID *VariableGuid, OPTIONAL
801 CHAR16 *VariableName, OPTIONAL
802 UINTN BufferSize,
803 UINT8 *Buffer,
804 CHAR16 *RequestElement OPTIONAL
805 )
806 /*++
807
808 Routine Description:
809 This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.
810
811 Arguments:
812 VariableGuid - An optional field to indicate the target variable GUID name to use.
813 VariableName - An optional field to indicate the target human-readable variable name.
814 BufferSize - Length in bytes of buffer to hold retrived data.
815 Buffer - Buffer to hold retrived data.
816 RequestElement - An optional field to specify which part of the buffer data
817 will be send back to Browser. If NULL, the whole buffer of
818 data will be committed to Browser.
819 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*
820
821 Returns:
822 EFI_SUCCESS - Routine success.
823 Other - Updating Browser uncommitted data failed.
824
825 --*/
826 ;
827
828 EFI_STATUS
829 ConvertRfc3066LanguageToIso639Language (
830 CHAR8 *LanguageRfc3066,
831 CHAR8 *LanguageIso639
832 )
833 /*++
834
835 Routine Description:
836 Convert language code from RFC3066 to ISO639-2.
837
838 Arguments:
839 LanguageRfc3066 - RFC3066 language code.
840 LanguageIso639 - ISO639-2 language code.
841
842 Returns:
843 EFI_SUCCESS - Language code converted.
844 EFI_NOT_FOUND - Language code not found.
845
846 --*/
847 ;
848
849 CHAR8 *
850 Rfc3066ToIso639 (
851 CHAR8 *SupportedLanguages
852 )
853 /*++
854
855 Routine Description:
856 Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will
857 be converted to "engfra".
858
859 Arguments:
860 SupportedLanguages - The RFC3066 language list.
861
862 Returns:
863 The ISO639-2 language list.
864
865 --*/
866 ;
867
868 EFI_STATUS
869 GetCurrentLanguage (
870 OUT CHAR8 *Lang
871 )
872 /*++
873
874 Routine Description:
875 Determine what is the current language setting
876
877 Arguments:
878 Lang - Pointer of system language
879
880 Returns:
881 Status code
882
883 --*/
884 ;
885
886 VOID
887 GetNextLanguage (
888 IN OUT CHAR8 **LangCode,
889 OUT CHAR8 *Lang
890 )
891 /*++
892
893 Routine Description:
894 Get next language from language code list.
895
896 Arguments:
897 LangCode - The language code.
898 Lang - Returned language.
899
900 Returns:
901 None.
902
903 --*/
904 ;
905
906 CHAR8 *
907 GetSupportedLanguages (
908 IN EFI_HII_HANDLE HiiHandle
909 )
910 /*++
911
912 Routine Description:
913 This function returns the list of supported languages, in the format specified
914 in UEFI specification Appendix M.
915
916 Arguments:
917 HiiHandle - The HII package list handle.
918
919 Returns:
920 The supported languages.
921
922 --*/
923 ;
924
925 UINT16
926 GetSupportedLanguageNumber (
927 IN EFI_HII_HANDLE HiiHandle
928 )
929 /*++
930
931 Routine Description:
932 This function returns the number of supported languages
933
934 Arguments:
935 HiiHandle - The HII package list handle.
936
937 Returns:
938 The number of supported languages.
939
940 --*/
941 ;
942
943 EFI_STATUS
944 GetStringFromHandle (
945 IN EFI_HII_HANDLE HiiHandle,
946 IN EFI_STRING_ID StringId,
947 OUT EFI_STRING *String
948 )
949 /*++
950
951 Routine Description:
952 Get string specified by StringId form the HiiHandle.
953
954 Arguments:
955 HiiHandle - The HII handle of package list.
956 StringId - The String ID.
957 String - The output string.
958
959 Returns:
960 EFI_NOT_FOUND - String is not found.
961 EFI_SUCCESS - Operation is successful.
962 EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
963 EFI_INVALID_PARAMETER - The String is NULL.
964
965 --*/
966 ;
967
968 EFI_STATUS
969 GetStringFromToken (
970 IN EFI_GUID *ProducerGuid,
971 IN EFI_STRING_ID StringId,
972 OUT EFI_STRING *String
973 )
974 /*++
975
976 Routine Description:
977 Get the string given the StringId and String package Producer's Guid.
978
979 Arguments:
980 ProducerGuid - The Guid of String package list.
981 StringId - The String ID.
982 String - The output string.
983
984 Returns:
985 EFI_NOT_FOUND - String is not found.
986 EFI_SUCCESS - Operation is successful.
987 EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
988
989 --*/
990 ;
991
992 EFI_STATUS
993 IfrLibNewString (
994 IN EFI_HII_HANDLE PackageList,
995 OUT EFI_STRING_ID *StringId,
996 IN CONST EFI_STRING String
997 )
998 /*++
999
1000 Routine Description:
1001 This function adds the string into String Package of each language.
1002
1003 Arguments:
1004 PackageList - Handle of the package list where this string will be added.
1005 StringId - On return, contains the new strings id, which is unique within PackageList.
1006 String - Points to the new null-terminated string.
1007
1008 Returns:
1009 EFI_SUCCESS - The new string was added successfully.
1010 EFI_NOT_FOUND - The specified PackageList could not be found in database.
1011 EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources.
1012 EFI_INVALID_PARAMETER - String is NULL or StringId is NULL is NULL.
1013
1014 --*/
1015 ;
1016
1017 EFI_STATUS
1018 IfrLibGetString (
1019 IN EFI_HII_HANDLE PackageList,
1020 IN EFI_STRING_ID StringId,
1021 OUT EFI_STRING String,
1022 IN OUT UINTN *StringSize
1023 )
1024 /*++
1025
1026 Routine Description:
1027 This function try to retrieve string from String package of current language.
1028 If fail, it try to retrieve string from String package of first language it support.
1029
1030 Arguments:
1031 PackageList - The package list in the HII database to search for the specified string.
1032 StringId - The string's id, which is unique within PackageList.
1033 String - Points to the new null-terminated string.
1034 StringSize - On entry, points to the size of the buffer pointed to by String, in bytes. On return,
1035 points to the length of the string, in bytes.
1036
1037 Returns:
1038 EFI_SUCCESS - The string was returned successfully.
1039 EFI_NOT_FOUND - The string specified by StringId is not available.
1040 EFI_BUFFER_TOO_SMALL - The buffer specified by StringLength is too small to hold the string.
1041 EFI_INVALID_PARAMETER - The String or StringSize was NULL.
1042
1043 --*/
1044 ;
1045
1046 EFI_STATUS
1047 IfrLibSetString (
1048 IN EFI_HII_HANDLE PackageList,
1049 IN EFI_STRING_ID StringId,
1050 IN CONST EFI_STRING String
1051 )
1052 /*++
1053
1054 Routine Description:
1055 This function updates the string in String package of current language.
1056
1057 Arguments:
1058 PackageList - The package list containing the strings.
1059 StringId - The string's id, which is unique within PackageList.
1060 String - Points to the new null-terminated string.
1061
1062 Returns:
1063 EFI_SUCCESS - The string was updated successfully.
1064 EFI_NOT_FOUND - The string specified by StringId is not in the database.
1065 EFI_INVALID_PARAMETER - The String was NULL.
1066 EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.
1067
1068 --*/
1069 ;
1070
1071 EFI_STATUS
1072 IfrLibCreatePopUp (
1073 IN UINTN NumberOfLines,
1074 OUT EFI_INPUT_KEY *KeyValue,
1075 IN CHAR16 *String,
1076 ...
1077 )
1078 /*++
1079
1080 Routine Description:
1081 Draw a dialog and return the selected key.
1082
1083 Arguments:
1084 NumberOfLines - The number of lines for the dialog box
1085 KeyValue - The EFI_KEY value returned if HotKey is TRUE..
1086 String - Pointer to the first string in the list
1087 ... - A series of (quantity == NumberOfLines) text strings which
1088 will be used to construct the dialog box
1089
1090 Returns:
1091 EFI_SUCCESS - Displayed dialog and received user interaction
1092 EFI_INVALID_PARAMETER - One of the parameters was invalid.
1093
1094 --*/
1095 ;
1096
1097 EFI_STATUS
1098 IfrLibUpdateForm (
1099 IN EFI_HII_HANDLE Handle,
1100 IN EFI_GUID *FormSetGuid, OPTIONAL
1101 IN EFI_FORM_ID FormId,
1102 IN UINT16 Label,
1103 IN BOOLEAN Insert,
1104 IN EFI_HII_UPDATE_DATA *Data
1105 )
1106 /*++
1107
1108 Routine Description:
1109 This function allows the caller to update a form that has
1110 previously been registered with the EFI HII database.
1111
1112 Arguments:
1113 Handle - Hii Handle
1114 FormSetGuid - The formset should be updated.
1115 FormId - The form should be updated.
1116 Label - Update information starting immediately after this label in the IFR
1117 Insert - If TRUE and Data is not NULL, insert data after Label.
1118 If FALSE, replace opcodes between two labels with Data.
1119 Data - The adding data; If NULL, remove opcodes between two Label.
1120
1121 Returns:
1122 EFI_SUCCESS - Update success.
1123 Other - Update fail.
1124
1125 --*/
1126 ;
1127 #endif