]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/HiiLib.h
Merge new defined HII library APIs into HiiLib
[mirror_edk2.git] / MdeModulePkg / Include / Library / HiiLib.h
1 /** @file
2 Public include file for the HII Library
3
4 Copyright (c) 2007 - 2008, Intel Corporation
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
9
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.
12
13 **/
14
15 #ifndef __HII_LIB_H__
16 #define __HII_LIB_H__
17
18
19 /**
20 Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.
21
22 If GuidId is NULL, then ASSERT.
23 If not enough resource to complete the operation, then ASSERT.
24
25 @param NumberOfPackages Number of packages.
26 @param GuidId Package GUID.
27 @param ... Variable argument list for packages to be assembled.
28
29 @return Pointer of EFI_HII_PACKAGE_LIST_HEADER.
30
31 **/
32 EFI_HII_PACKAGE_LIST_HEADER *
33 EFIAPI
34 HiiLibPreparePackageList (
35 IN UINTN NumberOfPackages,
36 IN CONST EFI_GUID *GuidId,
37 ...
38 )
39 ;
40
41 /**
42 This function allocates pool for an EFI_HII_PACKAGE_LIST structure
43 with additional space that is big enough to host all packages described by the variable
44 argument list of package pointers. The allocated structure is initialized using NumberOfPackages,
45 GuidId, and the variable length argument list of package pointers.
46
47 Then, EFI_HII_PACKAGE_LIST will be register to the default System HII Database. The
48 Handle to the newly registered Package List is returned throught HiiHandle.
49
50 If HiiHandle is NULL, then ASSERT.
51
52 @param NumberOfPackages The number of HII packages to register.
53 @param GuidId Package List GUID ID.
54 @param DriverHandle Optional. If not NULL, the DriverHandle on which an instance of DEVICE_PATH_PROTOCOL is installed.
55 This DriverHandle uniquely defines the device that the added packages are associated with.
56 @param HiiHandle On output, the HiiHandle is update with the handle which can be used to retrieve the Package
57 List later. If the functions failed to add the package to the default HII database, this value will
58 be set to NULL.
59 @param ... The variable argument list describing all HII Package.
60
61 @return EFI_SUCCESS If the packages are successfully added to the default HII database.
62 @return EFI_OUT_OF_RESOURCE Not enough resource to complete the operation.
63
64 **/
65 EFI_STATUS
66 EFIAPI
67 HiiLibAddPackages (
68 IN UINTN NumberOfPackages,
69 IN CONST EFI_GUID *GuidId,
70 IN EFI_HANDLE DriverHandle, OPTIONAL
71 OUT EFI_HII_HANDLE *HiiHandle,
72 ...
73 )
74 ;
75
76 /**
77 Removes a package list from the default HII database.
78
79 If HiiHandle is NULL, then ASSERT.
80 If HiiHandle is not a valid EFI_HII_HANDLE in the default HII database, then ASSERT.
81
82 @param HiiHandle The handle that was previously registered to the data base that is requested for removal.
83 List later.
84
85 **/
86 VOID
87 EFIAPI
88 HiiLibRemovePackages (
89 IN EFI_HII_HANDLE HiiHandle
90 )
91 ;
92
93 /**
94 This function adds the string into String Package of each language
95 supported by the package list.
96
97 If String is NULL, then ASSERT.
98 If StringId is NULL, the ASSERT.
99 If PackageList could not be found in the default HII database, then ASSERT.
100
101 @param PackageList Handle of the package list where this string will
102 be added.
103 @param StringId On return, contains the new strings id, which is
104 unique within PackageList.
105 @param String Points to the new null-terminated string.
106
107 @retval EFI_SUCCESS The new string was added successfully.
108 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources.
109
110 **/
111 EFI_STATUS
112 EFIAPI
113 HiiLibNewString (
114 IN EFI_HII_HANDLE PackageList,
115 OUT EFI_STRING_ID *StringId,
116 IN CONST EFI_STRING String
117 )
118 ;
119
120 /**
121 This function update the specified string in String Package of each language
122 supported by the package list.
123
124 If String is NULL, then ASSERT.
125 If PackageList could not be found in the default HII database, then ASSERT.
126 If StringId is not found in PackageList, then ASSERT.
127
128 @param PackageList Handle of the package list where this string will
129 be added.
130 @param StringId Ths String Id to be updated.
131 @param String Points to the new null-terminated string.
132
133 @retval EFI_SUCCESS The new string was added successfully.
134 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources.
135
136 **/
137 EFI_STATUS
138 EFIAPI
139 HiiLibSetString (
140 IN EFI_HII_HANDLE PackageList,
141 IN EFI_STRING_ID StringId,
142 IN CONST EFI_STRING String
143 )
144 ;
145
146 /**
147 This function try to retrieve string from String package of current language.
148 If fails, it try to retrieve string from String package of first language it support.
149
150 If StringSize is NULL, then ASSERT.
151 If String is NULL and *StringSize is not 0, then ASSERT.
152 If PackageList could not be found in the default HII database, then ASSERT.
153 If StringId is not found in PackageList, then ASSERT.
154
155 @param PackageList The package list in the HII database to search for
156 the specified string.
157 @param StringId The string's id, which is unique within
158 PackageList.
159 @param String Points to the new null-terminated string.
160 @param StringSize On entry, points to the size of the buffer pointed
161 to by String, in bytes. On return, points to the
162 length of the string, in bytes.
163
164 @retval EFI_SUCCESS The string was returned successfully.
165 @retval EFI_NOT_FOUND The string specified by StringId is not available.
166 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringLength is too small
167 to hold the string.
168
169 **/
170 EFI_STATUS
171 EFIAPI
172 HiiLibGetString (
173 IN EFI_HII_HANDLE PackageList,
174 IN EFI_STRING_ID StringId,
175 OUT EFI_STRING String,
176 IN OUT UINTN *StringSize
177 )
178 ;
179
180 /**
181 Get string specified by StringId form the HiiHandle. The caller
182 is responsible to free the *String.
183
184 If String is NULL, then ASSERT.
185 If HiiHandle could not be found in the default HII database, then ASSERT.
186 If StringId is not found in PackageList, then ASSERT.
187
188 @param HiiHandle The HII handle of package list.
189 @param StringId The String ID.
190 @param String The output string.
191
192 @retval EFI_NOT_FOUND String is not found.
193 @retval EFI_SUCCESS Operation is successful.
194 @retval EFI_OUT_OF_RESOURCES There is not enought memory in the system.
195
196 **/
197 EFI_STATUS
198 EFIAPI
199 HiiLibGetStringFromHandle (
200 IN EFI_HII_HANDLE HiiHandle,
201 IN EFI_STRING_ID StringId,
202 OUT EFI_STRING *String
203 )
204 ;
205
206 /**
207 Get the string given the StringId and String package Producer's Guid. The caller
208 is responsible to free the *String.
209
210 If PackageList with the matching ProducerGuid is not found, then ASSERT.
211 If PackageList with the matching ProducerGuid is found but no String is
212 specified by StringId is found, then ASSERT.
213
214 @param ProducerGuid The Guid of String package list.
215 @param StringId The String ID.
216 @param String The output string.
217
218 @retval EFI_SUCCESS Operation is successful.
219 @retval EFI_OUT_OF_RESOURCES There is not enought memory in the system.
220
221 **/
222 EFI_STATUS
223 EFIAPI
224 HiiLibGetStringFromToken (
225 IN EFI_GUID *ProducerGuid,
226 IN EFI_STRING_ID StringId,
227 OUT EFI_STRING *String
228 )
229 ;
230
231 /**
232 Determines the handles that are currently active in the database.
233 It's the caller's responsibility to free handle buffer.
234
235 If HandleBufferLength is NULL, then ASSERT.
236 If HiiHandleBuffer is NULL, then ASSERT.
237
238 @param HandleBufferLength On input, a pointer to the length of the handle
239 buffer. On output, the length of the handle buffer
240 that is required for the handles found.
241 @param HiiHandleBuffer Pointer to an array of Hii Handles returned.
242
243 @retval EFI_SUCCESS Get an array of Hii Handles successfully.
244
245 **/
246 EFI_STATUS
247 EFIAPI
248 HiiLibGetHiiHandles (
249 IN OUT UINTN *HandleBufferLength,
250 OUT EFI_HII_HANDLE **HiiHandleBuffer
251 )
252 ;
253
254 /**
255 Extract Hii package list GUID for given HII handle.
256
257 If HiiHandle could not be found in the default HII database, then ASSERT.
258 If Guid is NULL, then ASSERT.
259
260 @param Handle Hii handle
261 @param Guid Package list GUID
262
263 @retval EFI_SUCCESS Successfully extract GUID from Hii database.
264
265 **/
266 EFI_STATUS
267 EFIAPI
268 HiiLibExtractGuidFromHiiHandle (
269 IN EFI_HII_HANDLE Handle,
270 OUT EFI_GUID *Guid
271 )
272 ;
273
274 /**
275 Find HII Handle in the default HII database associated with given Device Path.
276
277 If DevicePath is NULL, then ASSERT.
278
279 @param DevicePath Device Path associated with the HII package list
280 handle.
281
282 @retval Handle HII package list Handle associated with the Device
283 Path.
284 @retval NULL Hii Package list handle is not found.
285
286 **/
287 EFI_HII_HANDLE
288 EFIAPI
289 HiiLibDevicePathToHiiHandle (
290 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
291 )
292 ;
293
294
295 /**
296 Get next language from language code list (with separator ';').
297
298 If LangCode is NULL, then ASSERT.
299 If Lang is NULL, then ASSERT.
300
301 @param LangCode On input: point to first language in the list. On
302 output: point to next language in the list, or
303 NULL if no more language in the list.
304 @param Lang The first language in the list.
305
306 **/
307 VOID
308 EFIAPI
309 HiiLibGetNextLanguage (
310 IN OUT CHAR8 **LangCode,
311 OUT CHAR8 *Lang
312 )
313 ;
314
315 /**
316 This function returns the list of supported languages, in the format specified
317 in UEFI specification Appendix M.
318
319 If HiiHandle is not a valid Handle in the default HII database, then ASSERT.
320
321 @param HiiHandle The HII package list handle.
322
323 @retval !NULL The supported languages.
324 @retval NULL If Supported Languages can not be retrived.
325
326 **/
327 CHAR8 *
328 EFIAPI
329 HiiLibGetSupportedLanguages (
330 IN EFI_HII_HANDLE HiiHandle
331 )
332 ;
333
334 /**
335 This function returns the list of supported 2nd languages, in the format specified
336 in UEFI specification Appendix M.
337
338 If HiiHandle is not a valid Handle in the default HII database, then ASSERT.
339 If not enough resource to complete the operation, then ASSERT.
340
341 @param HiiHandle The HII package list handle.
342 @param FirstLanguage Pointer to language name buffer.
343
344 @return The supported languages.
345
346 **/
347 CHAR8 *
348 EFIAPI
349 HiiLibGetSupportedSecondaryLanguages (
350 IN EFI_HII_HANDLE HiiHandle,
351 IN CONST CHAR8 *FirstLanguage
352 )
353 ;
354
355
356 /**
357 This function returns the number of supported languages on HiiHandle.
358
359 If HiiHandle is not a valid Handle in the default HII database, then ASSERT.
360 If not enough resource to complete the operation, then ASSERT.
361
362 @param HiiHandle The HII package list handle.
363
364 @return The number of supported languages.
365
366 **/
367 UINT16
368 EFIAPI
369 HiiLibGetSupportedLanguageNumber (
370 IN EFI_HII_HANDLE HiiHandle
371 )
372 ;
373
374 /**
375 Exports the contents of one or all package lists in the HII database into a buffer.
376
377 If Handle is not NULL and not a valid EFI_HII_HANDLE registered in the database,
378 then ASSERT.
379 If PackageListHeader is NULL, then ASSERT.
380 If PackageListSize is NULL, then ASSERT.
381
382 @param Handle The HII Handle.
383 @param PackageListHeader A pointer to a buffer that will contain the results of
384 the export function.
385 @param PackageListSize On output, the length of the buffer that is required for the exported data.
386
387 @retval EFI_SUCCESS Package exported.
388
389 @retval EFI_OUT_OF_RESOURCES Not enought memory to complete the operations.
390
391 **/
392 EFI_STATUS
393 EFIAPI
394 HiiLibExportPackageLists (
395 IN EFI_HII_HANDLE Handle,
396 OUT EFI_HII_PACKAGE_LIST_HEADER **PackageListHeader,
397 OUT UINTN *PackageListSize
398 )
399 ;
400
401 /**
402
403 This function returns a list of the package handles of the
404 specified type that are currently active in the HII database. The
405 pseudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package
406 handles to be listed.
407
408 If HandleBufferLength is NULL, then ASSERT.
409 If HandleBuffer is NULL, the ASSERT.
410 If PackageType is EFI_HII_PACKAGE_TYPE_GUID and PackageGuid is
411 NULL, then ASSERT.
412 If PackageType is not EFI_HII_PACKAGE_TYPE_GUID and PackageGuid is not
413 NULL, then ASSERT.
414
415
416 @param PackageType Specifies the package type of the packages
417 to list or EFI_HII_PACKAGE_TYPE_ALL for
418 all packages to be listed.
419
420 @param PackageGuid If PackageType is
421 EFI_HII_PACKAGE_TYPE_GUID, then this is
422 the pointer to the GUID which must match
423 the Guid field of
424 EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it
425 must be NULL.
426
427 @param HandleBufferLength On output, the length of the handle buffer
428 that is required for the handles found.
429
430 @param HandleBuffer On output, an array of EFI_HII_HANDLE instances returned.
431 The caller is responcible to free this pointer allocated.
432
433 @retval EFI_SUCCESS The matching handles are outputed successfully.
434 HandleBufferLength is updated with the actual length.
435 @retval EFI_OUT_OF_RESOURCES Not enough resource to complete the operation.
436 @retval EFI_NOT_FOUND No matching handle could not be found in database.
437 **/
438 EFI_STATUS
439 EFIAPI
440 HiiLibListPackageLists (
441 IN UINT8 PackageType,
442 IN CONST EFI_GUID *PackageGuid,
443 IN OUT UINTN *HandleBufferLength,
444 OUT EFI_HII_HANDLE **Handle
445 )
446 ;
447
448 /**
449 Convert language code from RFC3066 to ISO639-2.
450
451 LanguageRfc3066 contain a single RFC 3066 code such as
452 "en-US" or "fr-FR".
453
454 The LanguageRfc3066 must be a buffer large enough
455 for ISO_639_2_ENTRY_SIZE characters.
456
457 If LanguageRfc3066 is NULL, then ASSERT.
458 If LanguageIso639 is NULL, then ASSERT.
459
460 @param LanguageRfc3066 RFC3066 language code.
461 @param LanguageIso639 ISO639-2 language code.
462
463 @retval EFI_SUCCESS Language code converted.
464 @retval EFI_NOT_FOUND Language code not found.
465
466 **/
467 EFI_STATUS
468 EFIAPI
469 ConvertRfc3066LanguageToIso639Language (
470 IN CHAR8 *LanguageRfc3066,
471 OUT CHAR8 *LanguageIso639
472 )
473 ;
474
475 /**
476 Convert language code from ISO639-2 to RFC3066 and return the converted language.
477 Caller is responsible for freeing the allocated buffer.
478
479 LanguageIso639 contain a single ISO639-2 code such as
480 "eng" or "fra".
481
482 If LanguageIso639 is NULL, then ASSERT.
483 If LanguageRfc3066 is NULL, then ASSERT.
484
485 @param LanguageIso639 ISO639-2 language code.
486
487 @return the allocated buffer or NULL, if the language is not found.
488
489 **/
490 CHAR8*
491 EFIAPI
492 ConvertIso639LanguageToRfc3066Language (
493 IN CONST CHAR8 *LanguageIso639
494 )
495 ;
496
497 /**
498 Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will
499 be converted to "engfra".
500
501 If SupportedLanguages is NULL, then ASSERT.
502
503 @param SupportedLanguages The RFC3066 language list.
504
505 @return The ISO639-2 language list.
506
507 **/
508 CHAR8 *
509 EFIAPI
510 Rfc3066ToIso639 (
511 CHAR8 *SupportedLanguages
512 )
513 ;
514
515
516 ////////////////////////////////////////////////////////
517 ////////////////////////////////////////////////////////
518 // HiiLib Functions
519 ////////////////////////////////////////////////////////
520 ////////////////////////////////////////////////////////
521
522 /**
523 Registers a list of packages in the HII Database and returns the HII Handle
524 associated with that registration. If an HII Handle has already been registered
525 with the same PackageListGuid, then NULL is returned. If there are not enough
526 resources to perform the registration, then NULL is returned. If an empty list
527 of packages is passed in, then NULL is returned. If the size of the list of
528 package is 0, then NULL is returned.
529
530 @param[in] PackageListGuid An optional parameter that is used to identify
531 the GUID of the package list. If this parameter
532 is NULL, then gEfiCallerIdGuid is used.
533 @param[in] DeviceHandle Optional. If not NULL, the Device Handle on which
534 an instance of DEVICE_PATH_PROTOCOL is installed.
535 This Device Handle uniquely defines the device that
536 the added packages are associated with.
537 @param[in] ... The variable argument list that contains pointers
538 to packages terminated by a NULL.
539
540 @retval NULL A HII Handle has already been registered in the HII Database with
541 the same PackageListGuid.
542 @retval NULL The HII Handle could not be created.
543 @retval Other The HII Handle associated with the newly registered package list.
544
545 **/
546 EFI_HII_HANDLE
547 EFIAPI
548 HiiAddPackages (
549 IN CONST EFI_GUID *PackageListGuid, OPTIONAL
550 IN EFI_HANDLE DeviceHandle, OPTIONAL
551 ...
552 );
553
554 /**
555 Removes a package list from the HII Database.
556
557 If HiiHandle is NULL, then ASSERT().
558 If HiiHandle is not a valid EFI_HII_HANDLE in the HII Database, then ASSERT().
559
560 @param[in] HiiHandle A handle that was previously registered in the HII Database.
561
562 **/
563 VOID
564 EFIAPI
565 HiiRemovePackages (
566 IN EFI_HII_HANDLE HiiHandle
567 );
568
569 /**
570 Retrieves the array of all the HII Handles in the HII Database.
571 This array is terminated with a NULL HII Handle.
572 This function allocates the returned array using AllocatePool().
573 The caller is responsible for freeing the array with FreePool().
574
575 @param[in] PackageListGuid An optional parameter that is used to request
576 an HII Handle that is associatd with a specific
577 Package List GUID. If this parameter is NULL
578 then all the HII Handles in the HII Database
579 are returned. If this parameter is not NULL
580 then at most 1 HII Handle is returned.
581
582 @retval NULL There are no HII handles in the HII database
583 @retval NULL The array of HII Handles could not be retrieved
584 @retval Other A pointer to the NULL terminated array of HII Handles
585
586 **/
587 EFI_HII_HANDLE *
588 EFIAPI
589 HiiGetHiiHandles (
590 IN CONST EFI_GUID *PackageListGuid OPTIONAL
591 );
592
593 /**
594 Retrieves a pointer to the a Null-terminated ASCII string containing the list
595 of languages that an HII handle in the HII Database supports. The returned
596 string is allocated using AllocatePool(). The caller is responsible for freeing
597 the returned string using FreePool(). The format of the returned string follows
598 the language format assumed the HII Database.
599
600 If HiiHandle is NULL, then ASSERT().
601
602 @param[in] HiiHandle A handle that was previously registered in the HII Database.
603
604 @retval NULL HiiHandle is not registered in the HII database
605 @retval NULL There are not enough resources available to retrieve the suported
606 languages.
607 @retval NULL The list of suported languages could not be retrieved.
608 @retval Other A pointer to the Null-terminated ASCII string of supported languages.
609
610 **/
611 CHAR8 *
612 EFIAPI
613 HiiGetSupportedLanguages (
614 IN EFI_HII_HANDLE HiiHandle
615 );
616
617 /**
618 Retrieves a string from a string package in a specific language. If the language
619 is not specified, then a string from a string package in the current platform
620 language is retrieved. If the string can not be retrieved using the specified
621 language or the current platform language, then the string is retrieved from
622 the string package in the first language the string package supports. The
623 returned string is allocated using AllocatePool(). The caller is responsible
624 for freeing the allocated buffer using FreePool().
625
626 If HiiHandle is NULL, then ASSERT().
627 If StringId is 0, then ASSET.
628
629 @param[in] HiiHandle A handle that was previously registered in the HII Database.
630 @param[in] StringId The identifier of the string to retrieved from the string
631 package associated with HiiHandle.
632 @param[in] Language The language of the string to retrieve. If this parameter
633 is NULL, then the current platform language is used. The
634 format of Language must follow the language format assumed
635 the HII Database.
636
637 @retval NULL The string specified by StringId is not present in the string package.
638 @retval Other The string was returned.
639
640 **/
641 EFI_STRING
642 EFIAPI
643 HiiGetString (
644 IN EFI_HII_HANDLE HiiHandle,
645 IN EFI_STRING_ID StringId,
646 IN CONST CHAR8 *Language OPTIONAL
647 );
648
649 /**
650 Retrieves a string from a string package names by GUID in a specific language.
651 If the language is not specified, then a string from a string package in the
652 current platform language is retrieved. If the string can not be retrieved
653 using the specified language or the current platform language, then the string
654 is retrieved from the string package in the first language the string package
655 supports. The returned string is allocated using AllocatePool(). The caller
656 is responsible for freeing the allocated buffer using FreePool().
657
658 If PackageListGuid is NULL, then ASSERT().
659 If StringId is 0, then ASSET.
660
661 @param[in] PackageListGuid The GUID of a package list that was previously
662 registered in the HII Database.
663 @param[in] StringId The identifier of the string to retrieved from the
664 string package associated with PackageListGuid.
665 @param[in] Language The language of the string to retrieve. If this
666 parameter is NULL, then the current platform
667 language is used. The format of Language must
668 follow the language format assumed the HII Database.
669
670 @retval NULL The package list specified by PackageListGuid is not present in the
671 HII Database.
672 @retval NULL The string specified by StringId is not present in the string package.
673 @retval Other The string was returned.
674
675 **/
676 EFI_STRING
677 EFIAPI
678 HiiGetPackageString (
679 IN CONST EFI_GUID *PackageListGuid,
680 IN EFI_STRING_ID StringId,
681 IN CONST CHAR8 *Language OPTIONAL
682 );
683
684 /**
685 This function create a new string in String Package or updates an existing
686 string in a String Package. If StringId is 0, then a new string is added to
687 a String Package. If StringId is not zero, then a string in String Package is
688 updated. If SupportedLanguages is NULL, then the string is added or updated
689 for all the languages that the String Package supports. If SupportedLanguages
690 is not NULL, then the string is added or updated for the set of languages
691 specified by SupportedLanguages.
692
693 If HiiHandle is NULL, then ASSERT().
694 If String is NULL, then ASSERT().
695
696 @param[in] HiiHandle A handle that was previously registered in the
697 HII Database.
698 @param[in] StringId If zero, then a new string is created in the
699 String Package associated with HiiHandle. If
700 non-zero, then the string specified by StringId
701 is updated in the String Package associated
702 with HiiHandle.
703 @param[in] String A pointer to the Null-terminated Unicode string
704 to add or update in the String Package associated
705 with HiiHandle.
706 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string of
707 language codes. If this parameter is NULL, then
708 String is added or updated in the String Package
709 associated with HiiHandle for all the languages
710 that the String Package supports. If this
711 parameter is not NULL, then then String is added
712 or updated in the String Package associated with
713 HiiHandle for the set oflanguages specified by
714 SupportedLanguages. The format of
715 SupportedLanguages must follow the language
716 format assumed the HII Database.
717
718 @retval 0 The string could not be added or updated in the String Package.
719 @retval Other The EFI_STRING_ID of the newly added or updated string.
720
721 **/
722 EFI_STRING_ID
723 EFIAPI
724 HiiSetString (
725 IN EFI_HII_HANDLE HiiHandle,
726 IN EFI_STRING_ID StringId, OPTIONAL
727 IN CONST EFI_STRING String,
728 IN CONST CHAR8 *SupportedLanguages OPTIONAL
729 );
730
731 /**
732 Validates the config data associated with an HII handle in the HII Database.
733
734 If HiiHandle is NULL, then ASSERT().
735
736 @param[in] HiiHandle A handle that was previously registered in the HII Database.
737
738 @retval TRUE The config data associated with HiiHandle passes all validation
739 checks.
740 @retval FALSE The config data associated with HiiHandle failed one or more
741 validation checks.
742
743 **/
744 BOOLEAN
745 EFIAPI
746 HiiValidateDataFromHiiHandle (
747 IN EFI_HII_HANDLE HiiHandle
748 );
749
750 /**
751 Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing
752 information that includes a GUID, an optional Unicode string name, and a device
753 path. The string returned is allocated with AllocatePool(). The caller is
754 responsible for freeing the allocated string with FreePool().
755
756 The format of a <ConfigHdr> is as follows:
757
758 GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize<Null>
759
760 @param[in] Guid Pointer to an EFI_GUID that is the routing information
761 GUID. Each of the 16 bytes in Guid is converted to
762 a 2 Unicode character hexidecimal string. This is
763 an optional parameter that may be NULL.
764 @param[in] Name Pointer to a Null-terminated Unicode string that is
765 the routing information NAME. This is an optional
766 parameter that may be NULL. Each 16-bit Unicode
767 character in Name is converted to a 4 character Unicode
768 hexidecimal string.
769 @param[in] DriverHandle The driver handle which supports a Device Path Protocol
770 that is the routing information PATH. Each byte of
771 the Device Path associated with DriverHandle is converted
772 to a 2 Unicode character hexidecimal string.
773
774 @retval NULL DriverHandle does not support the Device Path Protocol.
775 @retval NULL DriverHandle does not support the Device Path Protocol.
776 @retval Other A pointer to the Null-terminate Unicode <ConfigHdr> string
777
778 **/
779 EFI_STRING
780 EFIAPI
781 HiiConstructConfigHdr (
782 IN CONST EFI_GUID *Guid, OPTIONAL
783 IN CONST CHAR16 *Name, OPTIONAL
784 IN EFI_HANDLE DriverHandle
785 );
786
787 /**
788 Allocates and returns a Null-terminated Unicode <ConfigAltResp> string.
789
790 If Guid is NULL, then ASSERT().
791 If Name is NULL, then ASSERT().
792 If BlockNameArray is NULL, then ASSERT().
793
794 @param[in] Guid GUID of the buffer storage.
795 @param[in] Name Name of the buffer storage.
796 @param[in] DriverHandle The DriverHandle that support a Device Path
797 Protocol.
798 @param[in] BufferStorage Content of the buffer storage.
799 @param[in] BufferStorageSize Length in bytes of the buffer storage.
800 @param[in] BlockNameArray Array generated by VFR compiler. This array
801 contains a UINT32 value that is the length
802 of BlockNameArray in bytes, followed by pairs
803 of 16-bit values that are the offset and length
804 values used to contruct a <ConfigRequest> string.
805 @param[in] ... A variable argument list that contains pairs of 16-bit
806 ALTCFG identifiers and pointers to DefaultValueArrays.
807 The variable argument list is terminated by a NULL
808 DefaultValueArray pointer. A DefaultValueArray
809 contains a UINT32 value that is the length, in bytes,
810 of the DefaultValueArray. The UINT32 length value
811 is followed by a series of records that contain
812 a 16-bit WIDTH value followed by a byte array with
813 WIDTH entries. The records must be parsed from
814 beginning to end until the UINT32 length limit
815 is reached.
816
817 @retval NULL There are not enough resources to process the request.
818 @retval NULL A <ConfigResp> could not be retrieved from the Config
819 Routing Protocol.
820 @retval Other A pointer to the Null-terminate Unicode <ConfigAltResp>
821 string.
822
823 **/
824 EFI_STRING
825 EFIAPI
826 HiiConstructConfigAltResp (
827 IN CONST EFI_GUID *Guid,
828 IN CONST CHAR16 *Name,
829 IN EFI_HANDLE DriverHandle,
830 IN CONST VOID *BufferStorage,
831 IN UINTN BufferStorageSize,
832 IN CONST VOID *BlockNameArray,
833 ...
834 );
835
836 /**
837 Determines if the routing data specified by GUID and NAME match a <ConfigHdr>.
838
839 If ConfigHdr is NULL, then ASSERT().
840
841 @param[in] ConfigHdr Either <ConfigRequest> or <ConfigResp>.
842 @param[in] Guid GUID of the storage.
843 @param[in] Name NAME of the storage.
844
845 @retval TRUE Routing information matches <ConfigHdr>.
846 @retval FALSE Routing information does not match <ConfigHdr>.
847
848 **/
849 BOOLEAN
850 EFIAPI
851 HiiIsConfigHdrMatch (
852 IN CONST EFI_STRING ConfigHdr,
853 IN CONST EFI_GUID *Guid, OPTIONAL
854 IN CONST CHAR16 *Name OPTIONAL
855 );
856
857 /**
858 Retrieves uncommited data from the Form Browser and converts it to a binary
859 buffer. The returned buffer is allocated using AllocatePool(). The caller
860 is responsible for freeing the returned buffer using FreePool().
861
862 @param[in] VariableName Pointer to a Null-terminated Unicode string. This
863 is an optional parameter that may be NULL.
864 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional
865 parameter that may be NULL.
866 @param[in] BufferSize Length in bytes of buffer to hold retrived data.
867
868 @retval NULL The uncommitted data could not be retrieved.
869 @retval Other A pointer to a buffer containing the uncommitted data.
870
871 **/
872 UINT8 *
873 EFIAPI
874 HiiGetBrowserData (
875 IN CONST EFI_GUID *VariableGuid, OPTIONAL
876 IN CONST CHAR16 *VariableName, OPTIONAL
877 IN UINTN BlockSize
878 );
879
880 /**
881 Updates uncommitted data in the Form Browser.
882
883 If Buffer is NULL, then ASSERT().
884
885 @param[in] VariableName Pointer to a Null-terminated Unicode string. This
886 is an optional parameter that may be NULL.
887 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional
888 parameter that may be NULL.
889 @param[in] BufferSize Length, in bytes, of Buffer.
890 @param[in] Buffer Buffer of data to commit.
891 @param[in] RequestElement An optional field to specify which part of the
892 buffer data will be send back to Browser. If NULL,
893 the whole buffer of data will be committed to
894 Browser.
895 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*
896
897 @retval FALSE The uncommitted data could not be updated.
898 @retval TRUE The uncommitted data was updated.
899
900 **/
901 BOOLEAN
902 EFIAPI
903 HiiSetBrowserData (
904 IN CONST EFI_GUID *VariableGuid, OPTIONAL
905 IN CONST CHAR16 *VariableName, OPTIONAL
906 IN UINTN BufferSize,
907 IN CONST UINT8 *Buffer,
908 IN CONST CHAR16 *RequestElement OPTIONAL
909 );
910
911 /////////////////////////////////////////
912 /////////////////////////////////////////
913 /// IFR Functions
914 /////////////////////////////////////////
915 /////////////////////////////////////////
916
917 /**
918 Returns a UINT64 value that contains bitfields for Hour, Minute, and Second.
919 The lower 8-bits of Hour are placed in bits 0..7. The lower 8-bits of Minute
920 are placed in bits 8..15, and the lower 8-bits of Second are placed in bits
921 16..23. This format is selected because it can be easily translated to
922 an EFI_HII_TIME structure in an EFI_IFR_TYPE_VALUE union.
923
924 @param Hour The hour value to be encoded.
925 @param Minute The miniute value to be encoded.
926 @param Second The second value to be encoded.
927
928 @return A 64-bit containing Hour, Minute, and Second.
929 **/
930 #define EFI_HII_TIME_UINT64(Hour, Minute, Second) \
931 (UINT64)((Hour & 0xff) | ((Minute & 0xff) << 8) | ((Second & 0xff) << 16))
932
933 /**
934 Returns a UINT64 value that contains bitfields for Year, Month, and Day.
935 The lower 16-bits of Year are placed in bits 0..15. The lower 8-bits of Month
936 are placed in bits 16..23, and the lower 8-bits of Day are placed in bits
937 24..31. This format is selected because it can be easily translated to
938 an EFI_HII_DATE structure in an EFI_IFR_TYPE_VALUE union.
939
940 @param Year The year value to be encoded.
941 @param Month The month value to be encoded.
942 @param Day The day value to be encoded.
943
944 @return A 64-bit containing Year, Month, and Day.
945 **/
946 #define EFI_HII_DATE_UINT64(Year, Month, Day) \
947 (UINT64)((Year & 0xffff) | ((Month & 0xff) << 16) | ((Day & 0xff) << 24))
948
949 /**
950 Allocates and returns a new OpCode Handle. OpCode Handles must be freed with
951 HiiFreeOpCodeHandle().
952
953 @retval NULL There are not enough resources to allocate a new OpCode Handle.
954 @retval Other A new OpCode handle.
955
956 **/
957 VOID *
958 EFIAPI
959 HiiAllocateOpCodeHandle (
960 VOID
961 );
962
963 /**
964 Frees an OpCode Handle that was peviously allocated with HiiAllocateOpCodeHandle().
965 When an OpCode Handle is freed, all of the opcodes associated with the OpCode
966 Handle are also freed.
967
968 If OpCodeHandle is NULL, then ASSERT().
969
970 **/
971 VOID
972 EFIAPI
973 HiiFreeOpCodeHandle (
974 VOID *OpCodeHandle
975 );
976
977 /**
978 Create EFI_IFR_END_OP opcode.
979
980 If OpCodeHandle is NULL, then ASSERT().
981
982 @param[in] OpCodeHandle Handle to the buffer of opcodes.
983
984 @retval NULL There is not enough space left in Buffer to add the opcode.
985 @retval Other A pointer to the created opcode.
986
987 **/
988 UINT8 *
989 EFIAPI
990 HiiCreateEndOpCode (
991 IN VOID *OpCodeHandle
992 );
993
994 /**
995 Create EFI_IFR_ONE_OF_OPTION_OP opcode.
996
997 If OpCodeHandle is NULL, then ASSERT().
998 If Type is invalid, then ASSERT().
999 If Flags is invalid, then ASSERT().
1000
1001 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1002 @param[in] StringId StringId for the option
1003 @param[in] Flags Flags for the option
1004 @param[in] Type Type for the option
1005 @param[in] Value Value for the option
1006
1007 @retval NULL There is not enough space left in Buffer to add the opcode.
1008 @retval Other A pointer to the created opcode.
1009
1010 **/
1011 UINT8 *
1012 EFIAPI
1013 HiiCreateOneOfOptionOpCode (
1014 IN VOID *OpCodeHandle,
1015 IN UINT16 StringId,
1016 IN UINT8 Flags,
1017 IN UINT8 Type,
1018 IN UINT64 Value
1019 );
1020
1021 /**
1022 Create EFI_IFR_DEFAULT_OP opcode.
1023
1024 If OpCodeHandle is NULL, then ASSERT().
1025 If Type is invalid, then ASSERT().
1026
1027 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1028 @param[in] DefaultId DefaultId for the default
1029 @param[in] Type Type for the default
1030 @param[in] Value Value for the default
1031
1032 @retval NULL There is not enough space left in Buffer to add the opcode.
1033 @retval Other A pointer to the created opcode.
1034
1035 **/
1036 UINT8 *
1037 EFIAPI
1038 HiiCreateDefaultOpCode (
1039 IN VOID *OpCodeHandle,
1040 IN UINT16 DefaultId,
1041 IN UINT8 Type,
1042 IN UINT64 Value
1043 );
1044
1045 /**
1046 Create EFI_IFR_GUID opcode.
1047
1048 If OpCodeHandle is NULL, then ASSERT().
1049 If Guid is NULL, then ASSERT().
1050 If OpCodeSize < sizeof (EFI_IFR_GUID), then ASSERT().
1051
1052 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1053 @param[in] Guid Pointer to EFI_GUID of this guided opcode.
1054 @param[in] GuidOpCode Pointer to an EFI_IFR_GUID opcode. This is an
1055 optional parameter that may be NULL. If this
1056 parameter is NULL, then the GUID extension
1057 region of the created opcode is filled with zeros.
1058 If this parameter is not NULL, then the GUID
1059 extension region of GuidData will be copied to
1060 the GUID extension region of the created opcode.
1061 @param[in] OpCodeSize The size, in bytes, of created opcode. This value
1062 must be >= sizeof(EFI_IFR_GUID).
1063
1064 @retval NULL There is not enough space left in Buffer to add the opcode.
1065 @retval Other A pointer to the created opcode.
1066
1067 **/
1068 UINT8 *
1069 EFIAPI
1070 HiiCreateGuidOpCode (
1071 IN VOID *OpCodeHandle,
1072 IN CONST EFI_GUID *Guid,
1073 IN CONST VOID *GuidOpCode, OPTIONAL
1074 IN UINTN OpCodeSize
1075 );
1076
1077 /**
1078 Create EFI_IFR_ACTION_OP opcode.
1079
1080 If OpCodeHandle is NULL, then ASSERT().
1081 If any reserved bits are set in QuestionFlags, then ASSERT().
1082
1083 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1084 @param[in] QuestionId Question ID
1085 @param[in] Prompt String ID for Prompt
1086 @param[in] Help String ID for Help
1087 @param[in] QuestionFlags Flags in Question Header
1088 @param[in] QuestionConfig String ID for configuration
1089
1090 @retval NULL There is not enough space left in Buffer to add the opcode.
1091 @retval Other A pointer to the created opcode.
1092
1093 **/
1094 UINT8 *
1095 EFIAPI
1096 HiiCreateActionOpCode (
1097 IN VOID *OpCodeHandle,
1098 IN EFI_QUESTION_ID QuestionId,
1099 IN EFI_STRING_ID Prompt,
1100 IN EFI_STRING_ID Help,
1101 IN UINT8 QuestionFlags,
1102 IN EFI_STRING_ID QuestionConfig
1103 );
1104
1105 /**
1106 Create EFI_IFR_SUBTITLE_OP opcode.
1107
1108 If OpCodeHandle is NULL, then ASSERT().
1109 If any reserved bits are set in Flags, then ASSERT().
1110 If Scope > 1, then ASSERT().
1111
1112 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1113 @param[in] Prompt String ID for Prompt
1114 @param[in] Help String ID for Help
1115 @param[in] Flags Subtitle opcode flags
1116 @param[in] Scope 1 if this opcpde is the beginning of a new scope.
1117 0 if this opcode is within the current scope.
1118
1119 @retval NULL There is not enough space left in Buffer to add the opcode.
1120 @retval Other A pointer to the created opcode.
1121
1122 **/
1123 UINT8 *
1124 EFIAPI
1125 HiiCreateSubTitleOpCode (
1126 IN VOID *OpCodeHandle,
1127 IN EFI_STRING_ID Prompt,
1128 IN EFI_STRING_ID Help,
1129 IN UINT8 Flags,
1130 IN UINT8 Scope
1131 );
1132
1133 /**
1134 Create EFI_IFR_REF_OP opcode.
1135
1136 If OpCodeHandle is NULL, then ASSERT().
1137 If any reserved bits are set in QuestionFlags, then ASSERT().
1138
1139 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1140 @param[in] FormId Destination Form ID
1141 @param[in] Prompt String ID for Prompt
1142 @param[in] Help String ID for Help
1143 @param[in] QuestionFlags Flags in Question Header
1144 @param[in] QuestionId Question ID
1145
1146 @retval NULL There is not enough space left in Buffer to add the opcode.
1147 @retval Other A pointer to the created opcode.
1148
1149 **/
1150 UINT8 *
1151 EFIAPI
1152 HiiCreateGotoOpCode (
1153 IN VOID *OpCodeHandle,
1154 IN EFI_FORM_ID FormId,
1155 IN EFI_STRING_ID Prompt,
1156 IN EFI_STRING_ID Help,
1157 IN UINT8 QuestionFlags,
1158 IN EFI_QUESTION_ID QuestionId
1159 );
1160
1161 /**
1162 Create EFI_IFR_CHECKBOX_OP opcode.
1163
1164 If OpCodeHandle is NULL, then ASSERT().
1165 If any reserved bits are set in QuestionFlags, then ASSERT().
1166 If any reserved bits are set in CheckBoxFlags, then ASSERT().
1167
1168 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1169 @param[in] QuestionId Question ID
1170 @param[in] VarStoreId Storage ID
1171 @param[in] VarOffset Offset in Storage
1172 @param[in] Prompt String ID for Prompt
1173 @param[in] Help String ID for Help
1174 @param[in] QuestionFlags Flags in Question Header
1175 @param[in] CheckBoxFlags Flags for checkbox opcode
1176 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
1177 is an optional parameter that may be NULL.
1178
1179 @retval NULL There is not enough space left in Buffer to add the opcode.
1180 @retval Other A pointer to the created opcode.
1181
1182 **/
1183 UINT8 *
1184 EFIAPI
1185 HiiCreateCheckBoxOpCode (
1186 IN VOID *OpCodeHandle,
1187 IN EFI_QUESTION_ID QuestionId,
1188 IN EFI_VARSTORE_ID VarStoreId,
1189 IN UINT16 VarOffset,
1190 IN EFI_STRING_ID Prompt,
1191 IN EFI_STRING_ID Help,
1192 IN UINT8 QuestionFlags,
1193 IN UINT8 CheckBoxFlags,
1194 IN VOID *DefaultsOpCodeHandle OPTIONAL
1195 );
1196
1197 /**
1198 Create EFI_IFR_NUMERIC_OP opcode.
1199
1200 If OpCodeHandle is NULL, then ASSERT().
1201 If any reserved bits are set in QuestionFlags, then ASSERT().
1202 If any reserved bits are set in NumericFlags, then ASSERT().
1203
1204 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1205 @param[in] QuestionId Question ID
1206 @param[in] VarStoreId Storage ID
1207 @param[in] VarOffset Offset in Storage
1208 @param[in] Prompt String ID for Prompt
1209 @param[in] Help String ID for Help
1210 @param[in] QuestionFlags Flags in Question Header
1211 @param[in] NumericFlags Flags for numeric opcode
1212 @param[in] Minimum Numeric minimum value
1213 @param[in] Maximum Numeric maximum value
1214 @param[in] Step Numeric step for edit
1215 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
1216 is an optional parameter that may be NULL.
1217
1218 @retval NULL There is not enough space left in Buffer to add the opcode.
1219 @retval Other A pointer to the created opcode.
1220
1221 **/
1222 UINT8 *
1223 EFIAPI
1224 HiiCreateNumericOpCode (
1225 IN VOID *OpCodeHandle,
1226 IN EFI_QUESTION_ID QuestionId,
1227 IN EFI_VARSTORE_ID VarStoreId,
1228 IN UINT16 VarOffset,
1229 IN EFI_STRING_ID Prompt,
1230 IN EFI_STRING_ID Help,
1231 IN UINT8 QuestionFlags,
1232 IN UINT8 NumericFlags,
1233 IN UINT64 Minimum,
1234 IN UINT64 Maximum,
1235 IN UINT64 Step,
1236 IN VOID *DefaultsOpCodeHandle OPTIONAL
1237 );
1238
1239 /**
1240 Create EFI_IFR_STRING_OP opcode.
1241
1242 If OpCodeHandle is NULL, then ASSERT().
1243 If any reserved bits are set in QuestionFlags, then ASSERT().
1244 If any reserved bits are set in StringFlags, then ASSERT().
1245
1246 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1247 @param[in] QuestionId Question ID
1248 @param[in] VarStoreId Storage ID
1249 @param[in] VarOffset Offset in Storage
1250 @param[in] Prompt String ID for Prompt
1251 @param[in] Help String ID for Help
1252 @param[in] QuestionFlags Flags in Question Header
1253 @param[in] StringFlags Flags for string opcode
1254 @param[in] MinSize String minimum length
1255 @param[in] MaxSize String maximum length
1256 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
1257 is an optional parameter that may be NULL.
1258
1259 @retval NULL There is not enough space left in Buffer to add the opcode.
1260 @retval Other A pointer to the created opcode.
1261
1262 **/
1263 UINT8 *
1264 EFIAPI
1265 HiiCreateStringOpCode (
1266 IN VOID *OpCodeHandle,
1267 IN EFI_QUESTION_ID QuestionId,
1268 IN EFI_VARSTORE_ID VarStoreId,
1269 IN UINT16 VarOffset,
1270 IN EFI_STRING_ID Prompt,
1271 IN EFI_STRING_ID Help,
1272 IN UINT8 QuestionFlags,
1273 IN UINT8 StringFlags,
1274 IN UINT8 MinSize,
1275 IN UINT8 MaxSize,
1276 IN VOID *DefaultsOpCodeHandle OPTIONAL
1277 );
1278
1279 /**
1280 Create EFI_IFR_ONE_OF_OP opcode.
1281
1282 If OpCodeHandle is NULL, then ASSERT().
1283 If any reserved bits are set in QuestionFlags, then ASSERT().
1284 If any reserved bits are set in OneOfFlags, then ASSERT().
1285
1286 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1287 @param[in] QuestionId Question ID
1288 @param[in] VarStoreId Storage ID
1289 @param[in] VarOffset Offset in Storage
1290 @param[in] Prompt String ID for Prompt
1291 @param[in] Help String ID for Help
1292 @param[in] QuestionFlags Flags in Question Header
1293 @param[in] OneOfFlags Flags for oneof opcode
1294 @param[in] OptionsOpCodeHandle Handle for a buffer of ONE_OF_OPTION opcodes.
1295 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
1296 is an optional parameter that may be NULL.
1297
1298 @retval NULL There is not enough space left in Buffer to add the opcode.
1299 @retval Other A pointer to the created opcode.
1300
1301 **/
1302 UINT8 *
1303 EFIAPI
1304 HiiCreateOneOfOpCode (
1305 IN VOID *OpCodeHandle,
1306 IN EFI_QUESTION_ID QuestionId,
1307 IN EFI_VARSTORE_ID VarStoreId,
1308 IN UINT16 VarOffset,
1309 IN EFI_STRING_ID Prompt,
1310 IN EFI_STRING_ID Help,
1311 IN UINT8 QuestionFlags,
1312 IN UINT8 OneOfFlags,
1313 IN VOID *OptionsOpCodeHandle,
1314 IN VOID *DefaultsOpCodeHandle OPTIONAL
1315 );
1316
1317 /**
1318 Create EFI_IFR_ORDERED_LIST_OP opcode.
1319
1320 If OpCodeHandle is NULL, then ASSERT().
1321 If any reserved bits are set in QuestionFlags, then ASSERT().
1322 If any reserved bits are set in OrderedListFlags, then ASSERT().
1323
1324 @param[in] OpCodeHandle Handle to the buffer of opcodes.
1325 @param[in] QuestionId Question ID
1326 @param[in] VarStoreId Storage ID
1327 @param[in] VarOffset Offset in Storage
1328 @param[in] Prompt String ID for Prompt
1329 @param[in] Help String ID for Help
1330 @param[in] QuestionFlags Flags in Question Header
1331 @param[in] OrderedListFlags Flags for ordered list opcode
1332 @param[in] DataType Type for option value
1333 @param[in] MaxContainers Maximum count for options in this ordered list
1334 @param[in] OptionsOpCodeHandle Handle for a buffer of ONE_OF_OPTION opcodes.
1335 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This
1336 is an optional parameter that may be NULL.
1337
1338 @retval NULL There is not enough space left in Buffer to add the opcode.
1339 @retval Other A pointer to the created opcode.
1340
1341 **/
1342 UINT8 *
1343 EFIAPI
1344 HiiCreateOrderedListOpCode (
1345 IN VOID *OpCodeHandle,
1346 IN EFI_QUESTION_ID QuestionId,
1347 IN EFI_VARSTORE_ID VarStoreId,
1348 IN UINT16 VarOffset,
1349 IN EFI_STRING_ID Prompt,
1350 IN EFI_STRING_ID Help,
1351 IN UINT8 QuestionFlags,
1352 IN UINT8 OrderedListFlags,
1353 IN UINT8 DataType,
1354 IN UINT8 MaxContainers,
1355 IN VOID *OptionsOpCodeHandle,
1356 IN VOID *DefaultsOpCodeHandle OPTIONAL
1357 );
1358
1359 /**
1360 This function updates a form that has previously been registered with the HII
1361 Database. This function will perform at most one update operation.
1362
1363 The form to update is specified by Handle, FormSetGuid, and FormId. Binary
1364 comparisons of IFR opcodes are performed from the beginning of the form being
1365 updated until an IFR opcode is found that exactly matches the first IFR opcode
1366 specifed by StartOpCodeHandle. The following rules are used to determine if
1367 an insert, replace, or delete operation is performed.
1368
1369 1) If no matches are found, then NULL is returned.
1370 2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes
1371 from StartOpcodeHandle except the first opcode are inserted immediately after
1372 the matching IFR opcode in the form beng updated.
1373 3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made
1374 from the matching IFR opcode until an IFR opcode exatly matches the first
1375 IFR opcode specified by EndOpCodeHandle. If no match is found for the first
1376 IFR opcode specified by EndOpCodeHandle, then NULL is returned. If a match
1377 is found, then all of the IFR opcodes between the start match and the end
1378 match are deleted from the form being updated and all of the IFR opcodes
1379 from StartOpcodeHandle except the first opcode are inserted immediately after
1380 the matching start IFR opcode. If StartOpCcodeHandle only contains one
1381 IFR instruction, then the result of ths operation will delete all of the IFR
1382 opcodes between the start end matches.
1383
1384 If HiiHandle is NULL, then ASSERT().
1385 If StartOpCodeHandle is NULL, then ASSERT().
1386
1387 @param[in] HiiHandle The HII Handle of the form to update.
1388 @param[in] FormSetGuid The Formset GUID of the form to update. This
1389 is an optional parameter that may be NULL.
1390 If it is NULL, all FormSet will be updated.
1391 @param[in] FormId The ID of the form to update.
1392 @param[in] StartOpCodeHandle An OpCode Handle that contains the set of IFR
1393 opcodes to be inserted or replaced in the form.
1394 The first IFR instruction in StartOpCodeHandle
1395 is used to find matching IFR opcode in the
1396 form.
1397 @param[in] EndOpCodeHandle An OpCcode Handle that contains the IFR opcode
1398 that marks the end of a replace operation in
1399 the form. This is an optional parameter that
1400 may be NULL. If it is NULL, then an the IFR
1401 opcodes specified by StartOpCodeHandle are
1402 inserted into the form.
1403
1404 @retval EFI_OUT_OF_RESOURCES No enough memory resource is allocated.
1405 @retval EFI_NOT_FOUND The following cases will return EFI_NOT_FOUND.
1406 1) The form specified by HiiHandle, FormSetGuid,
1407 and FormId could not be found in the HII Database.
1408 2) No IFR opcodes in the target form match the first
1409 IFR opcode in StartOpCodeHandle.
1410 3) EndOpCOde is not NULL, and no IFR opcodes in the
1411 target form following a matching start opcode match
1412 the first IFR opcode in EndOpCodeHandle.
1413 @retval EFI_SUCCESS The matched form is updated by StartOpcode.
1414
1415 **/
1416 EFI_STATUS
1417 EFIAPI
1418 HiiUpdateForm (
1419 IN EFI_HII_HANDLE HiiHandle,
1420 IN EFI_GUID *FormSetGuid, OPTIONAL
1421 IN EFI_FORM_ID FormId,
1422 IN VOID *StartOpcodeHandle,
1423 IN VOID *EndOpcodeHandle OPTIONAL
1424 );
1425
1426 /**
1427 Configure the buffer accrording to ConfigBody strings in the format of
1428 <Length:4 bytes>, <Offset: 2 bytes>, <Width:2 bytes>, <Data:n bytes>.
1429 This ConfigBody strings is generated by EDKII UEFI VfrCompiler for the default
1430 values in a Form Set. The name of the ConfigBody strings is VfrMyIfrNVDataDefault0000
1431 constructed following this rule:
1432 "Vfr" + varstore.name + "Default" + defaultstore.attributes.
1433 Check the generated C file in Output for details.
1434
1435 @param Buffer the start address of buffer.
1436 @param BufferSize the size of buffer.
1437 @param Number the number of the ConfigBody strings.
1438 @param ... the ConfigBody strings
1439
1440 @retval EFI_BUFFER_TOO_SMALL the BufferSize is too small to operate.
1441 @retval EFI_INVALID_PARAMETER Buffer is NULL or BufferSize is 0.
1442 @retval EFI_SUCCESS Operation successful.
1443
1444 **/
1445 EFI_STATUS
1446 EFIAPI
1447 HiiIfrLibExtractDefault(
1448 IN VOID *Buffer,
1449 IN UINTN *BufferSize,
1450 UINTN Number,
1451 ...
1452 );
1453
1454 #endif