2 Private structures definitions in HiiDatabase.
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __HII_DATABASE_PRIVATE_H__
10 #define __HII_DATABASE_PRIVATE_H__
14 #include <Protocol/DevicePath.h>
15 #include <Protocol/HiiFont.h>
16 #include <Protocol/HiiImage.h>
17 #include <Protocol/HiiImageEx.h>
18 #include <Protocol/HiiImageDecoder.h>
19 #include <Protocol/HiiString.h>
20 #include <Protocol/HiiDatabase.h>
21 #include <Protocol/HiiConfigRouting.h>
22 #include <Protocol/HiiConfigAccess.h>
23 #include <Protocol/HiiConfigKeyword.h>
24 #include <Protocol/SimpleTextOut.h>
26 #include <Guid/HiiKeyBoardLayout.h>
27 #include <Guid/GlobalVariable.h>
28 #include <Guid/MdeModuleHii.h>
29 #include <Guid/VariableFormat.h>
30 #include <Guid/PcdDataBaseSignatureGuid.h>
32 #include <Library/DebugLib.h>
33 #include <Library/BaseMemoryLib.h>
34 #include <Library/UefiDriverEntryPoint.h>
35 #include <Library/UefiBootServicesTableLib.h>
36 #include <Library/BaseLib.h>
37 #include <Library/DevicePathLib.h>
38 #include <Library/MemoryAllocationLib.h>
39 #include <Library/UefiLib.h>
40 #include <Library/PcdLib.h>
41 #include <Library/UefiRuntimeServicesTableLib.h>
42 #include <Library/PrintLib.h>
44 #define MAX_STRING_LENGTH 1024
45 #define MAX_FONT_NAME_LEN 256
46 #define NARROW_BASELINE 15
47 #define WIDE_BASELINE 14
48 #define SYS_FONT_INFO_MASK 0x37
49 #define REPLACE_UNKNOWN_GLYPH 0xFFFD
50 #define PROPORTIONAL_GLYPH 0x80
51 #define NARROW_GLYPH 0x40
53 #define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))
54 #define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))
55 #define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))
56 #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)
58 extern EFI_LOCK mHiiDatabaseLock
;
63 // BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure.
66 LIST_ENTRY Entry
; // Link to VarStorage Default Data
68 VARIABLE_STORE_HEADER
*VariableStorage
;
69 } VARSTORAGE_DEFAULT_DATA
;
72 LIST_ENTRY Entry
; // Link to VarStorage
77 LIST_ENTRY BlockEntry
; // Link to its Block array
78 } IFR_VARSTORAGE_DATA
;
81 LIST_ENTRY Entry
; // Link to Block array
86 EFI_QUESTION_ID QuestionId
;
89 LIST_ENTRY DefaultValueEntry
; // Link to its default value array
95 // Get default value from IFR data.
98 DefaultValueFromDefault
= 0, // Get from the minimum or first one when not set default value.
99 DefaultValueFromOtherDefault
, // Get default vale from other default when no default(When other
100 // defaults are more than one, use the default with smallest default id).
101 DefaultValueFromFlag
, // Get default value from the default flag.
102 DefaultValueFromOpcode
// Get default value from default opcode, highest priority.
103 } DEFAULT_VALUE_TYPE
;
107 DEFAULT_VALUE_TYPE Type
;
108 BOOLEAN Cleaned
; // Whether this value is cleaned
109 // TRUE Cleaned, the value can't be used
110 // FALSE Not cleaned, the value can be used.
112 EFI_IFR_TYPE_VALUE Value
;
118 #define EFI_HII_VARSTORE_BUFFER 0
119 #define EFI_HII_VARSTORE_NAME_VALUE 1
120 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
121 #define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3
124 // Keyword handler protocol filter type.
126 #define EFI_KEYWORD_FILTER_READONY 0x01
127 #define EFI_KEYWORD_FILTER_REAWRITE 0x02
128 #define EFI_KEYWORD_FILTER_BUFFER 0x10
129 #define EFI_KEYWORD_FILTER_NUMERIC 0x20
130 #define EFI_KEYWORD_FILTER_NUMERIC_1 0x30
131 #define EFI_KEYWORD_FILTER_NUMERIC_2 0x40
132 #define EFI_KEYWORD_FILTER_NUMERIC_4 0x50
133 #define EFI_KEYWORD_FILTER_NUMERIC_8 0x60
135 #define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G')
140 EFI_HII_HANDLE HiiHandle
;
141 EFI_HANDLE DriverHandle
;
143 UINT8 Type
; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE
147 } HII_FORMSET_STORAGE
;
150 // String Package definitions
152 #define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p')
153 typedef struct _HII_STRING_PACKAGE_INSTANCE
{
155 EFI_HII_STRING_PACKAGE_HDR
*StringPkgHdr
;
157 LIST_ENTRY StringEntry
;
158 LIST_ENTRY FontInfoList
; // local font info list
160 EFI_STRING_ID MaxStringId
; // record StringId
161 } HII_STRING_PACKAGE_INSTANCE
;
164 // Form Package definitions
166 #define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p')
167 typedef struct _HII_IFR_PACKAGE_INSTANCE
{
169 EFI_HII_PACKAGE_HEADER FormPkgHdr
;
172 } HII_IFR_PACKAGE_INSTANCE
;
175 // Simple Font Package definitions
177 #define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p')
178 typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE
{
180 EFI_HII_SIMPLE_FONT_PACKAGE_HDR
*SimpleFontPkgHdr
;
181 LIST_ENTRY SimpleFontEntry
;
182 } HII_SIMPLE_FONT_PACKAGE_INSTANCE
;
185 // Font Package definitions
187 #define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p')
188 typedef struct _HII_FONT_PACKAGE_INSTANCE
{
190 EFI_HII_FONT_PACKAGE_HDR
*FontPkgHdr
;
194 LIST_ENTRY FontEntry
;
195 LIST_ENTRY GlyphInfoList
;
196 } HII_FONT_PACKAGE_INSTANCE
;
198 #define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s')
199 typedef struct _HII_GLYPH_INFO
{
203 EFI_HII_GLYPH_INFO Cell
;
206 #define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i')
207 typedef struct _HII_FONT_INFO
{
210 LIST_ENTRY
*GlobalEntry
;
214 #define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i')
215 typedef struct _HII_GLOBAL_FONT_INFO
{
218 HII_FONT_PACKAGE_INSTANCE
*FontPackage
;
220 EFI_FONT_INFO
*FontInfo
;
221 } HII_GLOBAL_FONT_INFO
;
224 // Image Package definitions
227 #define HII_PIXEL_MASK 0x80
229 typedef struct _HII_IMAGE_PACKAGE_INSTANCE
{
230 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr
;
231 UINT32 ImageBlockSize
;
232 UINT32 PaletteInfoSize
;
233 EFI_HII_IMAGE_BLOCK
*ImageBlock
;
235 } HII_IMAGE_PACKAGE_INSTANCE
;
238 // Keyboard Layout Package definitions
240 #define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')
241 typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
{
244 LIST_ENTRY KeyboardEntry
;
245 } HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
;
248 // Guid Package definitions
250 #define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p')
251 typedef struct _HII_GUID_PACKAGE_INSTANCE
{
254 LIST_ENTRY GuidEntry
;
255 } HII_GUID_PACKAGE_INSTANCE
;
258 // A package list can contain only one or less than one device path package.
259 // This rule also applies to image package since ImageId can not be duplicate.
261 typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE
{
262 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr
;
263 LIST_ENTRY GuidPkgHdr
;
264 LIST_ENTRY FormPkgHdr
;
265 LIST_ENTRY KeyboardLayoutHdr
;
266 LIST_ENTRY StringPkgHdr
;
267 LIST_ENTRY FontPkgHdr
;
268 HII_IMAGE_PACKAGE_INSTANCE
*ImagePkg
;
269 LIST_ENTRY SimpleFontPkgHdr
;
270 UINT8
*DevicePathPkg
;
271 } HII_DATABASE_PACKAGE_LIST_INSTANCE
;
273 #define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l')
281 #define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r')
283 typedef struct _HII_DATABASE_RECORD
{
285 HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
;
286 EFI_HANDLE DriverHandle
;
287 EFI_HII_HANDLE Handle
;
288 LIST_ENTRY DatabaseEntry
;
289 } HII_DATABASE_RECORD
;
291 #define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n')
293 typedef struct _HII_DATABASE_NOTIFY
{
295 EFI_HANDLE NotifyHandle
;
297 EFI_GUID
*PackageGuid
;
298 EFI_HII_DATABASE_NOTIFY PackageNotifyFn
;
299 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
;
300 LIST_ENTRY DatabaseNotifyEntry
;
301 } HII_DATABASE_NOTIFY
;
303 #define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')
305 typedef struct _HII_DATABASE_PRIVATE_DATA
{
307 LIST_ENTRY DatabaseList
;
308 LIST_ENTRY DatabaseNotifyList
;
309 EFI_HII_FONT_PROTOCOL HiiFont
;
310 EFI_HII_IMAGE_PROTOCOL HiiImage
;
311 EFI_HII_IMAGE_EX_PROTOCOL HiiImageEx
;
312 EFI_HII_STRING_PROTOCOL HiiString
;
313 EFI_HII_DATABASE_PROTOCOL HiiDatabase
;
314 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting
;
315 EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL ConfigKeywordHandler
;
316 LIST_ENTRY HiiHandleList
;
318 LIST_ENTRY FontInfoList
; // global font info list
319 UINTN Attribute
; // default system color
320 EFI_GUID CurrentLayoutGuid
;
321 EFI_HII_KEYBOARD_LAYOUT
*CurrentLayout
;
322 } HII_DATABASE_PRIVATE_DATA
;
324 #define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
326 HII_DATABASE_PRIVATE_DATA, \
328 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
331 #define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
333 HII_DATABASE_PRIVATE_DATA, \
335 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
338 #define HII_IMAGE_EX_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
340 HII_DATABASE_PRIVATE_DATA, \
342 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
345 #define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
347 HII_DATABASE_PRIVATE_DATA, \
349 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
352 #define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
354 HII_DATABASE_PRIVATE_DATA, \
356 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
359 #define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
361 HII_DATABASE_PRIVATE_DATA, \
363 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
366 #define CONFIG_KEYWORD_HANDLER_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
368 HII_DATABASE_PRIVATE_DATA, \
369 ConfigKeywordHandler, \
370 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
374 // Internal function prototypes.
378 Generate a sub string then output it.
380 This is a internal function.
382 @param String A constant string which is the prefix of the to be
383 generated string, e.g. GUID=
385 @param BufferLen The length of the Buffer in bytes.
387 @param Buffer Points to a buffer which will be converted to be the
388 content of the generated string.
390 @param Flag If 1, the buffer contains data for the value of GUID or PATH stored in
391 UINT8 *; if 2, the buffer contains unicode string for the value of NAME;
392 if 3, the buffer contains other data.
394 @param SubStr Points to the output string. It's caller's
395 responsibility to free this buffer.
401 IN CONST EFI_STRING String
,
405 OUT EFI_STRING
*SubStr
409 This function checks whether a handle is a valid EFI_HII_HANDLE.
411 @param Handle Pointer to a EFI_HII_HANDLE
414 @retval FALSE Invalid
419 EFI_HII_HANDLE Handle
423 This function checks whether EFI_FONT_INFO exists in current database. If
424 FontInfoMask is specified, check what options can be used to make a match.
425 Note that the masks relate to where the system default should be supplied
426 are ignored by this function.
428 @param Private Hii database private structure.
429 @param FontInfo Points to EFI_FONT_INFO structure.
430 @param FontInfoMask If not NULL, describes what options can be used
431 to make a match between the font requested and
432 the font available. The caller must guarantee
434 @param FontHandle On entry, Points to the font handle returned by a
435 previous call to GetFontInfo() or NULL to start
437 @param GlobalFontInfo If not NULL, output the corresponding global font
441 @retval FALSE Not existed
446 IN HII_DATABASE_PRIVATE_DATA
*Private
,
447 IN EFI_FONT_INFO
*FontInfo
,
448 IN EFI_FONT_INFO_MASK
*FontInfoMask OPTIONAL
,
449 IN EFI_FONT_HANDLE FontHandle OPTIONAL
,
450 OUT HII_GLOBAL_FONT_INFO
**GlobalFontInfo OPTIONAL
455 This function invokes the matching registered function.
457 @param Private HII Database driver private structure.
458 @param NotifyType The type of change concerning the database.
459 @param PackageInstance Points to the package referred to by the notification.
460 @param PackageType Package type
461 @param Handle The handle of the package list which contains the specified package.
463 @retval EFI_SUCCESS Already checked all registered function and invoked
465 @retval EFI_INVALID_PARAMETER Any input parameter is not valid.
469 InvokeRegisteredFunction (
470 IN HII_DATABASE_PRIVATE_DATA
*Private
,
471 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
472 IN VOID
*PackageInstance
,
473 IN UINT8 PackageType
,
474 IN EFI_HII_HANDLE Handle
479 Retrieve system default font and color.
481 @param Private HII database driver private data.
482 @param FontInfo Points to system default font output-related
483 information. It's caller's responsibility to free
485 @param FontInfoSize If not NULL, output the size of buffer FontInfo.
487 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.
488 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
490 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
495 IN HII_DATABASE_PRIVATE_DATA
*Private
,
496 OUT EFI_FONT_DISPLAY_INFO
**FontInfo
,
497 OUT UINTN
*FontInfoSize OPTIONAL
501 Parse all string blocks to find a String block specified by StringId.
502 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks
503 within this string package and backup its information. If LastStringId is
504 specified, the string id of last string block will also be output.
505 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).
507 @param Private Hii database private structure.
508 @param StringPackage Hii string package instance.
509 @param StringId The string's id, which is unique within
511 @param BlockType Output the block type of found string block.
512 @param StringBlockAddr Output the block address of found string block.
513 @param StringTextOffset Offset, relative to the found block address, of
514 the string text information.
515 @param LastStringId Output the last string id when StringId = 0 or StringId = -1.
516 @param StartStringId The first id in the skip block which StringId in the block.
518 @retval EFI_SUCCESS The string text and font is retrieved
520 @retval EFI_NOT_FOUND The specified text or font info can not be found
522 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
528 IN HII_DATABASE_PRIVATE_DATA
*Private
,
529 IN HII_STRING_PACKAGE_INSTANCE
*StringPackage
,
530 IN EFI_STRING_ID StringId
,
531 OUT UINT8
*BlockType OPTIONAL
,
532 OUT UINT8
**StringBlockAddr OPTIONAL
,
533 OUT UINTN
*StringTextOffset OPTIONAL
,
534 OUT EFI_STRING_ID
*LastStringId OPTIONAL
,
535 OUT EFI_STRING_ID
*StartStringId OPTIONAL
539 Parse all glyph blocks to find a glyph block specified by CharValue.
540 If CharValue = (CHAR16) (-1), collect all default character cell information
541 within this font package and backup its information.
543 @param FontPackage Hii string package instance.
544 @param CharValue Unicode character value, which identifies a glyph
546 @param GlyphBuffer Output the corresponding bitmap data of the found
547 block. It is the caller's responsibility to free
549 @param Cell Output cell information of the encoded bitmap.
550 @param GlyphBufferLen If not NULL, output the length of GlyphBuffer.
552 @retval EFI_SUCCESS The bitmap data is retrieved successfully.
553 @retval EFI_NOT_FOUND The specified CharValue does not exist in current
555 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
561 IN HII_FONT_PACKAGE_INSTANCE
*FontPackage
,
563 OUT UINT8
**GlyphBuffer OPTIONAL
,
564 OUT EFI_HII_GLYPH_INFO
*Cell OPTIONAL
,
565 OUT UINTN
*GlyphBufferLen OPTIONAL
569 This function exports Form packages to a buffer.
570 This is a internal function.
572 @param Private Hii database private structure.
573 @param Handle Identification of a package list.
574 @param PackageList Pointer to a package list which will be exported.
575 @param UsedSize The length of buffer be used.
576 @param BufferSize Length of the Buffer.
577 @param Buffer Allocated space for storing exported data.
578 @param ResultSize The size of the already exported content of this
581 @retval EFI_SUCCESS Form Packages are exported successfully.
582 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
587 IN HII_DATABASE_PRIVATE_DATA
*Private
,
588 IN EFI_HII_HANDLE Handle
,
589 IN HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
,
593 IN OUT UINTN
*ResultSize
597 // EFI_HII_FONT_PROTOCOL protocol interfaces
601 Renders a string to a bitmap or to the display.
603 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
604 @param Flags Describes how the string is to be drawn.
605 @param String Points to the null-terminated string to be
607 @param StringInfo Points to the string output information,
608 including the color and font. If NULL, then the
609 string will be output in the default system font
611 @param Blt If this points to a non-NULL on entry, this
612 points to the image, which is Width pixels wide
613 and Height pixels high. The string will be drawn
615 EFI_HII_OUT_FLAG_CLIP is implied. If this points
616 to a NULL on entry, then a buffer
617 will be allocated to hold the generated image and
618 the pointer updated on exit. It is the caller's
619 responsibility to free this buffer.
620 @param BltX Together with BltX, Specifies the offset from the left and top edge
621 of the image of the first character cell in the
623 @param BltY Together with BltY, Specifies the offset from the left and top edge
624 of the image of the first character cell in the
626 @param RowInfoArray If this is non-NULL on entry, then on exit, this
627 will point to an allocated buffer containing
628 row information and RowInfoArraySize will be
629 updated to contain the number of elements.
630 This array describes the characters which were at
631 least partially drawn and the heights of the
632 rows. It is the caller's responsibility to free
634 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
635 contains the number of elements in RowInfoArray.
636 @param ColumnInfoArray If this is non-NULL, then on return it will be
637 filled with the horizontal offset for each
638 character in the string on the row where it is
639 displayed. Non-printing characters will have
640 the offset ~0. The caller is responsible to
641 allocate a buffer large enough so that there
642 is one entry for each character in the string,
643 not including the null-terminator. It is possible
644 when character display is normalized that some
645 character cells overlap.
647 @retval EFI_SUCCESS The string was successfully rendered.
648 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
650 @retval EFI_INVALID_PARAMETER The String or Blt.
651 @retval EFI_INVALID_PARAMETER Flags were invalid combination..
657 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
658 IN EFI_HII_OUT_FLAGS Flags
,
659 IN CONST EFI_STRING String
,
660 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
661 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
664 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
665 OUT UINTN
*RowInfoArraySize OPTIONAL
,
666 OUT UINTN
*ColumnInfoArray OPTIONAL
670 Render a string to a bitmap or the screen containing the contents of the specified string.
672 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
673 @param Flags Describes how the string is to be drawn.
674 @param PackageList The package list in the HII database to search
675 for the specified string.
676 @param StringId The string's id, which is unique within
678 @param Language Points to the language for the retrieved string.
679 If NULL, then the current system language is
681 @param StringInfo Points to the string output information,
682 including the color and font. If NULL, then the
683 string will be output in the default system font
685 @param Blt If this points to a non-NULL on entry, this
686 points to the image, which is Width pixels wide
687 and Height pixels high. The string will be drawn
689 EFI_HII_OUT_FLAG_CLIP is implied. If this points
690 to a NULL on entry, then a buffer
691 will be allocated to hold the generated image and
692 the pointer updated on exit. It is the caller's
693 responsibility to free this buffer.
694 @param BltX Together with BltX, Specifies the offset from the left and top edge
695 of the image of the first character cell in the
697 @param BltY Together with BltY, Specifies the offset from the left and top edge
698 of the image of the first character cell in the
700 @param RowInfoArray If this is non-NULL on entry, then on exit, this
701 will point to an allocated buffer containing
702 row information and RowInfoArraySize will be
703 updated to contain the number of elements.
704 This array describes the characters which were at
705 least partially drawn and the heights of the
706 rows. It is the caller's responsibility to free
708 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
709 contains the number of elements in RowInfoArray.
710 @param ColumnInfoArray If this is non-NULL, then on return it will be
711 filled with the horizontal offset for each
712 character in the string on the row where it is
713 displayed. Non-printing characters will have
714 the offset ~0. The caller is responsible to
715 allocate a buffer large enough so that there
716 is one entry for each character in the string,
717 not including the null-terminator. It is possible
718 when character display is normalized that some
719 character cells overlap.
721 @retval EFI_SUCCESS The string was successfully rendered.
722 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
724 @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.
725 @retval EFI_INVALID_PARAMETER Flags were invalid combination.
726 @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not
727 in the specified PackageList.
733 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
734 IN EFI_HII_OUT_FLAGS Flags
,
735 IN EFI_HII_HANDLE PackageList
,
736 IN EFI_STRING_ID StringId
,
737 IN CONST CHAR8
*Language
,
738 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
739 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
742 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
743 OUT UINTN
*RowInfoArraySize OPTIONAL
,
744 OUT UINTN
*ColumnInfoArray OPTIONAL
748 Convert the glyph for a single character into a bitmap.
750 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
751 @param Char Character to retrieve.
752 @param StringInfo Points to the string font and color information
753 or NULL if the string should use the default
754 system font and color.
755 @param Blt Thus must point to a NULL on entry. A buffer will
756 be allocated to hold the output and the pointer
757 updated on exit. It is the caller's
758 responsibility to free this buffer.
759 @param Baseline Number of pixels from the bottom of the bitmap to
762 @retval EFI_SUCCESS Glyph bitmap created.
763 @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.
764 @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was replaced with the
765 glyph for Unicode character 0xFFFD.
766 @retval EFI_INVALID_PARAMETER Blt is NULL or *Blt is not NULL.
772 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
774 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo
,
775 OUT EFI_IMAGE_OUTPUT
**Blt
,
776 OUT UINTN
*Baseline OPTIONAL
780 This function iterates through fonts which match the specified font, using
781 the specified criteria. If String is non-NULL, then all of the characters in
782 the string must exist in order for a candidate font to be returned.
784 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
785 @param FontHandle On entry, points to the font handle returned by a
786 previous call to GetFontInfo() or NULL to start
787 with the first font. On return, points to the
788 returned font handle or points to NULL if there
789 are no more matching fonts.
790 @param StringInfoIn Upon entry, points to the font to return information
791 about. If NULL, then the information about the system
792 default font will be returned.
793 @param StringInfoOut Upon return, contains the matching font's information.
794 If NULL, then no information is returned. This buffer
795 is allocated with a call to the Boot Service AllocatePool().
796 It is the caller's responsibility to call the Boot
797 Service FreePool() when the caller no longer requires
798 the contents of StringInfoOut.
799 @param String Points to the string which will be tested to
800 determine if all characters are available. If
801 NULL, then any font is acceptable.
803 @retval EFI_SUCCESS Matching font returned successfully.
804 @retval EFI_NOT_FOUND No matching font was found.
805 @retval EFI_INVALID_PARAMETER StringInfoIn is NULL.
806 @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.
807 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
813 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
814 IN OUT EFI_FONT_HANDLE
*FontHandle
,
815 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfoIn OPTIONAL
,
816 OUT EFI_FONT_DISPLAY_INFO
**StringInfoOut
,
817 IN CONST EFI_STRING String OPTIONAL
821 // EFI_HII_IMAGE_PROTOCOL interfaces
825 Get the image id of last image block: EFI_HII_IIBT_END_BLOCK when input
826 ImageId is zero, otherwise return the address of the
827 corresponding image block with identifier specified by ImageId.
829 This is a internal function.
831 @param ImageBlocks Points to the beginning of a series of image blocks stored in order.
832 @param ImageId If input ImageId is 0, output the image id of the EFI_HII_IIBT_END_BLOCK;
833 else use this id to find its corresponding image block address.
835 @return The image block address when input ImageId is not zero; otherwise return NULL.
838 EFI_HII_IMAGE_BLOCK
*
839 GetImageIdOrAddress (
840 IN EFI_HII_IMAGE_BLOCK
*ImageBlocks
,
841 IN OUT EFI_IMAGE_ID
*ImageId
845 Return the HII package list identified by PackageList HII handle.
847 @param Database Pointer to HII database list header.
848 @param PackageList HII handle of the package list to locate.
850 @retval The HII package list instance.
852 HII_DATABASE_PACKAGE_LIST_INSTANCE
*
854 IN LIST_ENTRY
*Database
,
855 IN EFI_HII_HANDLE PackageList
859 This function retrieves the image specified by ImageId which is associated with
860 the specified PackageList and copies it into the buffer specified by Image.
862 @param Database A pointer to the database list header.
863 @param PackageList Handle of the package list where this image will
865 @param ImageId The image's id,, which is unique within
867 @param Image Points to the image.
868 @param BitmapOnly TRUE to only return the bitmap type image.
869 FALSE to locate image decoder instance to decode image.
871 @retval EFI_SUCCESS The new image was returned successfully.
872 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
873 database. The specified PackageList is not in the database.
874 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
876 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.
877 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
882 IN LIST_ENTRY
*Database
,
883 IN EFI_HII_HANDLE PackageList
,
884 IN EFI_IMAGE_ID ImageId
,
885 OUT EFI_IMAGE_INPUT
*Image
,
886 IN BOOLEAN BitmapOnly
890 Return the first HII image decoder instance which supports the DecoderName.
892 @param BlockType The image block type.
894 @retval Pointer to the HII image decoder instance.
896 EFI_HII_IMAGE_DECODER_PROTOCOL
*
897 LocateHiiImageDecoder (
902 This function adds the image Image to the group of images owned by PackageList, and returns
903 a new image identifier (ImageId).
905 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
906 @param PackageList Handle of the package list where this image will
908 @param ImageId On return, contains the new image id, which is
909 unique within PackageList.
910 @param Image Points to the image.
912 @retval EFI_SUCCESS The new image was added successfully.
913 @retval EFI_NOT_FOUND The specified PackageList could not be found in
915 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.
916 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.
922 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
923 IN EFI_HII_HANDLE PackageList
,
924 OUT EFI_IMAGE_ID
*ImageId
,
925 IN CONST EFI_IMAGE_INPUT
*Image
929 This function retrieves the image specified by ImageId which is associated with
930 the specified PackageList and copies it into the buffer specified by Image.
932 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
933 @param PackageList Handle of the package list where this image will
935 @param ImageId The image's id,, which is unique within
937 @param Image Points to the image.
939 @retval EFI_SUCCESS The new image was returned successfully.
940 @retval EFI_NOT_FOUND The image specified by ImageId is not available.
941 The specified PackageList is not in the database.
942 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
944 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.
945 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
952 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
953 IN EFI_HII_HANDLE PackageList
,
954 IN EFI_IMAGE_ID ImageId
,
955 OUT EFI_IMAGE_INPUT
*Image
959 This function updates the image specified by ImageId in the specified PackageListHandle to
960 the image specified by Image.
962 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
963 @param PackageList The package list containing the images.
964 @param ImageId The image's id,, which is unique within
966 @param Image Points to the image.
968 @retval EFI_SUCCESS The new image was updated successfully.
969 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
970 database. The specified PackageList is not in the database.
971 @retval EFI_INVALID_PARAMETER The Image was NULL.
977 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
978 IN EFI_HII_HANDLE PackageList
,
979 IN EFI_IMAGE_ID ImageId
,
980 IN CONST EFI_IMAGE_INPUT
*Image
984 This function renders an image to a bitmap or the screen using the specified
985 color and options. It draws the image on an existing bitmap, allocates a new
986 bitmap or uses the screen. The images can be clipped.
988 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
989 @param Flags Describes how the image is to be drawn.
990 @param Image Points to the image to be displayed.
991 @param Blt If this points to a non-NULL on entry, this
992 points to the image, which is Width pixels wide
993 and Height pixels high. The image will be drawn
994 onto this image and EFI_HII_DRAW_FLAG_CLIP is
995 implied. If this points to a NULL on entry, then
996 a buffer will be allocated to hold the generated
997 image and the pointer updated on exit. It is the
998 caller's responsibility to free this buffer.
999 @param BltX Specifies the offset from the left and top edge
1000 of the output image of the first pixel in the
1002 @param BltY Specifies the offset from the left and top edge
1003 of the output image of the first pixel in the
1006 @retval EFI_SUCCESS The image was successfully drawn.
1007 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
1008 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.
1009 @retval EFI_INVALID_PARAMETER Any combination of Flags is invalid.
1015 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
1016 IN EFI_HII_DRAW_FLAGS Flags
,
1017 IN CONST EFI_IMAGE_INPUT
*Image
,
1018 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
1024 This function renders an image to a bitmap or the screen using the specified
1025 color and options. It draws the image on an existing bitmap, allocates a new
1026 bitmap or uses the screen. The images can be clipped.
1028 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
1029 @param Flags Describes how the image is to be drawn.
1030 @param PackageList The package list in the HII database to search
1031 for the specified image.
1032 @param ImageId The image's id, which is unique within
1034 @param Blt If this points to a non-NULL on entry, this
1035 points to the image, which is Width pixels wide
1036 and Height pixels high. The image will be drawn
1038 EFI_HII_DRAW_FLAG_CLIP is implied. If this points
1039 to a NULL on entry, then a buffer will be
1040 allocated to hold the generated image and the
1041 pointer updated on exit. It is the caller's
1042 responsibility to free this buffer.
1043 @param BltX Specifies the offset from the left and top edge
1044 of the output image of the first pixel in the
1046 @param BltY Specifies the offset from the left and top edge
1047 of the output image of the first pixel in the
1050 @retval EFI_SUCCESS The image was successfully drawn.
1051 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
1052 @retval EFI_INVALID_PARAMETER The Blt was NULL.
1053 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
1054 The specified PackageList is not in the database.
1060 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
1061 IN EFI_HII_DRAW_FLAGS Flags
,
1062 IN EFI_HII_HANDLE PackageList
,
1063 IN EFI_IMAGE_ID ImageId
,
1064 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
1070 The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.NewImage().
1071 This protocol invokes EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly.
1073 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
1074 @param PackageList Handle of the package list where this image will
1076 @param ImageId On return, contains the new image id, which is
1077 unique within PackageList.
1078 @param Image Points to the image.
1080 @retval EFI_SUCCESS The new image was added successfully.
1081 @retval EFI_NOT_FOUND The PackageList could not be found.
1082 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.
1083 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.
1088 IN CONST EFI_HII_IMAGE_EX_PROTOCOL
*This
,
1089 IN EFI_HII_HANDLE PackageList
,
1090 OUT EFI_IMAGE_ID
*ImageId
,
1091 IN CONST EFI_IMAGE_INPUT
*Image
1095 Return the information about the image, associated with the package list.
1096 The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.GetImage().
1098 This function is similar to EFI_HII_IMAGE_PROTOCOL.GetImage(). The difference is that
1099 this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the
1100 system if the decoder of the certain image type is not supported by the
1101 EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the
1102 EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that
1103 supports the requested image type.
1105 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
1106 @param PackageList The package list in the HII database to search for the
1108 @param ImageId The image's id, which is unique within PackageList.
1109 @param Image Points to the image.
1111 @retval EFI_SUCCESS The new image was returned successfully.
1112 @retval EFI_NOT_FOUND The image specified by ImageId is not available. The specified
1113 PackageList is not in the Database.
1114 @retval EFI_INVALID_PARAMETER Image was NULL or ImageId was 0.
1115 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there
1116 was not enough memory.
1122 IN CONST EFI_HII_IMAGE_EX_PROTOCOL
*This
,
1123 IN EFI_HII_HANDLE PackageList
,
1124 IN EFI_IMAGE_ID ImageId
,
1125 OUT EFI_IMAGE_INPUT
*Image
1129 Change the information about the image.
1131 Same with EFI_HII_IMAGE_PROTOCOL.SetImage(), this protocol invokes
1132 EFI_HII_IMAGE_PROTOCOL.SetImage()implicitly.
1134 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
1135 @param PackageList The package list containing the images.
1136 @param ImageId The image's id, which is unique within PackageList.
1137 @param Image Points to the image.
1139 @retval EFI_SUCCESS The new image was successfully updated.
1140 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
1141 database. The specified PackageList is not in
1143 @retval EFI_INVALID_PARAMETER The Image was NULL, the ImageId was 0 or
1144 the Image->Bitmap was NULL.
1150 IN CONST EFI_HII_IMAGE_EX_PROTOCOL
*This
,
1151 IN EFI_HII_HANDLE PackageList
,
1152 IN EFI_IMAGE_ID ImageId
,
1153 IN CONST EFI_IMAGE_INPUT
*Image
1157 Renders an image to a bitmap or to the display.
1159 The prototype of this extension function is the same with
1160 EFI_HII_IMAGE_PROTOCOL.DrawImage(). This protocol invokes
1161 EFI_HII_IMAGE_PROTOCOL.DrawImage() implicitly.
1163 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
1164 @param Flags Describes how the image is to be drawn.
1165 @param Image Points to the image to be displayed.
1166 @param Blt If this points to a non-NULL on entry, this points
1167 to the image, which is Width pixels wide and
1168 Height pixels high. The image will be drawn onto
1169 this image and EFI_HII_DRAW_FLAG_CLIP is implied.
1170 If this points to a NULL on entry, then a buffer
1171 will be allocated to hold the generated image and
1172 the pointer updated on exit. It is the caller's
1173 responsibility to free this buffer.
1174 @param BltX Specifies the offset from the left and top edge of
1175 the output image of the first pixel in the image.
1176 @param BltY Specifies the offset from the left and top edge of
1177 the output image of the first pixel in the image.
1179 @retval EFI_SUCCESS The image was successfully drawn.
1180 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
1181 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.
1187 IN CONST EFI_HII_IMAGE_EX_PROTOCOL
*This
,
1188 IN EFI_HII_DRAW_FLAGS Flags
,
1189 IN CONST EFI_IMAGE_INPUT
*Image
,
1190 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
1196 Renders an image to a bitmap or the screen containing the contents of the specified
1199 This function is similar to EFI_HII_IMAGE_PROTOCOL.DrawImageId(). The difference is that
1200 this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the
1201 system if the decoder of the certain image type is not supported by the
1202 EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the
1203 EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that
1204 supports the requested image type.
1206 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
1207 @param Flags Describes how the image is to be drawn.
1208 @param PackageList The package list in the HII database to search for
1209 the specified image.
1210 @param ImageId The image's id, which is unique within PackageList.
1211 @param Blt If this points to a non-NULL on entry, this points
1212 to the image, which is Width pixels wide and
1213 Height pixels high. The image will be drawn onto
1214 this image and EFI_HII_DRAW_FLAG_CLIP is implied.
1215 If this points to a NULL on entry, then a buffer
1216 will be allocated to hold the generated image
1217 and the pointer updated on exit. It is the caller's
1218 responsibility to free this buffer.
1219 @param BltX Specifies the offset from the left and top edge of
1220 the output image of the first pixel in the image.
1221 @param BltY Specifies the offset from the left and top edge of
1222 the output image of the first pixel in the image.
1224 @retval EFI_SUCCESS The image was successfully drawn.
1225 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
1226 @retval EFI_INVALID_PARAMETER The Blt was NULL or ImageId was 0.
1227 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
1228 The specified PackageList is not in the database.
1234 IN CONST EFI_HII_IMAGE_EX_PROTOCOL
*This
,
1235 IN EFI_HII_DRAW_FLAGS Flags
,
1236 IN EFI_HII_HANDLE PackageList
,
1237 IN EFI_IMAGE_ID ImageId
,
1238 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
1244 This function returns the image information to EFI_IMAGE_OUTPUT. Only the width
1245 and height are returned to the EFI_IMAGE_OUTPUT instead of decoding the image
1246 to the buffer. This function is used to get the geometry of the image. This function
1247 will try to locate all of the EFI_HII_IMAGE_DECODER_PROTOCOL installed on the
1248 system if the decoder of image type is not supported by the EFI_HII_IMAGE_EX_PROTOCOL.
1250 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
1251 @param PackageList Handle of the package list where this image will
1253 @param ImageId The image's id, which is unique within PackageList.
1254 @param Image Points to the image.
1256 @retval EFI_SUCCESS The new image was returned successfully.
1257 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
1258 database. The specified PackageList is not in the database.
1259 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
1261 @retval EFI_INVALID_PARAMETER The Image was NULL or the ImageId was 0.
1262 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there
1263 was not enough memory.
1269 IN CONST EFI_HII_IMAGE_EX_PROTOCOL
*This
,
1270 IN EFI_HII_HANDLE PackageList
,
1271 IN EFI_IMAGE_ID ImageId
,
1272 OUT EFI_IMAGE_OUTPUT
*Image
1276 // EFI_HII_STRING_PROTOCOL
1280 This function adds the string String to the group of strings owned by PackageList, with the
1281 specified font information StringFontInfo and returns a new string id.
1283 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1285 @param PackageList Handle of the package list where this string will
1287 @param StringId On return, contains the new strings id, which is
1288 unique within PackageList.
1289 @param Language Points to the language for the new string.
1290 @param LanguageName Points to the printable language name to
1291 associate with the passed in Language field.If
1292 LanguageName is not NULL and the string package
1293 header's LanguageName associated with a given
1294 Language is not zero, the LanguageName being
1295 passed in will be ignored.
1296 @param String Points to the new null-terminated string.
1297 @param StringFontInfo Points to the new string's font information or
1298 NULL if the string should have the default system
1299 font, size and style.
1301 @retval EFI_SUCCESS The new string was added successfully.
1302 @retval EFI_NOT_FOUND The specified PackageList could not be found in
1304 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of
1306 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL or Language is
1313 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1314 IN EFI_HII_HANDLE PackageList
,
1315 OUT EFI_STRING_ID
*StringId
,
1316 IN CONST CHAR8
*Language
,
1317 IN CONST CHAR16
*LanguageName OPTIONAL
,
1318 IN CONST EFI_STRING String
,
1319 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
1323 This function retrieves the string specified by StringId which is associated
1324 with the specified PackageList in the language Language and copies it into
1325 the buffer specified by String.
1327 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1329 @param Language Points to the language for the retrieved string.
1330 @param PackageList The package list in the HII database to search
1331 for the specified string.
1332 @param StringId The string's id, which is unique within
1334 @param String Points to the new null-terminated string.
1335 @param StringSize On entry, points to the size of the buffer
1336 pointed to by String, in bytes. On return,
1337 points to the length of the string, in bytes.
1338 @param StringFontInfo If not NULL, points to the string's font
1339 information. It's caller's responsibility to
1342 @retval EFI_SUCCESS The string was returned successfully.
1343 @retval EFI_NOT_FOUND The string specified by StringId is not
1345 The specified PackageList is not in the database.
1346 @retval EFI_INVALID_LANGUAGE The string specified by StringId is available but
1347 not in the specified language.
1348 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small
1350 @retval EFI_INVALID_PARAMETER The Language or StringSize was NULL.
1351 @retval EFI_INVALID_PARAMETER The value referenced by StringSize was not zero
1352 and String was NULL.
1353 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
1360 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1361 IN CONST CHAR8
*Language
,
1362 IN EFI_HII_HANDLE PackageList
,
1363 IN EFI_STRING_ID StringId
,
1364 OUT EFI_STRING String
,
1365 IN OUT UINTN
*StringSize
,
1366 OUT EFI_FONT_INFO
**StringFontInfo OPTIONAL
1370 This function updates the string specified by StringId in the specified PackageList to the text
1371 specified by String and, optionally, the font information specified by StringFontInfo.
1373 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1375 @param PackageList The package list containing the strings.
1376 @param StringId The string's id, which is unique within
1378 @param Language Points to the language for the updated string.
1379 @param String Points to the new null-terminated string.
1380 @param StringFontInfo Points to the string's font information or NULL
1381 if the string font information is not changed.
1383 @retval EFI_SUCCESS The string was updated successfully.
1384 @retval EFI_NOT_FOUND The string specified by StringId is not in the
1386 @retval EFI_INVALID_PARAMETER The String or Language was NULL.
1387 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
1394 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1395 IN EFI_HII_HANDLE PackageList
,
1396 IN EFI_STRING_ID StringId
,
1397 IN CONST CHAR8
*Language
,
1398 IN CONST EFI_STRING String
,
1399 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
1403 This function returns the list of supported languages, in the format specified
1404 in Appendix M of UEFI 2.1 spec.
1406 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1408 @param PackageList The package list to examine.
1409 @param Languages Points to the buffer to hold the returned
1410 null-terminated ASCII string.
1411 @param LanguagesSize On entry, points to the size of the buffer
1412 pointed to by Languages, in bytes. On return,
1413 points to the length of Languages, in bytes.
1415 @retval EFI_SUCCESS The languages were returned successfully.
1416 @retval EFI_INVALID_PARAMETER The LanguagesSize was NULL.
1417 @retval EFI_INVALID_PARAMETER The value referenced by LanguagesSize is not zero and Languages is NULL.
1418 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list
1419 of supported languages. LanguageSize is updated
1420 to contain the required size.
1421 @retval EFI_NOT_FOUND Could not find string package in specified
1428 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1429 IN EFI_HII_HANDLE PackageList
,
1430 IN OUT CHAR8
*Languages
,
1431 IN OUT UINTN
*LanguagesSize
1435 Each string package has associated with it a single primary language and zero
1436 or more secondary languages. This routine returns the secondary languages
1437 associated with a package list.
1439 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1441 @param PackageList The package list to examine.
1442 @param PrimaryLanguage Points to the null-terminated ASCII string that specifies
1443 the primary language. Languages are specified in the
1444 format specified in Appendix M of the UEFI 2.0 specification.
1445 @param SecondaryLanguages Points to the buffer to hold the returned null-terminated
1446 ASCII string that describes the list of
1447 secondary languages for the specified
1448 PrimaryLanguage. If there are no secondary
1449 languages, the function returns successfully,
1450 but this is set to NULL.
1451 @param SecondaryLanguagesSize On entry, points to the size of the buffer
1452 pointed to by SecondaryLanguages, in bytes. On
1453 return, points to the length of SecondaryLanguages
1456 @retval EFI_SUCCESS Secondary languages were correctly returned.
1457 @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguagesSize was NULL.
1458 @retval EFI_INVALID_PARAMETER The value referenced by SecondaryLanguagesSize is not
1459 zero and SecondaryLanguages is NULL.
1460 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is
1461 too small to hold the returned information.
1462 SecondaryLanguageSize is updated to hold the size of
1463 the buffer required.
1464 @retval EFI_INVALID_LANGUAGE The language specified by PrimaryLanguage is not
1465 present in the specified package list.
1466 @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
1471 HiiGetSecondaryLanguages (
1472 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1473 IN EFI_HII_HANDLE PackageList
,
1474 IN CONST CHAR8
*PrimaryLanguage
,
1475 IN OUT CHAR8
*SecondaryLanguages
,
1476 IN OUT UINTN
*SecondaryLanguagesSize
1480 // EFI_HII_DATABASE_PROTOCOL protocol interfaces
1484 This function adds the packages in the package list to the database and returns a handle. If there is a
1485 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will
1486 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.
1488 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1490 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1492 @param DriverHandle Associate the package list with this EFI handle.
1493 If a NULL is specified, this data will not be associate
1494 with any drivers and cannot have a callback induced.
1495 @param Handle A pointer to the EFI_HII_HANDLE instance.
1497 @retval EFI_SUCCESS The package list associated with the Handle was
1498 added to the HII database.
1499 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the
1500 new database contents.
1501 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.
1507 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1508 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
,
1509 IN CONST EFI_HANDLE DriverHandle OPTIONAL
,
1510 OUT EFI_HII_HANDLE
*Handle
1514 This function removes the package list that is associated with a handle Handle
1515 from the HII database. Before removing the package, any registered functions
1516 with the notification type REMOVE_PACK and the same package type will be called.
1518 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1520 @param Handle The handle that was registered to the data that
1521 is requested for removal.
1523 @retval EFI_SUCCESS The data associated with the Handle was removed
1524 from the HII database.
1525 @retval EFI_NOT_FOUND The specified Handle is not in database.
1530 HiiRemovePackageList (
1531 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1532 IN EFI_HII_HANDLE Handle
1536 This function updates the existing package list (which has the specified Handle)
1537 in the HII databases, using the new package list specified by PackageList.
1539 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1541 @param Handle The handle that was registered to the data that
1542 is requested to be updated.
1543 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1546 @retval EFI_SUCCESS The HII database was successfully updated.
1547 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated
1549 @retval EFI_INVALID_PARAMETER PackageList was NULL.
1550 @retval EFI_NOT_FOUND The specified Handle is not in database.
1555 HiiUpdatePackageList (
1556 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1557 IN EFI_HII_HANDLE Handle
,
1558 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
1562 This function returns a list of the package handles of the specified type
1563 that are currently active in the database. The pseudo-type
1564 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.
1566 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1568 @param PackageType Specifies the package type of the packages to
1569 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1571 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1572 this is the pointer to the GUID which must match
1573 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.
1574 Otherwise, it must be NULL.
1575 @param HandleBufferLength On input, a pointer to the length of the handle
1576 buffer. On output, the length of the handle
1577 buffer that is required for the handles found.
1578 @param Handle An array of EFI_HII_HANDLE instances returned.
1580 @retval EFI_SUCCESS The matching handles are outputted successfully.
1581 HandleBufferLength is updated with the actual length.
1582 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1583 Handle is too small to support the number of
1584 handles. HandleBufferLength is updated with a
1585 value that will enable the data to fit.
1586 @retval EFI_NOT_FOUND No matching handle could not be found in
1588 @retval EFI_INVALID_PARAMETER HandleBufferLength was NULL.
1589 @retval EFI_INVALID_PARAMETER The value referenced by HandleBufferLength was not
1590 zero and Handle was NULL.
1591 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
1592 PackageGuid is not NULL, PackageType is a EFI_HII_
1593 PACKAGE_TYPE_GUID but PackageGuid is NULL.
1598 HiiListPackageLists (
1599 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1600 IN UINT8 PackageType
,
1601 IN CONST EFI_GUID
*PackageGuid
,
1602 IN OUT UINTN
*HandleBufferLength
,
1603 OUT EFI_HII_HANDLE
*Handle
1607 This function will export one or all package lists in the database to a buffer.
1608 For each package list exported, this function will call functions registered
1609 with EXPORT_PACK and then copy the package list to the buffer.
1611 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1613 @param Handle An EFI_HII_HANDLE that corresponds to the desired
1614 package list in the HII database to export or
1615 NULL to indicate all package lists should be
1617 @param BufferSize On input, a pointer to the length of the buffer.
1618 On output, the length of the buffer that is
1619 required for the exported data.
1620 @param Buffer A pointer to a buffer that will contain the
1621 results of the export function.
1623 @retval EFI_SUCCESS Package exported.
1624 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1625 Handle is too small to support the number of
1626 handles. HandleBufferLength is updated with
1627 a value that will enable the data to fit.
1628 @retval EFI_NOT_FOUND The specified Handle could not be found in the
1630 @retval EFI_INVALID_PARAMETER BufferSize was NULL.
1631 @retval EFI_INVALID_PARAMETER The value referenced by BufferSize was not zero
1632 and Buffer was NULL.
1637 HiiExportPackageLists (
1638 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1639 IN EFI_HII_HANDLE Handle
,
1640 IN OUT UINTN
*BufferSize
,
1641 OUT EFI_HII_PACKAGE_LIST_HEADER
*Buffer
1645 This function registers a function which will be called when specified actions related to packages of
1646 the specified type occur in the HII database. By registering a function, other HII-related drivers are
1647 notified when specific package types are added, removed or updated in the HII database.
1648 Each driver or application which registers a notification should use
1649 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.
1651 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1653 @param PackageType Specifies the package type of the packages to
1654 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1656 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1657 this is the pointer to the GUID which must match
1659 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must
1661 @param PackageNotifyFn Points to the function to be called when the
1663 NotificationType occurs.
1664 @param NotifyType Describes the types of notification which this
1665 function will be receiving.
1666 @param NotifyHandle Points to the unique handle assigned to the
1667 registered notification. Can be used in
1668 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()
1669 to stop notifications.
1671 @retval EFI_SUCCESS Notification registered successfully.
1672 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures
1673 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.
1674 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not
1675 EFI_HII_PACKAGE_TYPE_GUID.
1676 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is
1677 EFI_HII_PACKAGE_TYPE_GUID.
1682 HiiRegisterPackageNotify (
1683 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1684 IN UINT8 PackageType
,
1685 IN CONST EFI_GUID
*PackageGuid
,
1686 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn
,
1687 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
1688 OUT EFI_HANDLE
*NotifyHandle
1692 Removes the specified HII database package-related notification.
1694 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1696 @param NotificationHandle The handle of the notification function being
1699 @retval EFI_SUCCESS Notification is unregistered successfully.
1700 @retval EFI_NOT_FOUND The incoming notification handle does not exist
1701 in current hii database.
1706 HiiUnregisterPackageNotify (
1707 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1708 IN EFI_HANDLE NotificationHandle
1712 This routine retrieves an array of GUID values for each keyboard layout that
1713 was previously registered in the system.
1715 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1717 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard
1718 GUID buffer. On output, the length of the handle
1719 buffer that is required for the handles found.
1720 @param KeyGuidBuffer An array of keyboard layout GUID instances
1723 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.
1724 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates
1725 that KeyGuidBuffer is too small to support the
1726 number of GUIDs. KeyGuidBufferLength is
1727 updated with a value that will enable the data to
1729 @retval EFI_INVALID_PARAMETER The KeyGuidBufferLength is NULL.
1730 @retval EFI_INVALID_PARAMETER The value referenced by KeyGuidBufferLength is not
1731 zero and KeyGuidBuffer is NULL.
1732 @retval EFI_NOT_FOUND There was no keyboard layout.
1737 HiiFindKeyboardLayouts (
1738 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1739 IN OUT UINT16
*KeyGuidBufferLength
,
1740 OUT EFI_GUID
*KeyGuidBuffer
1744 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys
1745 on a keyboard and the character(s) that are associated with a particular set of key strokes.
1747 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1749 @param KeyGuid A pointer to the unique ID associated with a
1750 given keyboard layout. If KeyGuid is NULL then
1751 the current layout will be retrieved.
1752 @param KeyboardLayoutLength On input, a pointer to the length of the
1753 KeyboardLayout buffer. On output, the length of
1754 the data placed into KeyboardLayout.
1755 @param KeyboardLayout A pointer to a buffer containing the retrieved
1758 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
1759 @retval EFI_NOT_FOUND The requested keyboard layout was not found.
1760 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was
1766 HiiGetKeyboardLayout (
1767 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1768 IN CONST EFI_GUID
*KeyGuid
,
1769 IN OUT UINT16
*KeyboardLayoutLength
,
1770 OUT EFI_HII_KEYBOARD_LAYOUT
*KeyboardLayout
1774 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine
1775 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
1776 group type. This is so that agents which are sensitive to the current keyboard layout being changed
1777 can be notified of this change.
1779 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1781 @param KeyGuid A pointer to the unique ID associated with a
1782 given keyboard layout.
1784 @retval EFI_SUCCESS The current keyboard layout was successfully set.
1785 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so
1787 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.
1792 HiiSetKeyboardLayout (
1793 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1794 IN CONST EFI_GUID
*KeyGuid
1798 Return the EFI handle associated with a package list.
1800 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1802 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired
1803 package list in the HIIdatabase.
1804 @param DriverHandle On return, contains the EFI_HANDLE which was
1805 registered with the package list in
1808 @retval EFI_SUCCESS The DriverHandle was returned successfully.
1809 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or
1810 DriverHandle was NULL.
1815 HiiGetPackageListHandle (
1816 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1817 IN EFI_HII_HANDLE PackageListHandle
,
1818 OUT EFI_HANDLE
*DriverHandle
1822 // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces
1826 This function allows a caller to extract the current configuration
1827 for one or more named elements from one or more drivers.
1829 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1831 @param Request A null-terminated Unicode string in
1832 <MultiConfigRequest> format.
1833 @param Progress On return, points to a character in the Request
1834 string. Points to the string's null terminator if
1835 request was successful. Points to the most recent
1836 & before the first failing name / value pair (or
1837 the beginning of the string if the failure is in
1838 the first name / value pair) if the request was
1840 @param Results Null-terminated Unicode string in
1841 <MultiConfigAltResp> format which has all values
1842 filled in for the names in the Request string.
1843 String to be allocated by the called function.
1845 @retval EFI_SUCCESS The Results string is filled with the values
1846 corresponding to all requested names.
1847 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1848 results that must be stored awaiting possible
1850 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.
1851 Progress set to the "G" in "GUID" of the
1852 routing header that doesn't match. Note: There
1853 is no requirement that all routing data
1854 be validated before any configuration extraction.
1855 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request
1856 parameter would result in this type of error. The
1857 Progress parameter is set to NULL.
1858 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &
1859 before the error or the beginning of the string.
1860 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the
1866 HiiConfigRoutingExtractConfig (
1867 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1868 IN CONST EFI_STRING Request
,
1869 OUT EFI_STRING
*Progress
,
1870 OUT EFI_STRING
*Results
1874 This function allows the caller to request the current configuration for the
1875 entirety of the current HII database and returns the data in a null-terminated Unicode string.
1877 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1879 @param Results Null-terminated Unicode string in
1880 <MultiConfigAltResp> format which has all values
1881 filled in for the entirety of the current HII
1882 database. String to be allocated by the called
1883 function. De-allocation is up to the caller.
1885 @retval EFI_SUCCESS The Results string is filled with the values
1886 corresponding to all requested names.
1887 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1888 results that must be stored awaiting possible
1890 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results
1891 parameter would result in this type of error.
1896 HiiConfigRoutingExportConfig (
1897 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1898 OUT EFI_STRING
*Results
1902 This function processes the results of processing forms and routes it to the
1903 appropriate handlers or storage.
1905 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1907 @param Configuration A null-terminated Unicode string in
1908 <MulltiConfigResp> format.
1909 @param Progress A pointer to a string filled in with the offset
1910 of the most recent & before the first failing
1911 name / value pair (or the beginning of the string
1912 if the failure is in the first name / value pair)
1913 or the terminating NULL if all was successful.
1915 @retval EFI_SUCCESS The results have been distributed or are awaiting
1917 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1918 results that must be stored awaiting possible
1920 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter
1921 would result in this type of error.
1922 @retval EFI_NOT_FOUND Target for the specified routing data was not
1928 HiiConfigRoutingRouteConfig (
1929 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1930 IN CONST EFI_STRING Configuration
,
1931 OUT EFI_STRING
*Progress
1935 This helper function is to be called by drivers to map configuration data stored
1936 in byte array ("block") formats such as UEFI Variables into current configuration strings.
1938 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1940 @param ConfigRequest A null-terminated Unicode string in
1941 <ConfigRequest> format.
1942 @param Block Array of bytes defining the block's
1944 @param BlockSize Length in bytes of Block.
1945 @param Config Filled-in configuration string. String allocated
1946 by the function. Returned only if call is
1948 @param Progress A pointer to a string filled in with the offset
1949 of the most recent & before the first failing
1950 name/value pair (or the beginning of the string
1951 if the failure is in the first name / value pair)
1952 or the terminating NULL if all was successful.
1954 @retval EFI_SUCCESS The request succeeded. Progress points to the
1955 null terminator at the end of the ConfigRequest
1957 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1958 Progress points to the first character of
1960 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or
1961 Block parameter would result in this type of
1962 error. Progress points to the first character of
1964 @retval EFI_NOT_FOUND Target for the specified routing data was not
1965 found. Progress points to the "G" in "GUID" of
1966 the errant routing data.
1967 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.
1968 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.
1969 Block is left updated and Progress points at
1970 the '&' preceding the first non-<BlockName>.
1976 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1977 IN CONST EFI_STRING ConfigRequest
,
1978 IN CONST UINT8
*Block
,
1979 IN CONST UINTN BlockSize
,
1980 OUT EFI_STRING
*Config
,
1981 OUT EFI_STRING
*Progress
1985 This helper function is to be called by drivers to map configuration strings
1986 to configurations stored in byte array ("block") formats such as UEFI Variables.
1988 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1990 @param ConfigResp A null-terminated Unicode string in <ConfigResp>
1992 @param Block A possibly null array of bytes representing the
1993 current block. Only bytes referenced in the
1994 ConfigResp string in the block are modified. If
1995 this parameter is null or if the *BlockSize
1996 parameter is (on input) shorter than required by
1997 the Configuration string, only the BlockSize
1998 parameter is updated and an appropriate status
1999 (see below) is returned.
2000 @param BlockSize The length of the Block in units of UINT8. On
2001 input, this is the size of the Block. On output,
2002 if successful, contains the largest index of the
2003 modified byte in the Block, or the required buffer
2004 size if the Block is not large enough.
2005 @param Progress On return, points to an element of the ConfigResp
2006 string filled in with the offset of the most
2007 recent '&' before the first failing name / value
2008 pair (or the beginning of the string if the
2009 failure is in the first name / value pair) or
2010 the terminating NULL if all was successful.
2012 @retval EFI_SUCCESS The request succeeded. Progress points to the
2013 null terminator at the end of the ConfigResp
2015 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
2016 Progress points to the first character of
2018 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or
2019 Block parameter would result in this type of
2020 error. Progress points to the first character of
2022 @retval EFI_NOT_FOUND Target for the specified routing data was not
2023 found. Progress points to the "G" in "GUID" of
2024 the errant routing data.
2025 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /
2026 value pair. Block is left updated and
2027 Progress points at the '&' preceding the first
2029 @retval EFI_BUFFER_TOO_SMALL Block not large enough. Progress undefined.
2030 BlockSize is updated with the required buffer size.
2036 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
2037 IN CONST EFI_STRING ConfigResp
,
2038 IN OUT UINT8
*Block
,
2039 IN OUT UINTN
*BlockSize
,
2040 OUT EFI_STRING
*Progress
2044 This helper function is to be called by drivers to extract portions of
2045 a larger configuration string.
2047 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
2049 @param Configuration A null-terminated Unicode string in
2050 <MultiConfigAltResp> format.
2051 @param Guid A pointer to the GUID value to search for in the
2052 routing portion of the ConfigResp string when
2053 retrieving the requested data. If Guid is NULL,
2054 then all GUID values will be searched for.
2055 @param Name A pointer to the NAME value to search for in the
2056 routing portion of the ConfigResp string when
2057 retrieving the requested data. If Name is NULL,
2058 then all Name values will be searched for.
2059 @param DevicePath A pointer to the PATH value to search for in the
2060 routing portion of the ConfigResp string when
2061 retrieving the requested data. If DevicePath is
2062 NULL, then all DevicePath values will be
2064 @param AltCfgId A pointer to the ALTCFG value to search for in
2065 the routing portion of the ConfigResp string
2066 when retrieving the requested data. If this
2067 parameter is NULL, then the current setting will
2069 @param AltCfgResp A pointer to a buffer which will be allocated by
2070 the function which contains the retrieved string
2071 as requested. This buffer is only allocated if
2072 the call was successful.
2074 @retval EFI_SUCCESS The request succeeded. The requested data was
2075 extracted and placed in the newly allocated
2077 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.
2078 @retval EFI_INVALID_PARAMETER Any parameter is invalid.
2079 @retval EFI_NOT_FOUND Target for the specified routing data was not
2086 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
2087 IN CONST EFI_STRING Configuration
,
2088 IN CONST EFI_GUID
*Guid
,
2089 IN CONST EFI_STRING Name
,
2090 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
2091 IN CONST UINT16
*AltCfgId
,
2092 OUT EFI_STRING
*AltCfgResp
2097 This function accepts a <MultiKeywordResp> formatted string, finds the associated
2098 keyword owners, creates a <MultiConfigResp> string from it and forwards it to the
2099 EFI_HII_ROUTING_PROTOCOL.RouteConfig function.
2101 If there is an issue in resolving the contents of the KeywordString, then the
2102 function returns an error and also sets the Progress and ProgressErr with the
2103 appropriate information about where the issue occurred and additional data about
2104 the nature of the issue.
2106 In the case when KeywordString containing multiple keywords, when an EFI_NOT_FOUND
2107 error is generated during processing the second or later keyword element, the system
2108 storage associated with earlier keywords is not modified. All elements of the
2109 KeywordString must successfully pass all tests for format and access prior to making
2110 any modifications to storage.
2112 In the case when EFI_DEVICE_ERROR is returned from the processing of a KeywordString
2113 containing multiple keywords, the state of storage associated with earlier keywords
2117 @param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.
2119 @param KeywordString A null-terminated string in <MultiKeywordResp> format.
2121 @param Progress On return, points to a character in the KeywordString.
2122 Points to the string's NULL terminator if the request
2123 was successful. Points to the most recent '&' before
2124 the first failing name / value pair (or the beginning
2125 of the string if the failure is in the first name / value
2126 pair) if the request was not successful.
2128 @param ProgressErr If during the processing of the KeywordString there was
2129 a failure, this parameter gives additional information
2130 about the possible source of the problem. The various
2131 errors are defined in "Related Definitions" below.
2134 @retval EFI_SUCCESS The specified action was completed successfully.
2136 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
2137 1. KeywordString is NULL.
2138 2. Parsing of the KeywordString resulted in an
2139 error. See Progress and ProgressErr for more data.
2141 @retval EFI_NOT_FOUND An element of the KeywordString was not found.
2142 See ProgressErr for more data.
2144 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
2145 See ProgressErr for more data.
2147 @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr
2150 @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr
2156 EfiConfigKeywordHandlerSetData (
2157 IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL
*This
,
2158 IN CONST EFI_STRING KeywordString
,
2159 OUT EFI_STRING
*Progress
,
2160 OUT UINT32
*ProgressErr
2165 This function accepts a <MultiKeywordRequest> formatted string, finds the underlying
2166 keyword owners, creates a <MultiConfigRequest> string from it and forwards it to the
2167 EFI_HII_ROUTING_PROTOCOL.ExtractConfig function.
2169 If there is an issue in resolving the contents of the KeywordString, then the function
2170 returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the
2171 appropriate information about where the issue occurred and additional data about the
2172 nature of the issue.
2174 In the case when KeywordString is NULL, or contains multiple keywords, or when
2175 EFI_NOT_FOUND is generated while processing the keyword elements, the Results string
2176 contains values returned for all keywords processed prior to the keyword generating the
2177 error but no values for the keyword with error or any following keywords.
2180 @param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.
2182 @param NameSpaceId A null-terminated string containing the platform configuration
2183 language to search through in the system. If a NULL is passed
2184 in, then it is assumed that any platform configuration language
2185 with the prefix of "x-UEFI-" are searched.
2187 @param KeywordString A null-terminated string in <MultiKeywordRequest> format. If a
2188 NULL is passed in the KeywordString field, all of the known
2189 keywords in the system for the NameSpaceId specified are
2190 returned in the Results field.
2192 @param Progress On return, points to a character in the KeywordString. Points
2193 to the string's NULL terminator if the request was successful.
2194 Points to the most recent '&' before the first failing name / value
2195 pair (or the beginning of the string if the failure is in the first
2196 name / value pair) if the request was not successful.
2198 @param ProgressErr If during the processing of the KeywordString there was a
2199 failure, this parameter gives additional information about the
2200 possible source of the problem. See the definitions in SetData()
2201 for valid value definitions.
2203 @param Results A null-terminated string in <MultiKeywordResp> format is returned
2204 which has all the values filled in for the keywords in the
2205 KeywordString. This is a callee-allocated field, and must be freed
2206 by the caller after being used.
2208 @retval EFI_SUCCESS The specified action was completed successfully.
2210 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
2211 1.Progress, ProgressErr, or Results is NULL.
2212 2.Parsing of the KeywordString resulted in an error. See
2213 Progress and ProgressErr for more data.
2216 @retval EFI_NOT_FOUND An element of the KeywordString was not found. See
2217 ProgressErr for more data.
2219 @retval EFI_NOT_FOUND The NamespaceId specified was not found. See ProgressErr
2222 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. See
2223 ProgressErr for more data.
2225 @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr for
2228 @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr
2234 EfiConfigKeywordHandlerGetData (
2235 IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL
*This
,
2236 IN CONST EFI_STRING NameSpaceId OPTIONAL
,
2237 IN CONST EFI_STRING KeywordString OPTIONAL
,
2238 OUT EFI_STRING
*Progress
,
2239 OUT UINT32
*ProgressErr
,
2240 OUT EFI_STRING
*Results
2244 Compare whether two names of languages are identical.
2246 @param Language1 Name of language 1 from StringPackage
2247 @param Language2 Name of language 2 to be compared with language 1.
2250 @retval FALSE not same
2254 HiiCompareLanguage (
2255 IN CHAR8
*Language1
,
2261 Retrieves a pointer to a Null-terminated ASCII string containing the list
2262 of languages that an HII handle in the HII Database supports. The returned
2263 string is allocated using AllocatePool(). The caller is responsible for freeing
2264 the returned string using FreePool(). The format of the returned string follows
2265 the language format assumed the HII Database.
2267 If HiiHandle is NULL, then ASSERT().
2269 @param[in] HiiHandle A handle that was previously registered in the HII Database.
2271 @retval NULL HiiHandle is not registered in the HII database
2272 @retval NULL There are not enough resources available to retrieve the supported
2274 @retval NULL The list of supported languages could not be retrieved.
2275 @retval Other A pointer to the Null-terminated ASCII string of supported languages.
2279 GetSupportedLanguages (
2280 IN EFI_HII_HANDLE HiiHandle
2284 This function mainly use to get HiiDatabase information.
2286 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
2288 @retval EFI_SUCCESS Get the information successfully.
2289 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the Hiidatabase data.
2293 HiiGetDatabaseInfo (
2294 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
2298 This function mainly use to get and update ConfigResp string.
2300 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
2302 @retval EFI_SUCCESS Get the information successfully.
2303 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the Configuration Setting data.
2307 HiiGetConfigRespInfo (
2308 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
2312 Find question default value from PcdNvStoreDefaultValueBuffer
2314 @param DefaultId Default store ID
2315 @param EfiVarStore Point to EFI VarStore header
2316 @param IfrQuestionHdr Point to Question header
2317 @param ValueBuffer Point to Buffer includes the found default setting
2318 @param Width Width of the default value
2319 @param BitFieldQuestion Whether the Question is stored in Bit field.
2321 @retval EFI_SUCCESS Question default value is found.
2322 @retval EFI_NOT_FOUND Question default value is not found.
2325 FindQuestionDefaultSetting (
2326 IN UINT16 DefaultId
,
2327 IN EFI_IFR_VARSTORE_EFI
*EfiVarStore
,
2328 IN EFI_IFR_QUESTION_HEADER
*IfrQuestionHdr
,
2329 OUT VOID
*ValueBuffer
,
2331 IN BOOLEAN BitFieldQuestion
2337 extern EFI_EVENT gHiiKeyboardLayoutChanged
;
2338 extern BOOLEAN gExportAfterReadyToBoot
;