2 Public include file for the HII Library
4 Copyright (c) 2006 - 2008, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __NEWHII_LIB_H__
16 #define __NEWHII_LIB_H__
18 ////////////////////////////////////////////////////////
19 ////////////////////////////////////////////////////////
21 ////////////////////////////////////////////////////////
22 ////////////////////////////////////////////////////////
25 Registers a list of packages in the HII Database and returns the HII Handle
26 associated with that registration. If an HII Handle has already been registered
27 with the same PackageListGuid, then NULL is returned. If there are not enough
28 resources to perform the registration, then NULL is returned. If an empty list
29 of packages is passed in, then NULL is returned. If the size of the list of
30 package is 0, then NULL is returned.
32 @param[in] PackageListGuid An optional parameter that is used to identify
33 the GUID of the package list. If this parameter
34 is NULL, then gEfiCallerIdGuid is used.
35 @param[in] DeviceHandle Optional. If not NULL, the Device Handle on which
36 an instance of DEVICE_PATH_PROTOCOL is installed.
37 This Device Handle uniquely defines the device that
38 the added packages are associated with.
39 @param[in] ... The variable argument list that contains pointers
40 to packages terminated by a NULL.
42 @retval NULL A HII Handle has already been registered in the HII Database with
43 the same PackageListGuid.
44 @retval NULL The HII Handle could not be created.
45 @retval Other The HII Handle associated with the newly registered package list.
51 IN CONST EFI_GUID
*PackageListGuid
, OPTIONAL
52 IN EFI_HANDLE DeviceHandle
, OPTIONAL
57 Removes a package list from the HII Database.
59 If HiiHandle is NULL, then ASSERT().
60 If HiiHandle is not a valid EFI_HII_HANDLE in the HII Database, then ASSERT().
62 @param[in] HiiHandle A handle that was previously registered in the HII Database.
68 IN EFI_HII_HANDLE HiiHandle
72 Retrieves the array of all the HII Handles in the HII Database.
73 This array is terminated with a NULL HII Handle.
74 This function allocates the returned array using AllocatePool().
75 The caller is responsible for freeing the array with FreePool().
77 @param[in] PackageListGuid An optional parameter that is used to request
78 an HII Handle that is associatd with a specific
79 Package List GUID. If this parameter is NULL
80 then all the HII Handles in the HII Database
81 are returned. If this parameter is not NULL
82 then at most 1 HII Handle is returned.
84 @retval NULL There are no HII handles in the HII database
85 @retval NULL The array of HII Handles could not be retrieved
86 @retval Other A pointer to the NULL terminated array of HII Handles
92 IN CONST EFI_GUID
*PackageListGuid OPTIONAL
96 Retrieves a pointer to the a Null-terminated ASCII string containing the list
97 of languages that an HII handle in the HII Database supports. The returned
98 string is allocated using AllocatePool(). The caller is responsible for freeing
99 the returned string using FreePool(). The format of the returned string follows
100 the language format assumed the HII Database.
102 If HiiHandle is NULL, then ASSERT().
104 @param[in] HiiHandle A handle that was previously registered in the HII Database.
106 @retval NULL HiiHandle is not registered in the HII database
107 @retval NULL There are not enough resources available to retrieve the suported
109 @retval NULL The list of suported languages could not be retrieved.
110 @retval Other A pointer to the Null-terminated ASCII string of supported languages.
115 HiiGetSupportedLanguages (
116 IN EFI_HII_HANDLE HiiHandle
120 Retrieves a string from a string package in a specific language. If the language
121 is not specified, then a string from a string package in the current platform
122 language is retrieved. If the string can not be retrieved using the specified
123 language or the current platform language, then the string is retrieved from
124 the string package in the first language the string package supports. The
125 returned string is allocated using AllocatePool(). The caller is responsible
126 for freeing the allocated buffer using FreePool().
128 If HiiHandle is NULL, then ASSERT().
129 If StringId is 0, then ASSET.
131 @param[in] HiiHandle A handle that was previously registered in the HII Database.
132 @param[in] StringId The identifier of the string to retrieved from the string
133 package associated with HiiHandle.
134 @param[in] Language The language of the string to retrieve. If this parameter
135 is NULL, then the current platform language is used. The
136 format of Language must follow the language format assumed
139 @retval NULL The string specified by StringId is not present in the string package.
140 @retval Other The string was returned.
146 IN EFI_HII_HANDLE HiiHandle
,
147 IN EFI_STRING_ID StringId
,
148 IN CONST CHAR8
*Language OPTIONAL
152 Retrieves a string from a string package names by GUID in a specific language.
153 If the language is not specified, then a string from a string package in the
154 current platform language is retrieved. If the string can not be retrieved
155 using the specified language or the current platform language, then the string
156 is retrieved from the string package in the first language the string package
157 supports. The returned string is allocated using AllocatePool(). The caller
158 is responsible for freeing the allocated buffer using FreePool().
160 If PackageListGuid is NULL, then ASSERT().
161 If StringId is 0, then ASSET.
163 @param[in] PackageListGuid The GUID of a package list that was previously
164 registered in the HII Database.
165 @param[in] StringId The identifier of the string to retrieved from the
166 string package associated with PackageListGuid.
167 @param[in] Language The language of the string to retrieve. If this
168 parameter is NULL, then the current platform
169 language is used. The format of Language must
170 follow the language format assumed the HII Database.
172 @retval NULL The package list specified by PackageListGuid is not present in the
174 @retval NULL The string specified by StringId is not present in the string package.
175 @retval Other The string was returned.
180 HiiGetPackageString (
181 IN CONST EFI_GUID
*PackageListGuid
,
182 IN EFI_STRING_ID StringId
,
183 IN CONST CHAR8
*Language OPTIONAL
187 This function create a new string in String Package or updates an existing
188 string in a String Package. If StringId is 0, then a new string is added to
189 a String Package. If StringId is not zero, then a string in String Package is
190 updated. If SupportedLanguages is NULL, then the string is added or updated
191 for all the languages that the String Package supports. If SupportedLanguages
192 is not NULL, then the string is added or updated for the set of languages
193 specified by SupportedLanguages.
195 If HiiHandle is NULL, then ASSERT().
196 If String is NULL, then ASSERT().
198 @param[in] HiiHandle A handle that was previously registered in the
200 @param[in] StringId If zero, then a new string is created in the
201 String Package associated with HiiHandle. If
202 non-zero, then the string specified by StringId
203 is updated in the String Package associated
205 @param[in] String A pointer to the Null-terminated Unicode string
206 to add or update in the String Package associated
208 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string of
209 language codes. If this parameter is NULL, then
210 String is added or updated in the String Package
211 associated with HiiHandle for all the languages
212 that the String Package supports. If this
213 parameter is not NULL, then then String is added
214 or updated in the String Package associated with
215 HiiHandle for the set oflanguages specified by
216 SupportedLanguages. The format of
217 SupportedLanguages must follow the language
218 format assumed the HII Database.
220 @retval 0 The string could not be added or updated in the String Package.
221 @retval Other The EFI_STRING_ID of the newly added or updated string.
227 IN EFI_HII_HANDLE HiiHandle
,
228 IN EFI_STRING_ID StringId
, OPTIONAL
229 IN CONST EFI_STRING String
,
230 IN CONST CHAR8
*SupportedLanguages OPTIONAL
234 Validates the config data associated with an HII handle in the HII Database.
236 If HiiHandle is NULL, then ASSERT().
238 @param[in] HiiHandle A handle that was previously registered in the HII Database.
240 @retval TRUE The config data associated with HiiHandle passes all validation
242 @retval FALSE The config data associated with HiiHandle failed one or more
248 HiiValidateDataFromHiiHandle (
249 IN EFI_HII_HANDLE HiiHandle
253 Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing
254 information that includes a GUID, an optional Unicode string name, and a device
255 path. The string returned is allocated with AllocatePool(). The caller is
256 responsible for freeing the allocated string with FreePool().
258 The format of a <ConfigHdr> is as follows:
260 GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize<Null>
262 @param[in] Guid Pointer to an EFI_GUID that is the routing information
263 GUID. Each of the 16 bytes in Guid is converted to
264 a 2 Unicode character hexidecimal string. This is
265 an optional parameter that may be NULL.
266 @param[in] Name Pointer to a Null-terminated Unicode string that is
267 the routing information NAME. This is an optional
268 parameter that may be NULL. Each 16-bit Unicode
269 character in Name is converted to a 4 character Unicode
271 @param[in] DriverHandle The driver handle which supports a Device Path Protocol
272 that is the routing information PATH. Each byte of
273 the Device Path associated with DriverHandle is converted
274 to a 2 Unicode character hexidecimal string.
276 @retval NULL DriverHandle does not support the Device Path Protocol.
277 @retval NULL DriverHandle does not support the Device Path Protocol.
278 @retval Other A pointer to the Null-terminate Unicode <ConfigHdr> string
283 HiiConstructConfigHdr (
284 IN CONST EFI_GUID
*Guid
, OPTIONAL
285 IN CONST CHAR16
*Name
, OPTIONAL
286 IN EFI_HANDLE DriverHandle
290 Allocates and returns a Null-terminated Unicode <ConfigAltResp> string.
292 If Guid is NULL, then ASSERT().
293 If Name is NULL, then ASSERT().
294 If BlockNameArray is NULL, then ASSERT().
296 @param[in] Guid GUID of the buffer storage.
297 @param[in] Name Name of the buffer storage.
298 @param[in] DriverHandle The DriverHandle that support a Device Path
300 @param[in] BufferStorage Content of the buffer storage.
301 @param[in] BufferStorageSize Length in bytes of the buffer storage.
302 @param[in] BlockNameArray Array generated by VFR compiler. This array
303 contains a UINT32 value that is the length
304 of BlockNameArray in bytes, followed by pairs
305 of 16-bit values that are the offset and length
306 values used to contruct a <ConfigRequest> string.
307 @param[in] ... A variable argument list that contains pairs of 16-bit
308 ALTCFG identifiers and pointers to DefaultValueArrays.
309 The variable argument list is terminated by a NULL
310 DefaultValueArray pointer. A DefaultValueArray
311 contains a UINT32 value that is the length, in bytes,
312 of the DefaultValueArray. The UINT32 length value
313 is followed by a series of records that contain
314 a 16-bit WIDTH value followed by a byte array with
315 WIDTH entries. The records must be parsed from
316 beginning to end until the UINT32 length limit
319 @retval NULL There are not enough resources to process the request.
320 @retval NULL A <ConfigResp> could not be retrieved from the Config
322 @retval Other A pointer to the Null-terminate Unicode <ConfigAltResp>
328 HiiConstructConfigAltResp (
329 IN CONST EFI_GUID
*Guid
,
330 IN CONST CHAR16
*Name
,
331 IN EFI_HANDLE DriverHandle
,
332 IN CONST VOID
*BufferStorage
,
333 IN UINTN BufferStorageSize
,
334 IN CONST VOID
*BlockNameArray
,
339 Determines if the routing data specified by GUID and NAME match a <ConfigHdr>.
341 If ConfigHdr is NULL, then ASSERT().
343 @param[in] ConfigHdr Either <ConfigRequest> or <ConfigResp>.
344 @param[in] Guid GUID of the storage.
345 @param[in] Name NAME of the storage.
347 @retval TRUE Routing information matches <ConfigHdr>.
348 @retval FALSE Routing information does not match <ConfigHdr>.
353 HiiIsConfigHdrMatch (
354 IN CONST EFI_STRING ConfigHdr
,
355 IN CONST EFI_GUID
*Guid
, OPTIONAL
356 IN CONST CHAR16
*Name OPTIONAL
360 Retrieves uncommited data from the Form Browser and converts it to a binary
361 buffer. The returned buffer is allocated using AllocatePool(). The caller
362 is responsible for freeing the returned buffer using FreePool().
364 @param[in] VariableName Pointer to a Null-terminated Unicode string. This
365 is an optional parameter that may be NULL.
366 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional
367 parameter that may be NULL.
368 @param[in] BufferSize Length in bytes of buffer to hold retrived data.
370 @retval NULL The uncommitted data could not be retrieved.
371 @retval Other A pointer to a buffer containing the uncommitted data.
377 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
378 IN CONST CHAR16
*VariableName
, OPTIONAL
383 Updates uncommitted data in the Form Browser.
385 If Buffer is NULL, then ASSERT().
387 @param[in] VariableName Pointer to a Null-terminated Unicode string. This
388 is an optional parameter that may be NULL.
389 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional
390 parameter that may be NULL.
391 @param[in] BufferSize Length, in bytes, of Buffer.
392 @param[in] Buffer Buffer of data to commit.
393 @param[in] RequestElement An optional field to specify which part of the
394 buffer data will be send back to Browser. If NULL,
395 the whole buffer of data will be committed to
397 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*
399 @retval FALSE The uncommitted data could not be updated.
400 @retval TRUE The uncommitted data was updated.
406 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
407 IN CONST CHAR16
*VariableName
, OPTIONAL
409 IN CONST UINT8
*Buffer
,
410 IN CONST CHAR16
*RequestElement OPTIONAL
413 /////////////////////////////////////////
414 /////////////////////////////////////////
416 /////////////////////////////////////////
417 /////////////////////////////////////////
420 Returns a UINT64 value that contains bitfields for Hour, Minute, and Second.
421 The lower 8-bits of Hour are placed in bits 0..7. The lower 8-bits of Minute
422 are placed in bits 8..15, and the lower 8-bits of Second are placed in bits
423 16..23. This format is selected because it can be easily translated to
424 an EFI_HII_TIME structure in an EFI_IFR_TYPE_VALUE union.
426 @param Hour The hour value to be encoded.
427 @param Minute The miniute value to be encoded.
428 @param Second The second value to be encoded.
430 @return A 64-bit containing Hour, Minute, and Second.
432 #define EFI_HII_TIME_UINT64(Hour, Minute, Second) \
433 (UINT64)((Hour & 0xff) | ((Minute & 0xff) << 8) | ((Second & 0xff) << 16))
436 Returns a UINT64 value that contains bitfields for Year, Month, and Day.
437 The lower 16-bits of Year are placed in bits 0..15. The lower 8-bits of Month
438 are placed in bits 16..23, and the lower 8-bits of Day are placed in bits
439 24..31. This format is selected because it can be easily translated to
440 an EFI_HII_DATE structure in an EFI_IFR_TYPE_VALUE union.
442 @param Year The year value to be encoded.
443 @param Month The month value to be encoded.
444 @param Day The day value to be encoded.
446 @return A 64-bit containing Year, Month, and Day.
448 #define EFI_HII_DATE_UINT64(Year, Month, Day) \
449 (UINT64)((Year & 0xffff) | ((Month & 0xff) << 16) | ((Day & 0xff) << 24))
452 Allocates and returns a new OpCode Handle. OpCode Handles must be freed with
453 HiiFreeOpCodeHandle().
455 @retval NULL There are not enough resources to allocate a new OpCode Handle.
456 @retval Other A new OpCode handle.
461 HiiAllocateOpCodeHandle (
466 Frees an OpCode Handle that was peviously allocated with HiiAllocateOpCodeHandle().
467 When an OpCode Handle is freed, all of the opcodes associated with the OpCode
468 Handle are also freed.
470 If OpCodeHandle is NULL, then ASSERT().
475 HiiFreeOpCodeHandle (
480 Create EFI_IFR_END_OP opcode.
482 If OpCodeHandle is NULL, then ASSERT().
484 @param[in] OpCodeHandle Handle to the buffer of opcodes.
486 @retval NULL There is not enough space left in Buffer to add the opcode.
487 @retval Other A pointer to the created opcode.
493 IN VOID
*OpCodeHandle
497 Create EFI_IFR_ONE_OF_OPTION_OP opcode.
499 If OpCodeHandle is NULL, then ASSERT().
500 If Type is invalid, then ASSERT().
501 If Flags is invalid, then ASSERT().
503 @param[in] OpCodeHandle Handle to the buffer of opcodes.
504 @param[in] StringId StringId for the option
505 @param[in] Flags Flags for the option
506 @param[in] Type Type for the option
507 @param[in] Value Value for the option
509 @retval NULL There is not enough space left in Buffer to add the opcode.
510 @retval Other A pointer to the created opcode.
515 HiiCreateOneOfOptionOpCode (
516 IN VOID
*OpCodeHandle
,
524 Create EFI_IFR_DEFAULT_OP opcode.
526 If OpCodeHandle is NULL, then ASSERT().
527 If Type is invalid, then ASSERT().
529 @param[in] OpCodeHandle Handle to the buffer of opcodes.
530 @param[in] DefaultId DefaultId for the default
531 @param[in] Type Type for the default
532 @param[in] Value Value for the default
534 @retval NULL There is not enough space left in Buffer to add the opcode.
535 @retval Other A pointer to the created opcode.
540 HiiCreateDefaultOpCode (
541 IN VOID
*OpCodeHandle
,
548 Create EFI_IFR_GUID opcode.
550 If OpCodeHandle is NULL, then ASSERT().
551 If Guid is NULL, then ASSERT().
552 If OpCodeSize < sizeof (EFI_IFR_GUID), then ASSERT().
554 @param[in] OpCodeHandle Handle to the buffer of opcodes.
555 @param[in] Guid Pointer to EFI_GUID of this guided opcode.
556 @param[in] GuidOpCode Pointer to an EFI_IFR_GUID opcode. This is an
557 optional parameter that may be NULL. If this
558 parameter is NULL, then the GUID extension
559 region of the created opcode is filled with zeros.
560 If this parameter is not NULL, then the GUID
561 extension region of GuidData will be copied to
562 the GUID extension region of the created opcode.
563 @param[in] OpCodeSize The size, in bytes, of created opcode. This value
564 must be >= sizeof(EFI_IFR_GUID).
566 @retval NULL There is not enough space left in Buffer to add the opcode.
567 @retval Other A pointer to the created opcode.
572 HiiCreateGuidOpCode (
573 IN VOID
*OpCodeHandle
,
574 IN CONST EFI_GUID
*Guid
,
575 IN CONST VOID
*GuidOpCode
, OPTIONAL
580 Create EFI_IFR_ACTION_OP opcode.
582 If OpCodeHandle is NULL, then ASSERT().
583 If any reserved bits are set in QuestionFlags, then ASSERT().
585 @param[in] OpCodeHandle Handle to the buffer of opcodes.
586 @param[in] QuestionId Question ID
587 @param[in] Prompt String ID for Prompt
588 @param[in] Help String ID for Help
589 @param[in] QuestionFlags Flags in Question Header
590 @param[in] QuestionConfig String ID for configuration
592 @retval NULL There is not enough space left in Buffer to add the opcode.
593 @retval Other A pointer to the created opcode.
598 HiiCreateActionOpCode (
599 IN VOID
*OpCodeHandle
,
600 IN EFI_QUESTION_ID QuestionId
,
601 IN EFI_STRING_ID Prompt
,
602 IN EFI_STRING_ID Help
,
603 IN UINT8 QuestionFlags
,
604 IN EFI_STRING_ID QuestionConfig
608 Create EFI_IFR_SUBTITLE_OP opcode.
610 If OpCodeHandle is NULL, then ASSERT().
611 If any reserved bits are set in Flags, then ASSERT().
612 If Scope > 1, then ASSERT().
614 @param[in] OpCodeHandle Handle to the buffer of opcodes.
615 @param[in] Prompt String ID for Prompt
616 @param[in] Help String ID for Help
617 @param[in] Flags Subtitle opcode flags
618 @param[in] Scope 1 if this opcpde is the beginning of a new scope.
619 0 if this opcode is within the current scope.
621 @retval NULL There is not enough space left in Buffer to add the opcode.
622 @retval Other A pointer to the created opcode.
627 HiiCreateSubTitleOpCode (
628 IN VOID
*OpCodeHandle
,
629 IN EFI_STRING_ID Prompt
,
630 IN EFI_STRING_ID Help
,
636 Create EFI_IFR_REF_OP opcode.
638 If OpCodeHandle is NULL, then ASSERT().
639 If any reserved bits are set in QuestionFlags, then ASSERT().
641 @param[in] OpCodeHandle Handle to the buffer of opcodes.
642 @param[in] FormId Destination Form ID
643 @param[in] Prompt String ID for Prompt
644 @param[in] Help String ID for Help
645 @param[in] QuestionFlags Flags in Question Header
646 @param[in] QuestionId Question ID
648 @retval NULL There is not enough space left in Buffer to add the opcode.
649 @retval Other A pointer to the created opcode.
654 HiiCreateGotoOpCode (
655 IN VOID
*OpCodeHandle
,
656 IN EFI_FORM_ID FormId
,
657 IN EFI_STRING_ID Prompt
,
658 IN EFI_STRING_ID Help
,
659 IN UINT8 QuestionFlags
,
660 IN EFI_QUESTION_ID QuestionId
664 Create EFI_IFR_CHECKBOX_OP opcode.
666 If OpCodeHandle is NULL, then ASSERT().
667 If any reserved bits are set in QuestionFlags, then ASSERT().
668 If any reserved bits are set in CheckBoxFlags, then ASSERT().
670 @param[in] OpCodeHandle Handle to the buffer of opcodes.
671 @param[in] QuestionId Question ID
672 @param[in] VarStoreId Storage ID
673 @param[in] VarOffset Offset in Storage
674 @param[in] Prompt String ID for Prompt
675 @param[in] Help String ID for Help
676 @param[in] QuestionFlags Flags in Question Header
677 @param[in] CheckBoxFlags Flags for checkbox opcode
678 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
679 is an optional parameter that may be NULL.
681 @retval NULL There is not enough space left in Buffer to add the opcode.
682 @retval Other A pointer to the created opcode.
687 HiiCreateCheckBoxOpCode (
688 IN VOID
*OpCodeHandle
,
689 IN EFI_QUESTION_ID QuestionId
,
690 IN EFI_VARSTORE_ID VarStoreId
,
692 IN EFI_STRING_ID Prompt
,
693 IN EFI_STRING_ID Help
,
694 IN UINT8 QuestionFlags
,
695 IN UINT8 CheckBoxFlags
,
696 IN VOID
*DefaultsOpCodeHandle OPTIONAL
700 Create EFI_IFR_NUMERIC_OP opcode.
702 If OpCodeHandle is NULL, then ASSERT().
703 If any reserved bits are set in QuestionFlags, then ASSERT().
704 If any reserved bits are set in NumericFlags, then ASSERT().
706 @param[in] OpCodeHandle Handle to the buffer of opcodes.
707 @param[in] QuestionId Question ID
708 @param[in] VarStoreId Storage ID
709 @param[in] VarOffset Offset in Storage
710 @param[in] Prompt String ID for Prompt
711 @param[in] Help String ID for Help
712 @param[in] QuestionFlags Flags in Question Header
713 @param[in] NumericFlags Flags for numeric opcode
714 @param[in] Minimum Numeric minimum value
715 @param[in] Maximum Numeric maximum value
716 @param[in] Step Numeric step for edit
717 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
718 is an optional parameter that may be NULL.
720 @retval NULL There is not enough space left in Buffer to add the opcode.
721 @retval Other A pointer to the created opcode.
726 HiiCreateNumericOpCode (
727 IN VOID
*OpCodeHandle
,
728 IN EFI_QUESTION_ID QuestionId
,
729 IN EFI_VARSTORE_ID VarStoreId
,
731 IN EFI_STRING_ID Prompt
,
732 IN EFI_STRING_ID Help
,
733 IN UINT8 QuestionFlags
,
734 IN UINT8 NumericFlags
,
738 IN VOID
*DefaultsOpCodeHandle OPTIONAL
742 Create EFI_IFR_STRING_OP opcode.
744 If OpCodeHandle is NULL, then ASSERT().
745 If any reserved bits are set in QuestionFlags, then ASSERT().
746 If any reserved bits are set in StringFlags, then ASSERT().
748 @param[in] OpCodeHandle Handle to the buffer of opcodes.
749 @param[in] QuestionId Question ID
750 @param[in] VarStoreId Storage ID
751 @param[in] VarOffset Offset in Storage
752 @param[in] Prompt String ID for Prompt
753 @param[in] Help String ID for Help
754 @param[in] QuestionFlags Flags in Question Header
755 @param[in] StringFlags Flags for string opcode
756 @param[in] MinSize String minimum length
757 @param[in] MaxSize String maximum length
758 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
759 is an optional parameter that may be NULL.
761 @retval NULL There is not enough space left in Buffer to add the opcode.
762 @retval Other A pointer to the created opcode.
767 HiiCreateStringOpCode (
768 IN VOID
*OpCodeHandle
,
769 IN EFI_QUESTION_ID QuestionId
,
770 IN EFI_VARSTORE_ID VarStoreId
,
772 IN EFI_STRING_ID Prompt
,
773 IN EFI_STRING_ID Help
,
774 IN UINT8 QuestionFlags
,
775 IN UINT8 StringFlags
,
778 IN VOID
*DefaultsOpCodeHandle OPTIONAL
782 Create EFI_IFR_ONE_OF_OP opcode.
784 If OpCodeHandle is NULL, then ASSERT().
785 If any reserved bits are set in QuestionFlags, then ASSERT().
786 If any reserved bits are set in OneOfFlags, then ASSERT().
788 @param[in] OpCodeHandle Handle to the buffer of opcodes.
789 @param[in] QuestionId Question ID
790 @param[in] VarStoreId Storage ID
791 @param[in] VarOffset Offset in Storage
792 @param[in] Prompt String ID for Prompt
793 @param[in] Help String ID for Help
794 @param[in] QuestionFlags Flags in Question Header
795 @param[in] OneOfFlags Flags for oneof opcode
796 @param[in] OptionsOpCodeHandle Handle for a buffer of ONE_OF_OPTION opcodes.
797 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
798 is an optional parameter that may be NULL.
800 @retval NULL There is not enough space left in Buffer to add the opcode.
801 @retval Other A pointer to the created opcode.
806 HiiCreateOneOfOpCode (
807 IN VOID
*OpCodeHandle
,
808 IN EFI_QUESTION_ID QuestionId
,
809 IN EFI_VARSTORE_ID VarStoreId
,
811 IN EFI_STRING_ID Prompt
,
812 IN EFI_STRING_ID Help
,
813 IN UINT8 QuestionFlags
,
815 IN VOID
*OptionsOpCodeHandle
,
816 IN VOID
*DefaultsOpCodeHandle OPTIONAL
820 Create EFI_IFR_ORDERED_LIST_OP opcode.
822 If OpCodeHandle is NULL, then ASSERT().
823 If any reserved bits are set in QuestionFlags, then ASSERT().
824 If any reserved bits are set in OrderedListFlags, then ASSERT().
826 @param[in] OpCodeHandle Handle to the buffer of opcodes.
827 @param[in] QuestionId Question ID
828 @param[in] VarStoreId Storage ID
829 @param[in] VarOffset Offset in Storage
830 @param[in] Prompt String ID for Prompt
831 @param[in] Help String ID for Help
832 @param[in] QuestionFlags Flags in Question Header
833 @param[in] OrderedListFlags Flags for ordered list opcode
834 @param[in] DataType Type for option value
835 @param[in] MaxContainers Maximum count for options in this ordered list
836 @param[in] OptionsOpCodeHandle Handle for a buffer of ONE_OF_OPTION opcodes.
837 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
838 is an optional parameter that may be NULL.
840 @retval NULL There is not enough space left in Buffer to add the opcode.
841 @retval Other A pointer to the created opcode.
846 HiiCreateOrderedListOpCode (
847 IN VOID
*OpCodeHandle
,
848 IN EFI_QUESTION_ID QuestionId
,
849 IN EFI_VARSTORE_ID VarStoreId
,
851 IN EFI_STRING_ID Prompt
,
852 IN EFI_STRING_ID Help
,
853 IN UINT8 QuestionFlags
,
854 IN UINT8 OrderedListFlags
,
856 IN UINT8 MaxContainers
,
857 IN VOID
*OptionsOpCodeHandle
,
858 IN VOID
*DefaultsOpCodeHandle OPTIONAL
862 This function updates a form that has previously been registered with the HII
863 Database. This function will perform at most one update operation.
865 The form to update is specified by Handle, FormSetGuid, and FormId. Binary
866 comparisons of IFR opcodes are performed from the beginning of the form being
867 updated until an IFR opcode is found that exactly matches the first IFR opcode
868 specifed by StartOpCodeHandle. The following rules are used to determine if
869 an insert, replace, or delete operation is performed.
871 1) If no matches are found, then NULL is returned.
872 2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes
873 from StartOpcodeHandle except the first opcode are inserted immediately after
874 the matching IFR opcode in the form beng updated.
875 3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made
876 from the matching IFR opcode until an IFR opcode exatly matches the first
877 IFR opcode specified by EndOpCodeHandle. If no match is found for the first
878 IFR opcode specified by EndOpCodeHandle, then NULL is returned. If a match
879 is found, then all of the IFR opcodes between the start match and the end
880 match are deleted from the form being updated and all of the IFR opcodes
881 from StartOpcodeHandle except the first opcode are inserted immediately after
882 the matching start IFR opcode. If StartOpCcodeHandle only contains one
883 IFR instruction, then the result of ths operation will delete all of the IFR
884 opcodes between the start end matches.
886 If HiiHandle is NULL, then ASSERT().
887 If StartOpCodeHandle is NULL, then ASSERT().
889 @param[in] HiiHandle The HII Handle of the form to update.
890 @param[in] FormSetGuid The Formset GUID of the form to update. This
891 is an optional parameter that may be NULL.
892 If it is NULL, all FormSet will be updated.
893 @param[in] FormId The ID of the form to update.
894 @param[in] StartOpCodeHandle An OpCode Handle that contains the set of IFR
895 opcodes to be inserted or replaced in the form.
896 The first IFR instruction in StartOpCodeHandle
897 is used to find matching IFR opcode in the
899 @param[in] EndOpCodeHandle An OpCcode Handle that contains the IFR opcode
900 that marks the end of a replace operation in
901 the form. This is an optional parameter that
902 may be NULL. If it is NULL, then an the IFR
903 opcodes specified by StartOpCodeHandle are
904 inserted into the form.
906 @retval EFI_OUT_OF_RESOURCES No enough memory resource is allocated.
907 @retval EFI_NOT_FOUND The following cases will return EFI_NOT_FOUND.
908 1) The form specified by HiiHandle, FormSetGuid,
909 and FormId could not be found in the HII Database.
910 2) No IFR opcodes in the target form match the first
911 IFR opcode in StartOpCodeHandle.
912 3) EndOpCOde is not NULL, and no IFR opcodes in the
913 target form following a matching start opcode match
914 the first IFR opcode in EndOpCodeHandle.
915 @retval EFI_SUCCESS The matched form is updated by StartOpcode.
921 IN EFI_HII_HANDLE HiiHandle
,
922 IN EFI_GUID
*FormSetGuid
, OPTIONAL
923 IN EFI_FORM_ID FormId
,
924 IN VOID
*StartOpcodeHandle
,
925 IN VOID
*EndOpcodeHandle OPTIONAL
929 Configure the buffer accrording to ConfigBody strings in the format of
930 <Length:4 bytes>, <Offset: 2 bytes>, <Width:2 bytes>, <Data:n bytes>.
931 This ConfigBody strings is generated by EDKII UEFI VfrCompiler for the default
932 values in a Form Set. The name of the ConfigBody strings is VfrMyIfrNVDataDefault0000
933 constructed following this rule:
934 "Vfr" + varstore.name + "Default" + defaultstore.attributes.
935 Check the generated C file in Output for details.
937 @param Buffer the start address of buffer.
938 @param BufferSize the size of buffer.
939 @param Number the number of the ConfigBody strings.
940 @param ... the ConfigBody strings
942 @retval EFI_BUFFER_TOO_SMALL the BufferSize is too small to operate.
943 @retval EFI_INVALID_PARAMETER Buffer is NULL or BufferSize is 0.
944 @retval EFI_SUCCESS Operation successful.
949 IfrLibExtractDefault(
951 IN UINTN
*BufferSize
,