3 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
4 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
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.
18 The file contain all library function for Ifr Operations.
26 #include "EfiDriverLib.h"
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)
38 #include EFI_GUID_DEFINITION (GlobalVariable)
40 #define IFR_LIB_DEFAULT_STRING_SIZE 0x200
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.
51 #define EFI_LANGUAGE_VARIABLE L"Lang"
52 #define EFI_LANGUAGE_CODES_VARIABLE L"LangCodes"
54 #define UEFI_LANGUAGE_VARIABLE L"PlatformLang"
55 #define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes"
58 // Limited buffer size recommended by RFC4646 (4.3. Length Considerations)
59 // (42 characters plus a NULL terminator)
61 #define RFC_3066_ENTRY_SIZE (42 + 1)
62 #define ISO_639_2_ENTRY_SIZE 3
64 #define INVALID_VARSTORE_ID 0
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)
69 extern EFI_GUID mIfrVendorGuid
;
70 extern EFI_HII_DATABASE_PROTOCOL
*gIfrLibHiiDatabase
;
71 extern EFI_HII_STRING_PROTOCOL
*gIfrLibHiiString
;
75 EFI_STRING_ID StringToken
;
76 EFI_IFR_TYPE_VALUE Value
;
83 VENDOR_DEVICE_PATH VendorDevicePath
;
86 } HII_VENDOR_DEVICE_PATH_NODE
;
90 HII_VENDOR_DEVICE_PATH_NODE Node
;
91 EFI_DEVICE_PATH_PROTOCOL End
;
92 } HII_VENDOR_DEVICE_PATH
;
96 // Buffer size allocated for Data.
101 // Offset in Data to append the newly created opcode binary.
102 // It will be adjusted automatically in Create***OpCode(), and should be
103 // initialized to 0 before invocation of a serial of Create***OpCode()
108 // The destination buffer for created op-codes
111 } EFI_HII_UPDATE_DATA
;
120 This function locate Hii relative protocols for later usage.
132 // Exported Library functions
136 IN OUT EFI_HII_UPDATE_DATA
*Data
141 Create EFI_IFR_END_OP opcode.
144 Data - Destination for the created opcode binary
147 EFI_SUCCESS - Opcode create success
153 CreateDefaultOpCode (
154 IN EFI_IFR_TYPE_VALUE
*Value
,
156 IN OUT EFI_HII_UPDATE_DATA
*Data
161 Create EFI_IFR_DEFAULT_OP opcode.
164 Value - Value for the default
165 Type - Type for the default
166 Data - Destination for the created opcode binary
169 EFI_SUCCESS - Opcode create success
176 IN EFI_QUESTION_ID QuestionId
,
177 IN EFI_STRING_ID Prompt
,
178 IN EFI_STRING_ID Help
,
179 IN UINT8 QuestionFlags
,
180 IN EFI_STRING_ID QuestionConfig
,
181 IN OUT EFI_HII_UPDATE_DATA
*Data
186 Create EFI_IFR_ACTION_OP opcode.
189 QuestionId - Question ID
190 Prompt - String ID for Prompt
191 Help - String ID for Help
192 QuestionFlags - Flags in Question Header
193 QuestionConfig - String ID for configuration
194 Data - Destination for the created opcode binary
197 EFI_SUCCESS - Opcode create success
203 CreateSubTitleOpCode (
204 IN EFI_STRING_ID Prompt
,
205 IN EFI_STRING_ID Help
,
208 IN OUT EFI_HII_UPDATE_DATA
*Data
213 Create EFI_IFR_SUBTITLE_OP opcode.
216 Prompt - String ID for Prompt
217 Help - String ID for Help
218 Flags - Subtitle opcode flags
219 Scope - Subtitle Scope bit
220 Data - Destination for the created opcode binary
223 EFI_SUCCESS - Opcode create success
230 IN EFI_STRING_ID Prompt
,
231 IN EFI_STRING_ID Help
,
232 IN EFI_STRING_ID TextTwo
,
233 IN OUT EFI_HII_UPDATE_DATA
*Data
238 Create EFI_IFR_TEXT_OP opcode.
241 Prompt - String ID for Prompt
242 Help - String ID for Help
243 TextTwo - String ID for text two
244 Data - Destination for the created opcode binary
247 EFI_SUCCESS - Opcode create success
254 IN EFI_FORM_ID FormId
,
255 IN EFI_STRING_ID Prompt
,
256 IN EFI_STRING_ID Help
,
257 IN UINT8 QuestionFlags
,
258 IN EFI_QUESTION_ID QuestionId
,
259 IN OUT EFI_HII_UPDATE_DATA
*Data
264 Create EFI_IFR_REF_OP opcode.
267 FormId - Destination Form ID
268 Prompt - String ID for Prompt
269 Help - String ID for Help
270 QuestionFlags - Flags in Question Header
271 QuestionId - Question ID
272 Data - Destination for the created opcode binary
275 EFI_SUCCESS - Opcode create success
281 CreateOneOfOptionOpCode (
282 IN UINTN OptionCount
,
283 IN IFR_OPTION
*OptionsList
,
285 IN OUT EFI_HII_UPDATE_DATA
*Data
291 IN EFI_QUESTION_ID QuestionId
,
292 IN EFI_VARSTORE_ID VarStoreId
,
294 IN EFI_STRING_ID Prompt
,
295 IN EFI_STRING_ID Help
,
296 IN UINT8 QuestionFlags
,
298 IN IFR_OPTION
*OptionsList
,
299 IN UINTN OptionCount
,
300 IN OUT EFI_HII_UPDATE_DATA
*Data
305 Create EFI_IFR_ONE_OF_OP opcode.
308 QuestionId - Question ID
309 VarStoreId - Storage ID
310 VarOffset - Offset in Storage
311 Prompt - String ID for Prompt
312 Help - String ID for Help
313 QuestionFlags - Flags in Question Header
314 OneOfFlags - Flags for oneof opcode
315 OptionsList - List of options
316 OptionCount - Number of options in option list
317 Data - Destination for the created opcode binary
320 EFI_SUCCESS - Opcode create success
326 CreateOrderedListOpCode (
327 IN EFI_QUESTION_ID QuestionId
,
328 IN EFI_VARSTORE_ID VarStoreId
,
330 IN EFI_STRING_ID Prompt
,
331 IN EFI_STRING_ID Help
,
332 IN UINT8 QuestionFlags
,
335 IN UINT8 MaxContainers
,
336 IN IFR_OPTION
*OptionsList
,
337 IN UINTN OptionCount
,
338 IN OUT EFI_HII_UPDATE_DATA
*Data
343 Create EFI_IFR_ORDERED_LIST_OP opcode.
346 QuestionId - Question ID
347 VarStoreId - Storage ID
348 VarOffset - Offset in Storage
349 Prompt - String ID for Prompt
350 Help - String ID for Help
351 QuestionFlags - Flags in Question Header
352 Flags - Flags for ordered list opcode
353 DataType - Type for option value
354 MaxContainers - Maximum count for options in this ordered list
355 OptionsList - List of options
356 OptionCount - Number of options in option list
357 Data - Destination for the created opcode binary
360 EFI_SUCCESS - Opcode create success
366 CreateCheckBoxOpCode (
367 IN EFI_QUESTION_ID QuestionId
,
368 IN EFI_VARSTORE_ID VarStoreId
,
370 IN EFI_STRING_ID Prompt
,
371 IN EFI_STRING_ID Help
,
372 IN UINT8 QuestionFlags
,
373 IN UINT8 CheckBoxFlags
,
374 IN OUT EFI_HII_UPDATE_DATA
*Data
379 Create EFI_IFR_CHECKBOX_OP opcode.
382 QuestionId - Question ID
383 VarStoreId - Storage ID
384 VarOffset - Offset in Storage
385 Prompt - String ID for Prompt
386 Help - String ID for Help
387 QuestionFlags - Flags in Question Header
388 CheckBoxFlags - Flags for checkbox opcode
389 Data - Destination for the created opcode binary
392 EFI_SUCCESS - Opcode create success
398 CreateNumericOpCode (
399 IN EFI_QUESTION_ID QuestionId
,
400 IN EFI_VARSTORE_ID VarStoreId
,
402 IN EFI_STRING_ID Prompt
,
403 IN EFI_STRING_ID Help
,
404 IN UINT8 QuestionFlags
,
405 IN UINT8 NumericFlags
,
410 IN OUT EFI_HII_UPDATE_DATA
*Data
415 Create EFI_IFR_NUMERIC_OP opcode.
418 QuestionId - Question ID
419 VarStoreId - Storage ID
420 VarOffset - Offset in Storage
421 Prompt - String ID for Prompt
422 Help - String ID for Help
423 QuestionFlags - Flags in Question Header
424 NumericFlags - Flags for numeric opcode
425 Minimum - Numeric minimum value
426 Maximum - Numeric maximum value
427 Step - Numeric step for edit
428 Default - Numeric default value
429 Data - Destination for the created opcode binary
432 EFI_SUCCESS - Opcode create success
439 IN EFI_QUESTION_ID QuestionId
,
440 IN EFI_VARSTORE_ID VarStoreId
,
442 IN EFI_STRING_ID Prompt
,
443 IN EFI_STRING_ID Help
,
444 IN UINT8 QuestionFlags
,
445 IN UINT8 StringFlags
,
448 IN OUT EFI_HII_UPDATE_DATA
*Data
453 Create EFI_IFR_STRING_OP opcode.
456 QuestionId - Question ID
457 VarStoreId - Storage ID
458 VarOffset - Offset in Storage
459 Prompt - String ID for Prompt
460 Help - String ID for Help
461 QuestionFlags - Flags in Question Header
462 StringFlags - Flags for string opcode
463 MinSize - String minimum length
464 MaxSize - String maximum length
465 Data - Destination for the created opcode binary
468 EFI_SUCCESS - Opcode create success
475 IN EFI_STRING_ID Title
,
476 IN UINT16 LineNumber
,
478 IN OUT EFI_HII_UPDATE_DATA
*Data
483 Create GUIDed opcode for banner.
486 Title - String ID for title
487 LineNumber - Line number for this banner
488 Alignment - Alignment for this banner, left, center or right
489 Data - Destination for the created opcode binary
492 EFI_SUCCESS - Opcode create success
497 EFI_HII_PACKAGE_LIST_HEADER
*
499 IN UINTN NumberOfPackages
,
506 Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.
509 NumberOfPackages - Number of packages.
510 GuidId - Package GUID.
513 Pointer of EFI_HII_PACKAGE_LIST_HEADER.
519 CreateHiiDriverHandle (
520 OUT EFI_HANDLE
*DriverHandle
525 The HII driver handle passed in for HiiDatabase.NewPackageList() requires
526 that there should be DevicePath Protocol installed on it.
527 This routine create a virtual Driver Handle by installing a vendor device
528 path on it, so as to use it to invoke HiiDatabase.NewPackageList().
531 DriverHandle - Handle to be returned
534 EFI_SUCCESS - Handle destroy success.
535 EFI_OUT_OF_RESOURCES - Not enough memory.
541 DestroyHiiDriverHandle (
542 IN EFI_HANDLE DriverHandle
547 Destroy the Driver Handle created by CreateHiiDriverHandle().
550 DriverHandle - Handle returned by CreateHiiDriverHandle()
553 EFI_SUCCESS - Handle destroy success.
554 other - Handle destroy fail.
560 DevicePathToHiiHandle (
561 IN EFI_HII_DATABASE_PROTOCOL
*HiiDatabase
,
562 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
567 Find HII Handle associated with given Device Path.
570 HiiDatabase - Point to EFI_HII_DATABASE_PROTOCOL instance.
571 DevicePath - Device Path associated with the HII package list handle.
574 Handle - HII package list Handle associated with the Device Path.
575 NULL - Hii Package list handle is not found.
583 IN UINTN
*BufferSize
,
590 Configure the buffer accrording to ConfigBody strings.
593 DefaultId - the ID of default.
594 Buffer - the start address of buffer.
595 BufferSize - the size of buffer.
596 Number - the number of the strings.
599 EFI_BUFFER_TOO_SMALL - the BufferSize is too small to operate.
600 EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0.
601 EFI_SUCCESS - Operation successful.
607 ConstructConfigAltResp (
608 IN EFI_STRING ConfigRequest
, OPTIONAL
609 OUT EFI_STRING
*Progress
,
610 OUT EFI_STRING
*ConfigAltResp
,
613 IN EFI_HANDLE
*DriverHandle
,
614 IN VOID
*BufferStorage
,
615 IN UINTN BufferStorageSize
,
616 IN VOID
*BlockNameArray
, OPTIONAL
617 IN UINTN NumberAltCfg
,
619 //IN UINT16 AltCfgId,
620 //IN VOID *DefaultValueArray,
626 Construct <ConfigAltResp> for a buffer storage.
629 ConfigRequest - The Config request string. If set to NULL, all the
630 configurable elements will be extracted from BlockNameArray.
631 ConfigAltResp - The returned <ConfigAltResp>.
632 Progress - On return, points to a character in the Request.
633 Guid - GUID of the buffer storage.
634 Name - Name of the buffer storage.
635 DriverHandle - The DriverHandle which is used to invoke HiiDatabase
636 protocol interface NewPackageList().
637 BufferStorage - Content of the buffer storage.
638 BufferStorageSize - Length in bytes of the buffer storage.
639 BlockNameArray - Array generated by VFR compiler.
640 NumberAltCfg - Number of Default value array generated by VFR compiler.
641 The sequential input parameters will be number of
642 AltCfgId and DefaultValueArray pairs. When set to 0,
643 there will be no <AltResp>.
646 EFI_OUT_OF_RESOURCES - Run out of memory resource.
647 EFI_INVALID_PARAMETER - ConfigAltResp is NULL.
648 EFI_SUCCESS - Operation successful.
654 ExtractGuidFromHiiHandle (
655 IN EFI_HII_HANDLE Handle
,
661 Extract Hii package list GUID for given HII handle.
664 HiiHandle - Hii handle
665 Guid - Package list GUID
668 EFI_SUCCESS - Successfully extract GUID from Hii database.
674 ExtractClassFromHiiHandle (
675 IN EFI_HII_HANDLE Handle
,
677 OUT EFI_STRING_ID
*FormSetTitle
,
678 OUT EFI_STRING_ID
*FormSetHelp
683 Extract formset class for given HII handle.
686 HiiHandle - Hii handle
687 Class - Class of the formset
688 FormSetTitle - Formset title string
689 FormSetHelp - Formset help string
692 EFI_SUCCESS - Successfully extract Class for specified Hii handle.
698 ExtractClassGuidFromHiiHandle (
699 IN EFI_HII_HANDLE Handle
,
700 OUT UINT8
*NumberOfClassGuid
,
701 OUT EFI_GUID
**ClassGuid
,
702 OUT EFI_STRING_ID
*FormSetTitle
,
703 OUT EFI_STRING_ID
*FormSetHelp
708 Extract formset ClassGuid for given HII handle.
711 HiiHandle - Hii handle
712 NumberOfClassGuid - Number of ClassGuid
713 ClassGuid - Pointer to callee allocated buffer, an array of ClassGuid
714 FormSetTitle - Formset title string
715 FormSetHelp - Formset help string
718 EFI_SUCCESS - Successfully extract Class for specified Hii handle.
730 Converts the unicode character from uppercase to lowercase.
733 Str - String to be converted
749 Converts binary buffer to Unicode string in reversed byte order to BufToHexString().
752 Str - String for output
753 Buffer - Binary buffer.
754 BufferSize - Size of the buffer in bytes.
757 EFI_SUCCESS - The function completed successfully.
764 IN OUT UINT8
*Buffer
,
765 IN OUT UINTN
*BufferSize
,
771 Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().
774 Buffer - Pointer to buffer that receives the data.
775 BufferSize - Length in bytes of the buffer to hold converted data.
776 If routine return with EFI_SUCCESS, containing length of converted data.
777 If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
778 Str - String to be converted from.
781 EFI_SUCCESS - The function completed successfully.
787 ConfigStringToUnicode (
788 IN OUT CHAR16
*UnicodeString
,
789 IN OUT UINTN
*StrBufferLen
,
790 IN CHAR16
*ConfigString
795 Convert binary representation Config string (e.g. "0041004200430044") to the
796 original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.
797 "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
800 UnicodeString - Original Unicode string.
801 StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
802 Includes tailing '\0' character.
804 If return EFI_SUCCESS, containing length of Unicode string buffer.
805 If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
806 ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
809 EFI_SUCCESS - Routine success.
810 EFI_BUFFER_TOO_SMALL - The string buffer is too small.
816 UnicodeToConfigString (
817 IN OUT CHAR16
*ConfigString
,
818 IN OUT UINTN
*StrBufferLen
,
819 IN CHAR16
*UnicodeString
824 Convert Unicode string to binary representation Config string, e.g.
825 "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.
826 "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
829 ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
830 StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
831 Includes tailing '\0' character.
833 If return EFI_SUCCESS, containing length of Unicode string buffer.
834 If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
835 UnicodeString - Original Unicode string.
838 EFI_SUCCESS - Routine success.
839 EFI_BUFFER_TOO_SMALL - The string buffer is too small.
846 IN OUT CHAR16
*ConfigHdr
,
847 IN OUT UINTN
*StrBufferLen
,
849 IN CHAR16
*Name
, OPTIONAL
850 IN EFI_HANDLE
*DriverHandle
855 Construct <ConfigHdr> using routing information GUID/NAME/PATH.
858 ConfigHdr - Pointer to the ConfigHdr string.
859 StrBufferLen - On input: Length in bytes of buffer to hold the ConfigHdr string. Includes tailing '\0' character.
861 If return EFI_SUCCESS, containing length of ConfigHdr string buffer.
862 If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
863 Guid - Routing information: GUID.
864 Name - Routing information: NAME.
865 DriverHandle - Driver handle which contains the routing information: PATH.
868 EFI_SUCCESS - Routine success.
869 EFI_BUFFER_TOO_SMALL - The ConfigHdr string buffer is too small.
876 IN EFI_STRING ConfigString
,
877 IN EFI_GUID
*StorageGuid
, OPTIONAL
878 IN CHAR16
*StorageName OPTIONAL
883 Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.
886 ConfigString - Either <ConfigRequest> or <ConfigResp>.
887 StorageGuid - GUID of the storage.
888 StorageName - Name of the stoarge.
891 TRUE - Routing information is correct in ConfigString.
892 FALSE - Routing information is incorrect in ConfigString.
899 IN OUT CHAR16
*String
,
906 Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.
909 String - The string to be searched in.
910 Offset - Offset in BlockName.
911 Width - Width in BlockName.
914 TRUE - Block name found.
915 FALSE - Block name not found.
922 EFI_GUID
*VariableGuid
, OPTIONAL
923 CHAR16
*VariableName
, OPTIONAL
930 This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.
933 VariableGuid - An optional field to indicate the target variable GUID name to use.
934 VariableName - An optional field to indicate the target human-readable variable name.
935 BufferSize - On input: Length in bytes of buffer to hold retrived data.
937 If return EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
938 Buffer - Buffer to hold retrived data.
941 EFI_SUCCESS - Routine success.
942 EFI_BUFFER_TOO_SMALL - The intput buffer is too small.
949 IN OUT UINTN
*HandleBufferLength
,
950 OUT EFI_HII_HANDLE
**HiiHandleBuffer
955 Determines the handles that are currently active in the database.
956 It's the caller's responsibility to free handle buffer.
959 HiiDatabase - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
960 HandleBufferLength - On input, a pointer to the length of the handle buffer. On output,
961 the length of the handle buffer that is required for the handles found.
962 HiiHandleBuffer - Pointer to an array of Hii Handles returned.
965 EFI_SUCCESS - Get an array of Hii Handles successfully.
966 EFI_INVALID_PARAMETER - Hii is NULL.
967 EFI_NOT_FOUND - Database not found.
974 EFI_GUID
*VariableGuid
, OPTIONAL
975 CHAR16
*VariableName
, OPTIONAL
978 CHAR16
*RequestElement OPTIONAL
983 This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.
986 VariableGuid - An optional field to indicate the target variable GUID name to use.
987 VariableName - An optional field to indicate the target human-readable variable name.
988 BufferSize - Length in bytes of buffer to hold retrived data.
989 Buffer - Buffer to hold retrived data.
990 RequestElement - An optional field to specify which part of the buffer data
991 will be send back to Browser. If NULL, the whole buffer of
992 data will be committed to Browser.
993 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*
996 EFI_SUCCESS - Routine success.
997 Other - Updating Browser uncommitted data failed.
1003 ConvertRfc3066LanguageToIso639Language (
1004 CHAR8
*LanguageRfc3066
,
1005 CHAR8
*LanguageIso639
1009 Routine Description:
1010 Convert language code from RFC3066 to ISO639-2.
1013 LanguageRfc3066 - RFC3066 language code.
1014 LanguageIso639 - ISO639-2 language code.
1017 EFI_SUCCESS - Language code converted.
1018 EFI_NOT_FOUND - Language code not found.
1025 CHAR8
*SupportedLanguages
1029 Routine Description:
1030 Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will
1031 be converted to "engfra".
1034 SupportedLanguages - The RFC3066 language list.
1037 The ISO639-2 language list.
1043 GetCurrentLanguage (
1048 Routine Description:
1049 Determine what is the current language setting
1052 Lang - Pointer of system language
1062 IN OUT CHAR8
**LangCode
,
1067 Routine Description:
1068 Get next language from language code list.
1071 LangCode - The language code.
1072 Lang - Returned language.
1081 GetSupportedLanguages (
1082 IN EFI_HII_HANDLE HiiHandle
1086 Routine Description:
1087 This function returns the list of supported languages, in the format specified
1088 in UEFI specification Appendix M.
1091 HiiHandle - The HII package list handle.
1094 The supported languages.
1100 GetSupportedLanguageNumber (
1101 IN EFI_HII_HANDLE HiiHandle
1105 Routine Description:
1106 This function returns the number of supported languages
1109 HiiHandle - The HII package list handle.
1112 The number of supported languages.
1118 GetStringFromHandle (
1119 IN EFI_HII_HANDLE HiiHandle
,
1120 IN EFI_STRING_ID StringId
,
1121 OUT EFI_STRING
*String
1125 Routine Description:
1126 Get string specified by StringId form the HiiHandle.
1129 HiiHandle - The HII handle of package list.
1130 StringId - The String ID.
1131 String - The output string.
1134 EFI_NOT_FOUND - String is not found.
1135 EFI_SUCCESS - Operation is successful.
1136 EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
1137 EFI_INVALID_PARAMETER - The String is NULL.
1143 GetStringFromToken (
1144 IN EFI_GUID
*ProducerGuid
,
1145 IN EFI_STRING_ID StringId
,
1146 OUT EFI_STRING
*String
1150 Routine Description:
1151 Get the string given the StringId and String package Producer's Guid.
1154 ProducerGuid - The Guid of String package list.
1155 StringId - The String ID.
1156 String - The output string.
1159 EFI_NOT_FOUND - String is not found.
1160 EFI_SUCCESS - Operation is successful.
1161 EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
1168 IN EFI_HII_HANDLE PackageList
,
1169 OUT EFI_STRING_ID
*StringId
,
1170 IN CONST EFI_STRING String
1174 Routine Description:
1175 This function adds the string into String Package of each language.
1178 PackageList - Handle of the package list where this string will be added.
1179 StringId - On return, contains the new strings id, which is unique within PackageList.
1180 String - Points to the new null-terminated string.
1183 EFI_SUCCESS - The new string was added successfully.
1184 EFI_NOT_FOUND - The specified PackageList could not be found in database.
1185 EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources.
1186 EFI_INVALID_PARAMETER - String is NULL or StringId is NULL is NULL.
1193 IN EFI_HII_HANDLE PackageList
,
1194 IN EFI_STRING_ID StringId
,
1195 OUT EFI_STRING String
,
1196 IN OUT UINTN
*StringSize
1200 Routine Description:
1201 This function try to retrieve string from String package of current language.
1202 If fail, it try to retrieve string from String package of first language it support.
1205 PackageList - The package list in the HII database to search for the specified string.
1206 StringId - The string's id, which is unique within PackageList.
1207 String - Points to the new null-terminated string.
1208 StringSize - On entry, points to the size of the buffer pointed to by String, in bytes. On return,
1209 points to the length of the string, in bytes.
1212 EFI_SUCCESS - The string was returned successfully.
1213 EFI_NOT_FOUND - The string specified by StringId is not available.
1214 EFI_BUFFER_TOO_SMALL - The buffer specified by StringLength is too small to hold the string.
1215 EFI_INVALID_PARAMETER - The String or StringSize was NULL.
1222 IN EFI_HII_HANDLE PackageList
,
1223 IN EFI_STRING_ID StringId
,
1224 IN CONST EFI_STRING String
1228 Routine Description:
1229 This function updates the string in String package of current language.
1232 PackageList - The package list containing the strings.
1233 StringId - The string's id, which is unique within PackageList.
1234 String - Points to the new null-terminated string.
1237 EFI_SUCCESS - The string was updated successfully.
1238 EFI_NOT_FOUND - The string specified by StringId is not in the database.
1239 EFI_INVALID_PARAMETER - The String was NULL.
1240 EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.
1247 IN UINTN NumberOfLines
,
1248 OUT EFI_INPUT_KEY
*KeyValue
,
1254 Routine Description:
1255 Draw a dialog and return the selected key.
1258 NumberOfLines - The number of lines for the dialog box
1259 KeyValue - The EFI_KEY value returned if HotKey is TRUE..
1260 String - Pointer to the first string in the list
1261 ... - A series of (quantity == NumberOfLines) text strings which
1262 will be used to construct the dialog box
1265 EFI_SUCCESS - Displayed dialog and received user interaction
1266 EFI_INVALID_PARAMETER - One of the parameters was invalid.
1272 IfrLibInitUpdateData (
1273 IN OUT EFI_HII_UPDATE_DATA
*UpdateData
,
1274 IN UINT32 BufferSize
1278 Routine Description:
1279 This function initialize the data structure for dynamic opcode.
1282 UpdateData - The adding data;
1283 BufferSize - Length of the buffer to fill dynamic opcodes.
1286 EFI_SUCCESS - Update data is initialized.
1287 EFI_INVALID_PARAMETER - UpdateData is NULL.
1288 EFI_OUT_OF_RESOURCES - No enough memory to allocate.
1294 IfrLibFreeUpdateData (
1295 IN EFI_HII_UPDATE_DATA
*UpdateData
1299 Routine Description:
1300 This function free the resource of update data.
1303 UpdateData - The adding data;
1306 EFI_SUCCESS - Resource in UpdateData is released.
1307 EFI_INVALID_PARAMETER - UpdateData is NULL.
1314 IN EFI_HII_HANDLE Handle
,
1315 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1316 IN EFI_FORM_ID FormId
,
1319 IN EFI_HII_UPDATE_DATA
*Data
1323 Routine Description:
1324 This function allows the caller to update a form that has
1325 previously been registered with the EFI HII database.
1329 FormSetGuid - The formset should be updated.
1330 FormId - The form should be updated.
1331 Label - Update information starting immediately after this label in the IFR
1332 Insert - If TRUE and Data is not NULL, insert data after Label.
1333 If FALSE, replace opcodes between two labels with Data.
1334 Data - The adding data; If NULL, remove opcodes between two Label.
1337 EFI_SUCCESS - Update success.
1338 Other - Update fail.