2 Private structures definitions in HiiDatabase.
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
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __HII_DATABASE_PRIVATE_H__
16 #define __HII_DATABASE_PRIVATE_H__
20 #include <Protocol/ConsoleControl.h>
21 #include <Protocol/DevicePath.h>
22 #include <Protocol/HiiFont.h>
23 #include <Protocol/HiiImage.h>
24 #include <Protocol/HiiString.h>
25 #include <Protocol/HiiDatabase.h>
26 #include <Protocol/HiiConfigRouting.h>
27 #include <Protocol/HiiConfigAccess.h>
28 #include <Protocol/SimpleTextOut.h>
30 #include <Guid/HiiKeyBoardLayout.h>
33 #include <Library/DebugLib.h>
34 #include <Library/BaseMemoryLib.h>
35 #include <Library/UefiDriverEntryPoint.h>
36 #include <Library/UefiBootServicesTableLib.h>
37 #include <Library/BaseLib.h>
38 #include <Library/DevicePathLib.h>
39 #include <Library/MemoryAllocationLib.h>
40 #include <Library/IfrSupportLib.h>
41 #include <Library/HiiLib.h>
42 #include <Library/PcdLib.h>
44 #define HII_DATABASE_NOTIFY_GUID \
46 0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \
49 #define MAX_STRING_LENGTH 1024
50 #define MAX_FONT_NAME_LEN 256
51 #define NARROW_BASELINE 15
52 #define WIDE_BASELINE 14
53 #define SYS_FONT_INFO_MASK 0x37
54 #define REPLACE_UNKNOWN_GLYPH 0xFFFD
55 #define PROPORTIONAL_GLYPH 0x80
56 #define NARROW_GLYPH 0x40
58 #define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))
59 #define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))
60 #define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))
61 #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)
66 #define EFI_HII_VARSTORE_BUFFER 0
67 #define EFI_HII_VARSTORE_NAME_VALUE 1
68 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
70 #define HII_FORMSET_STORAGE_SIGNATURE EFI_SIGNATURE_32 ('H', 'S', 'T', 'G')
75 EFI_HII_HANDLE HiiHandle
;
76 EFI_HANDLE DriverHandle
;
78 UINT8 Type
; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE
82 } HII_FORMSET_STORAGE
;
84 #define HII_FORMSET_STORAGE_FROM_LINK(a) CR (a, HII_FORMSET_STORAGE, Link, HII_FORMSET_STORAGE_SIGNATURE)
88 // String Package definitions
90 #define HII_STRING_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','s','p')
91 typedef struct _HII_STRING_PACKAGE_INSTANCE
{
93 EFI_HII_STRING_PACKAGE_HDR
*StringPkgHdr
;
95 LIST_ENTRY StringEntry
;
96 LIST_ENTRY FontInfoList
; // local font info list
98 } HII_STRING_PACKAGE_INSTANCE
;
101 // Form Package definitions
103 #define HII_IFR_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','f','r','p')
104 typedef struct _HII_IFR_PACKAGE_INSTANCE
{
106 EFI_HII_PACKAGE_HEADER FormPkgHdr
;
109 } HII_IFR_PACKAGE_INSTANCE
;
112 // Simple Font Package definitions
114 #define HII_S_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','s','f','p')
115 typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE
{
117 EFI_HII_SIMPLE_FONT_PACKAGE_HDR
*SimpleFontPkgHdr
;
118 LIST_ENTRY SimpleFontEntry
;
119 } HII_SIMPLE_FONT_PACKAGE_INSTANCE
;
122 // Font Package definitions
124 #define HII_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','f','p')
125 typedef struct _HII_FONT_PACKAGE_INSTANCE
{
127 EFI_HII_FONT_PACKAGE_HDR
*FontPkgHdr
;
129 LIST_ENTRY FontEntry
;
130 LIST_ENTRY GlyphInfoList
;
131 } HII_FONT_PACKAGE_INSTANCE
;
133 #define HII_GLYPH_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','i','s')
134 typedef struct _HII_GLYPH_INFO
{
138 EFI_HII_GLYPH_INFO Cell
;
141 #define HII_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','l','f','i')
142 typedef struct _HII_FONT_INFO
{
145 LIST_ENTRY
*GlobalEntry
;
149 #define HII_GLOBAL_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','f','i')
150 typedef struct _HII_GLOBAL_FONT_INFO
{
153 HII_FONT_PACKAGE_INSTANCE
*FontPackage
;
155 EFI_FONT_INFO
*FontInfo
;
156 } HII_GLOBAL_FONT_INFO
;
159 // Image Package definitions
162 #define HII_PIXEL_MASK 0x80
164 typedef struct _HII_IMAGE_PACKAGE_INSTANCE
{
165 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr
;
166 UINT32 ImageBlockSize
;
167 UINT32 PaletteInfoSize
;
170 } HII_IMAGE_PACKAGE_INSTANCE
;
173 // Keyboard Layout Pacakge definitions
175 #define HII_KB_LAYOUT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','k','l','p')
176 typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
{
179 LIST_ENTRY KeyboardEntry
;
180 } HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
;
183 // Guid Package definitions
185 #define HII_GUID_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','g','p')
186 typedef struct _HII_GUID_PACKAGE_INSTANCE
{
189 LIST_ENTRY GuidEntry
;
190 } HII_GUID_PACKAGE_INSTANCE
;
193 // A package list can contain only one or less than one device path package.
194 // This rule also applies to image package since ImageId can not be duplicate.
196 typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE
{
197 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr
;
198 LIST_ENTRY GuidPkgHdr
;
199 LIST_ENTRY FormPkgHdr
;
200 LIST_ENTRY KeyboardLayoutHdr
;
201 LIST_ENTRY StringPkgHdr
;
202 LIST_ENTRY FontPkgHdr
;
203 HII_IMAGE_PACKAGE_INSTANCE
*ImagePkg
;
204 LIST_ENTRY SimpleFontPkgHdr
;
205 UINT8
*DevicePathPkg
;
206 } HII_DATABASE_PACKAGE_LIST_INSTANCE
;
208 #define HII_HANDLE_SIGNATURE EFI_SIGNATURE_32 ('h','i','h','l')
216 #define HII_DATABASE_RECORD_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','r')
218 typedef struct _HII_DATABASE_RECORD
{
220 HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
;
221 EFI_HANDLE DriverHandle
;
222 EFI_HII_HANDLE Handle
;
223 LIST_ENTRY DatabaseEntry
;
224 } HII_DATABASE_RECORD
;
226 #define HII_DATABASE_NOTIFY_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','n')
228 typedef struct _HII_DATABASE_NOTIFY
{
230 EFI_HANDLE NotifyHandle
;
232 EFI_GUID
*PackageGuid
;
233 EFI_HII_DATABASE_NOTIFY PackageNotifyFn
;
234 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
;
235 LIST_ENTRY DatabaseNotifyEntry
;
236 } HII_DATABASE_NOTIFY
;
238 #define HII_DATABASE_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('H', 'i', 'D', 'p')
240 typedef struct _HII_DATABASE_PRIVATE_DATA
{
242 LIST_ENTRY DatabaseList
;
243 LIST_ENTRY DatabaseNotifyList
;
244 EFI_HII_FONT_PROTOCOL HiiFont
;
245 EFI_HII_IMAGE_PROTOCOL HiiImage
;
246 EFI_HII_STRING_PROTOCOL HiiString
;
247 EFI_HII_DATABASE_PROTOCOL HiiDatabase
;
248 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting
;
249 LIST_ENTRY HiiHandleList
;
251 LIST_ENTRY FontInfoList
; // global font info list
252 UINTN Attribute
; // default system color
253 EFI_GUID CurrentLayoutGuid
;
254 EFI_HII_KEYBOARD_LAYOUT
*CurrentLayout
;
255 } HII_DATABASE_PRIVATE_DATA
;
257 #define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
259 HII_DATABASE_PRIVATE_DATA, \
261 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
264 #define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
266 HII_DATABASE_PRIVATE_DATA, \
268 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
271 #define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
273 HII_DATABASE_PRIVATE_DATA, \
275 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
278 #define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
280 HII_DATABASE_PRIVATE_DATA, \
282 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
285 #define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
287 HII_DATABASE_PRIVATE_DATA, \
289 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
293 // Internal function prototypes.
297 This function checks whether a handle is a valid EFI_HII_HANDLE.
299 @param Handle Pointer to a EFI_HII_HANDLE
302 @retval FALSE Invalid
307 EFI_HII_HANDLE Handle
313 This function checks whether EFI_FONT_INFO exists in current database. If
314 FontInfoMask is specified, check what options can be used to make a match.
315 Note that the masks relate to where the system default should be supplied
316 are ignored by this function.
318 @param Private Hii database private structure.
319 @param FontInfo Points to EFI_FONT_INFO structure.
320 @param FontInfoMask If not NULL, describes what options can be used
321 to make a match between the font requested and
322 the font available. The caller must guarantee
324 @param FontHandle On entry, Points to the font handle returned by a
325 previous call to GetFontInfo() or NULL to start
327 @param GlobalFontInfo If not NULL, output the corresponding globa font
331 @retval FALSE Not existed
336 IN HII_DATABASE_PRIVATE_DATA
*Private
,
337 IN EFI_FONT_INFO
*FontInfo
,
338 IN EFI_FONT_INFO_MASK
*FontInfoMask
, OPTIONAL
339 IN EFI_FONT_HANDLE FontHandle
, OPTIONAL
340 OUT HII_GLOBAL_FONT_INFO
**GlobalFontInfo OPTIONAL
346 Retrieve system default font and color.
348 @param Private HII database driver private data.
349 @param FontInfo Points to system default font output-related
350 information. It's caller's responsibility to free
352 @param FontInfoSize If not NULL, output the size of buffer FontInfo.
354 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.
355 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
357 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
362 IN HII_DATABASE_PRIVATE_DATA
*Private
,
363 OUT EFI_FONT_DISPLAY_INFO
**FontInfo
,
364 OUT UINTN
*FontInfoSize OPTIONAL
370 Parse all string blocks to find a String block specified by StringId.
371 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks
372 within this string package and backup its information.
373 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END).
375 @param Private Hii database private structure.
376 @param StringPackage Hii string package instance.
377 @param StringId The string's id, which is unique within
379 @param BlockType Output the block type of found string block.
380 @param StringBlockAddr Output the block address of found string block.
381 @param StringTextOffset Offset, relative to the found block address, of
382 the string text information.
383 @param LastStringId Output the last string id when StringId = 0.
385 @retval EFI_SUCCESS The string text and font is retrieved
387 @retval EFI_NOT_FOUND The specified text or font info can not be found
389 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
395 IN HII_DATABASE_PRIVATE_DATA
*Private
,
396 IN HII_STRING_PACKAGE_INSTANCE
*StringPackage
,
397 IN EFI_STRING_ID StringId
,
398 OUT UINT8
*BlockType
, OPTIONAL
399 OUT UINT8
**StringBlockAddr
, OPTIONAL
400 OUT UINTN
*StringTextOffset
, OPTIONAL
401 OUT EFI_STRING_ID
*LastStringId OPTIONAL
407 Parse all glyph blocks to find a glyph block specified by CharValue.
408 If CharValue = (CHAR16) (-1), collect all default character cell information
409 within this font package and backup its information.
411 @param FontPackage Hii string package instance.
412 @param CharValue Unicode character value, which identifies a glyph
414 @param GlyphBuffer Output the corresponding bitmap data of the found
415 block. It is the caller's responsiblity to free
417 @param Cell Output cell information of the encoded bitmap.
418 @param GlyphBufferLen If not NULL, output the length of GlyphBuffer.
420 @retval EFI_SUCCESS The bitmap data is retrieved successfully.
421 @retval EFI_NOT_FOUND The specified CharValue does not exist in current
423 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
429 IN HII_FONT_PACKAGE_INSTANCE
*FontPackage
,
431 OUT UINT8
**GlyphBuffer
, OPTIONAL
432 OUT EFI_HII_GLYPH_INFO
*Cell
, OPTIONAL
433 OUT UINTN
*GlyphBufferLen OPTIONAL
438 // EFI_HII_FONT_PROTOCOL protocol interfaces
443 Renders a string to a bitmap or to the display.
445 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
446 @param Flags Describes how the string is to be drawn.
447 @param String Points to the null-terminated string to be
449 @param StringInfo Points to the string output information,
450 including the color and font. If NULL, then the
451 string will be output in the default system font
453 @param Blt If this points to a non-NULL on entry, this
454 points to the image, which is Width pixels wide
455 and Height pixels high. The string will be drawn
457 EFI_HII_OUT_FLAG_CLIP is implied. If this points
458 to a NULL on entry, then a buffer
459 will be allocated to hold the generated image and
460 the pointer updated on exit. It is the caller's
461 responsibility to free this buffer.
462 @param BltX Together with BltX, Specifies the offset from the left and top edge
463 of the image of the first character cell in the
465 @param BltY Together with BltY, Specifies the offset from the left and top edge
466 of the image of the first character cell in the
468 @param RowInfoArray If this is non-NULL on entry, then on exit, this
469 will point to an allocated buffer containing
470 row information and RowInfoArraySize will be
471 updated to contain the number of elements.
472 This array describes the characters which were at
473 least partially drawn and the heights of the
474 rows. It is the caller's responsibility to free
476 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
477 contains the number of elements in RowInfoArray.
478 @param ColumnInfoArray If this is non-NULL, then on return it will be
479 filled with the horizontal offset for each
480 character in the string on the row where it is
481 displayed. Non-printing characters will have
482 the offset ~0. The caller is responsible to
483 allocate a buffer large enough so that there
484 is one entry for each character in the string,
485 not including the null-terminator. It is possible
486 when character display is normalized that some
487 character cells overlap.
489 @retval EFI_SUCCESS The string was successfully rendered.
490 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
492 @retval EFI_INVALID_PARAMETER The String or Blt.
493 @retval EFI_INVALID_PARAMETER Flags were invalid combination..
499 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
500 IN EFI_HII_OUT_FLAGS Flags
,
501 IN CONST EFI_STRING String
,
502 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
503 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
506 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
507 OUT UINTN
*RowInfoArraySize OPTIONAL
,
508 OUT UINTN
*ColumnInfoArray OPTIONAL
514 Render a string to a bitmap or the screen containing the contents of the specified string.
516 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
517 @param Flags Describes how the string is to be drawn.
518 @param PackageList The package list in the HII database to search
519 for the specified string.
520 @param StringId The string's id, which is unique within
522 @param Language Points to the language for the retrieved string.
523 If NULL, then the current system language is
525 @param StringInfo Points to the string output information,
526 including the color and font. If NULL, then the
527 string will be output in the default system font
529 @param Blt If this points to a non-NULL on entry, this
530 points to the image, which is Width pixels wide
531 and Height pixels high. The string will be drawn
533 EFI_HII_OUT_FLAG_CLIP is implied. If this points
534 to a NULL on entry, then a buffer
535 will be allocated to hold the generated image and
536 the pointer updated on exit. It is the caller's
537 responsibility to free this buffer.
538 @param BltX Together with BltX, Specifies the offset from the left and top edge
539 of the image of the first character cell in the
541 @param BltY Together with BltY, Specifies the offset from the left and top edge
542 of the image of the first character cell in the
544 @param RowInfoArray If this is non-NULL on entry, then on exit, this
545 will point to an allocated buffer containing
546 row information and RowInfoArraySize will be
547 updated to contain the number of elements.
548 This array describes the characters which were at
549 least partially drawn and the heights of the
550 rows. It is the caller's responsibility to free
552 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
553 contains the number of elements in RowInfoArray.
554 @param ColumnInfoArray If this is non-NULL, then on return it will be
555 filled with the horizontal offset for each
556 character in the string on the row where it is
557 displayed. Non-printing characters will have
558 the offset ~0. The caller is responsible to
559 allocate a buffer large enough so that there
560 is one entry for each character in the string,
561 not including the null-terminator. It is possible
562 when character display is normalized that some
563 character cells overlap.
565 @retval EFI_SUCCESS The string was successfully rendered.
566 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
568 @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.
569 @retval EFI_INVALID_PARAMETER Flags were invalid combination.
570 @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not
571 in the specified PackageList.
577 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
578 IN EFI_HII_OUT_FLAGS Flags
,
579 IN EFI_HII_HANDLE PackageList
,
580 IN EFI_STRING_ID StringId
,
581 IN CONST CHAR8
* Language
,
582 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
583 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
586 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
587 OUT UINTN
*RowInfoArraySize OPTIONAL
,
588 OUT UINTN
*ColumnInfoArray OPTIONAL
594 Convert the glyph for a single character into a bitmap.
596 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
597 @param Char Character to retrieve.
598 @param StringInfo Points to the string font and color information
599 or NULL if the string should use the default
600 system font and color.
601 @param Blt Thus must point to a NULL on entry. A buffer will
602 be allocated to hold the output and the pointer
603 updated on exit. It is the caller's
604 responsibility to free this buffer.
605 @param Baseline Number of pixels from the bottom of the bitmap to
608 @retval EFI_SUCCESS Glyph bitmap created.
609 @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.
610 @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was replaced with the
611 glyph for Unicode character 0xFFFD.
612 @retval EFI_INVALID_PARAMETER Blt is NULL or *Blt is not NULL.
618 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
620 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo
,
621 OUT EFI_IMAGE_OUTPUT
**Blt
,
622 OUT UINTN
*Baseline OPTIONAL
628 This function iterates through fonts which match the specified font, using
629 the specified criteria. If String is non-NULL, then all of the characters in
630 the string must exist in order for a candidate font to be returned.
632 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
633 @param FontHandle On entry, points to the font handle returned by a
634 previous call to GetFontInfo() or NULL to start
635 with the first font. On return, points to the
636 returned font handle or points to NULL if there
637 are no more matching fonts.
638 @param StringInfoIn Upon entry, points to the font to return
639 information about. If NULL, then the information about the system default
640 font will be returned.
641 @param StringInfoOut Upon return, contains the matching font's
642 information. If NULL, then no information is
643 returned. It's caller's responsibility to free
645 @param String Points to the string which will be tested to
646 determine if all characters are available. If
647 NULL, then any font is acceptable.
649 @retval EFI_SUCCESS Matching font returned successfully.
650 @retval EFI_NOT_FOUND No matching font was found.
651 @retval EFI_INVALID_PARAMETER StringInfoIn is NULL.
652 @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.
653 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
659 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
660 IN OUT EFI_FONT_HANDLE
*FontHandle
,
661 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfoIn
, OPTIONAL
662 OUT EFI_FONT_DISPLAY_INFO
**StringInfoOut
,
663 IN CONST EFI_STRING String OPTIONAL
668 // EFI_HII_IMAGE_PROTOCOL interfaces
673 This function adds the image Image to the group of images owned by PackageList, and returns
674 a new image identifier (ImageId).
676 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
677 @param PackageList Handle of the package list where this image will
679 @param ImageId On return, contains the new image id, which is
680 unique within PackageList.
681 @param Image Points to the image.
683 @retval EFI_SUCCESS The new image was added successfully.
684 @retval EFI_NOT_FOUND The specified PackageList could not be found in
686 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.
687 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.
693 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
694 IN EFI_HII_HANDLE PackageList
,
695 OUT EFI_IMAGE_ID
*ImageId
,
696 IN CONST EFI_IMAGE_INPUT
*Image
702 This function retrieves the image specified by ImageId which is associated with
703 the specified PackageList and copies it into the buffer specified by Image.
705 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
706 @param PackageList Handle of the package list where this image will
708 @param ImageId The image's id,, which is unique within
710 @param Image Points to the image.
712 @retval EFI_SUCCESS The new image was returned successfully.
713 @retval EFI_NOT_FOUND The image specified by ImageId is not available.
714 The specified PackageList is not in the database.
715 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
717 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.
718 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
725 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
726 IN EFI_HII_HANDLE PackageList
,
727 IN EFI_IMAGE_ID ImageId
,
728 OUT EFI_IMAGE_INPUT
*Image
734 This function updates the image specified by ImageId in the specified PackageListHandle to
735 the image specified by Image.
737 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
738 @param PackageList The package list containing the images.
739 @param ImageId The image's id,, which is unique within
741 @param Image Points to the image.
743 @retval EFI_SUCCESS The new image was updated successfully.
744 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
745 database. The specified PackageList is not in the database.
746 @retval EFI_INVALID_PARAMETER The Image was NULL.
752 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
753 IN EFI_HII_HANDLE PackageList
,
754 IN EFI_IMAGE_ID ImageId
,
755 IN CONST EFI_IMAGE_INPUT
*Image
761 This function renders an image to a bitmap or the screen using the specified
762 color and options. It draws the image on an existing bitmap, allocates a new
763 bitmap or uses the screen. The images can be clipped.
765 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
766 @param Flags Describes how the image is to be drawn.
767 @param Image Points to the image to be displayed.
768 @param Blt If this points to a non-NULL on entry, this
769 points to the image, which is Width pixels wide
770 and Height pixels high. The image will be drawn
771 onto this image and EFI_HII_DRAW_FLAG_CLIP is
772 implied. If this points to a NULL on entry, then
773 a buffer will be allocated to hold the generated
774 image and the pointer updated on exit. It is the
775 caller's responsibility to free this buffer.
776 @param BltX Specifies the offset from the left and top edge
777 of the output image of the first pixel in the
779 @param BltY Specifies the offset from the left and top edge
780 of the output image of the first pixel in the
783 @retval EFI_SUCCESS The image was successfully drawn.
784 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
785 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.
786 @retval EFI_INVALID_PARAMETER Any combination of Flags is invalid.
792 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
793 IN EFI_HII_DRAW_FLAGS Flags
,
794 IN CONST EFI_IMAGE_INPUT
*Image
,
795 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
803 This function renders an image to a bitmap or the screen using the specified
804 color and options. It draws the image on an existing bitmap, allocates a new
805 bitmap or uses the screen. The images can be clipped.
807 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
808 @param Flags Describes how the image is to be drawn.
809 @param PackageList The package list in the HII database to search
810 for the specified image.
811 @param ImageId The image's id, which is unique within
813 @param Blt If this points to a non-NULL on entry, this
814 points to the image, which is Width pixels wide
815 and Height pixels high. The image will be drawn
817 EFI_HII_DRAW_FLAG_CLIP is implied. If this points
818 to a NULL on entry, then a buffer will be
819 allocated to hold the generated image and the
820 pointer updated on exit. It is the caller's
821 responsibility to free this buffer.
822 @param BltX Specifies the offset from the left and top edge
823 of the output image of the first pixel in the
825 @param BltY Specifies the offset from the left and top edge
826 of the output image of the first pixel in the
829 @retval EFI_SUCCESS The image was successfully drawn.
830 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
831 @retval EFI_INVALID_PARAMETER The Blt was NULL.
832 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
833 The specified PackageList is not in the database.
839 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
840 IN EFI_HII_DRAW_FLAGS Flags
,
841 IN EFI_HII_HANDLE PackageList
,
842 IN EFI_IMAGE_ID ImageId
,
843 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
851 // EFI_HII_STRING_PROTOCOL
856 This function adds the string String to the group of strings owned by PackageList, with the
857 specified font information StringFontInfo and returns a new string id.
859 @param This A pointer to the EFI_HII_STRING_PROTOCOL
861 @param PackageList Handle of the package list where this string will
863 @param StringId On return, contains the new strings id, which is
864 unique within PackageList.
865 @param Language Points to the language for the new string.
866 @param LanguageName Points to the printable language name to
867 associate with the passed in Language field.If
868 LanguageName is not NULL and the string package
869 header's LanguageName associated with a given
870 Language is not zero, the LanguageName being
871 passed in will be ignored.
872 @param String Points to the new null-terminated string.
873 @param StringFontInfo Points to the new string's font information or
874 NULL if the string should have the default system
875 font, size and style.
877 @retval EFI_SUCCESS The new string was added successfully.
878 @retval EFI_NOT_FOUND The specified PackageList could not be found in
880 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of
882 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL or Language is
889 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
890 IN EFI_HII_HANDLE PackageList
,
891 OUT EFI_STRING_ID
*StringId
,
892 IN CONST CHAR8
*Language
,
893 IN CONST CHAR16
*LanguageName
, OPTIONAL
894 IN CONST EFI_STRING String
,
895 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
901 This function retrieves the string specified by StringId which is associated
902 with the specified PackageList in the language Language and copies it into
903 the buffer specified by String.
905 @param This A pointer to the EFI_HII_STRING_PROTOCOL
907 @param Language Points to the language for the retrieved string.
908 @param PackageList The package list in the HII database to search
909 for the specified string.
910 @param StringId The string's id, which is unique within
912 @param String Points to the new null-terminated string.
913 @param StringSize On entry, points to the size of the buffer
914 pointed to by String, in bytes. On return,
915 points to the length of the string, in bytes.
916 @param StringFontInfo If not NULL, points to the string's font
917 information. It's caller's responsibility to
920 @retval EFI_SUCCESS The string was returned successfully.
921 @retval EFI_NOT_FOUND The string specified by StringId is not
923 @retval EFI_NOT_FOUND The string specified by StringId is available but
924 not in the specified language.
925 The specified PackageList is not in the database.
926 @retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but
927 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small
929 @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL.
930 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
937 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
938 IN CONST CHAR8
*Language
,
939 IN EFI_HII_HANDLE PackageList
,
940 IN EFI_STRING_ID StringId
,
941 OUT EFI_STRING String
,
942 IN OUT UINTN
*StringSize
,
943 OUT EFI_FONT_INFO
**StringFontInfo OPTIONAL
949 This function updates the string specified by StringId in the specified PackageList to the text
950 specified by String and, optionally, the font information specified by StringFontInfo.
952 @param This A pointer to the EFI_HII_STRING_PROTOCOL
954 @param PackageList The package list containing the strings.
955 @param StringId The string's id, which is unique within
957 @param Language Points to the language for the updated string.
958 @param String Points to the new null-terminated string.
959 @param StringFontInfo Points to the string's font information or NULL
960 if the string font information is not changed.
962 @retval EFI_SUCCESS The string was updated successfully.
963 @retval EFI_NOT_FOUND The string specified by StringId is not in the
965 @retval EFI_INVALID_PARAMETER The String or Language was NULL.
966 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
973 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
974 IN EFI_HII_HANDLE PackageList
,
975 IN EFI_STRING_ID StringId
,
976 IN CONST CHAR8
*Language
,
977 IN CONST EFI_STRING String
,
978 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
984 This function returns the list of supported languages, in the format specified
985 in Appendix M of UEFI 2.1 spec.
987 @param This A pointer to the EFI_HII_STRING_PROTOCOL
989 @param PackageList The package list to examine.
990 @param Languages Points to the buffer to hold the returned string.
991 @param LanguagesSize On entry, points to the size of the buffer
992 pointed to by Languages, in bytes. On return,
993 points to the length of Languages, in bytes.
995 @retval EFI_SUCCESS The languages were returned successfully.
996 @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.
997 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list
998 of supported languages. LanguageSize is updated
999 to contain the required size.
1000 @retval EFI_NOT_FOUND Could not find string package in specified
1007 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1008 IN EFI_HII_HANDLE PackageList
,
1009 IN OUT CHAR8
*Languages
,
1010 IN OUT UINTN
*LanguagesSize
1016 Each string package has associated with it a single primary language and zero
1017 or more secondary languages. This routine returns the secondary languages
1018 associated with a package list.
1020 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1022 @param PackageList The package list to examine.
1023 @param FirstLanguage Points to the primary language.
1024 @param SecondaryLanguages Points to the buffer to hold the returned list of
1025 secondary languages for the specified
1026 FirstLanguage. If there are no secondary
1027 languages, the function returns successfully,
1028 but this is set to NULL.
1029 @param SecondaryLanguagesSize On entry, points to the size of the buffer
1030 pointed to by SecondLanguages, in bytes. On
1031 return, points to the length of SecondLanguages
1034 @retval EFI_SUCCESS Secondary languages were correctly returned.
1035 @retval EFI_INVALID_PARAMETER FirstLanguage or SecondLanguages or
1036 SecondLanguagesSize was NULL.
1037 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondLanguagesSize is
1038 too small to hold the returned information.
1039 SecondLanguageSize is updated to hold the size of
1040 the buffer required.
1041 @retval EFI_INVALID_LANGUAGE The language specified by FirstLanguage is not
1042 present in the specified package list.
1043 @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
1048 HiiGetSecondaryLanguages (
1049 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1050 IN EFI_HII_HANDLE PackageList
,
1051 IN CONST CHAR8
*FirstLanguage
,
1052 IN OUT CHAR8
*SecondaryLanguages
,
1053 IN OUT UINTN
*SecondaryLanguagesSize
1058 // EFI_HII_DATABASE_PROTOCOL protocol interfaces
1063 This function adds the packages in the package list to the database and returns a handle. If there is a
1064 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will
1065 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.
1067 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1069 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1071 @param DriverHandle Associate the package list with this EFI handle.
1072 @param Handle A pointer to the EFI_HII_HANDLE instance.
1074 @retval EFI_SUCCESS The package list associated with the Handle was
1075 added to the HII database.
1076 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the
1077 new database contents.
1078 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.
1084 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1085 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
,
1086 IN CONST EFI_HANDLE DriverHandle
,
1087 OUT EFI_HII_HANDLE
*Handle
1093 This function removes the package list that is associated with a handle Handle
1094 from the HII database. Before removing the package, any registered functions
1095 with the notification type REMOVE_PACK and the same package type will be called.
1097 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1099 @param Handle The handle that was registered to the data that
1100 is requested for removal.
1102 @retval EFI_SUCCESS The data associated with the Handle was removed
1103 from the HII database.
1104 @retval EFI_NOT_FOUND The specified Handle is not in database.
1109 HiiRemovePackageList (
1110 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1111 IN EFI_HII_HANDLE Handle
1117 This function updates the existing package list (which has the specified Handle)
1118 in the HII databases, using the new package list specified by PackageList.
1120 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1122 @param Handle The handle that was registered to the data that
1123 is requested to be updated.
1124 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1127 @retval EFI_SUCCESS The HII database was successfully updated.
1128 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated
1130 @retval EFI_INVALID_PARAMETER PackageList was NULL.
1131 @retval EFI_NOT_FOUND The specified Handle is not in database.
1136 HiiUpdatePackageList (
1137 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1138 IN EFI_HII_HANDLE Handle
,
1139 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
1145 This function returns a list of the package handles of the specified type
1146 that are currently active in the database. The pseudo-type
1147 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.
1149 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1151 @param PackageType Specifies the package type of the packages to
1152 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1154 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1155 this is the pointer to the GUID which must match
1156 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.
1157 Otherwise, it must be NULL.
1158 @param HandleBufferLength On input, a pointer to the length of the handle
1159 buffer. On output, the length of the handle
1160 buffer that is required for the handles found.
1161 @param Handle An array of EFI_HII_HANDLE instances returned.
1163 @retval EFI_SUCCESS The matching handles are outputed successfully.
1164 HandleBufferLength is updated with the actual length.
1165 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1166 Handle is too small to support the number of
1167 handles. HandleBufferLength is updated with a
1168 value that will enable the data to fit.
1169 @retval EFI_NOT_FOUND No matching handle could not be found in
1171 @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.
1172 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
1173 PackageGuid is not NULL, PackageType is a EFI_HII_
1174 PACKAGE_TYPE_GUID but PackageGuid is NULL.
1180 HiiListPackageLists (
1181 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1182 IN UINT8 PackageType
,
1183 IN CONST EFI_GUID
*PackageGuid
,
1184 IN OUT UINTN
*HandleBufferLength
,
1185 OUT EFI_HII_HANDLE
*Handle
1191 This function will export one or all package lists in the database to a buffer.
1192 For each package list exported, this function will call functions registered
1193 with EXPORT_PACK and then copy the package list to the buffer.
1195 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1197 @param Handle An EFI_HII_HANDLE that corresponds to the desired
1198 package list in the HII database to export or
1199 NULL to indicate all package lists should be
1201 @param BufferSize On input, a pointer to the length of the buffer.
1202 On output, the length of the buffer that is
1203 required for the exported data.
1204 @param Buffer A pointer to a buffer that will contain the
1205 results of the export function.
1207 @retval EFI_SUCCESS Package exported.
1208 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1209 Handle is too small to support the number of
1210 handles. HandleBufferLength is updated with
1211 a value that will enable the data to fit.
1212 @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the
1214 @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.
1219 HiiExportPackageLists (
1220 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1221 IN EFI_HII_HANDLE Handle
,
1222 IN OUT UINTN
*BufferSize
,
1223 OUT EFI_HII_PACKAGE_LIST_HEADER
*Buffer
1229 This function registers a function which will be called when specified actions related to packages of
1230 the specified type occur in the HII database. By registering a function, other HII-related drivers are
1231 notified when specific package types are added, removed or updated in the HII database.
1232 Each driver or application which registers a notification should use
1233 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.
1235 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1237 @param PackageType Specifies the package type of the packages to
1238 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1240 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1241 this is the pointer to the GUID which must match
1243 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must
1245 @param PackageNotifyFn Points to the function to be called when the
1247 NotificationType occurs.
1248 @param NotifyType Describes the types of notification which this
1249 function will be receiving.
1250 @param NotifyHandle Points to the unique handle assigned to the
1251 registered notification. Can be used in
1252 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()
1253 to stop notifications.
1255 @retval EFI_SUCCESS Notification registered successfully.
1256 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures
1257 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.
1258 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not
1259 EFI_HII_PACKAGE_TYPE_GUID.
1260 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is
1261 EFI_HII_PACKAGE_TYPE_GUID.
1266 HiiRegisterPackageNotify (
1267 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1268 IN UINT8 PackageType
,
1269 IN CONST EFI_GUID
*PackageGuid
,
1270 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn
,
1271 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
1272 OUT EFI_HANDLE
*NotifyHandle
1278 Removes the specified HII database package-related notification.
1280 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1282 @param NotificationHandle The handle of the notification function being
1285 @retval EFI_SUCCESS Notification is unregistered successfully.
1286 @retval EFI_NOT_FOUND The incoming notification handle does not exist
1287 in current hii database.
1292 HiiUnregisterPackageNotify (
1293 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1294 IN EFI_HANDLE NotificationHandle
1300 This routine retrieves an array of GUID values for each keyboard layout that
1301 was previously registered in the system.
1303 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1305 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard
1306 GUID buffer. On output, the length of the handle
1307 buffer that is required for the handles found.
1308 @param KeyGuidBuffer An array of keyboard layout GUID instances
1311 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.
1312 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates
1313 that KeyGuidBuffer is too small to support the
1314 number of GUIDs. KeyGuidBufferLength is
1315 updated with a value that will enable the data to
1317 @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was
1319 @retval EFI_NOT_FOUND There was no keyboard layout.
1324 HiiFindKeyboardLayouts (
1325 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1326 IN OUT UINT16
*KeyGuidBufferLength
,
1327 OUT EFI_GUID
*KeyGuidBuffer
1333 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys
1334 on a keyboard and the character(s) that are associated with a particular set of key strokes.
1336 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1338 @param KeyGuid A pointer to the unique ID associated with a
1339 given keyboard layout. If KeyGuid is NULL then
1340 the current layout will be retrieved.
1341 @param KeyboardLayoutLength On input, a pointer to the length of the
1342 KeyboardLayout buffer. On output, the length of
1343 the data placed into KeyboardLayout.
1344 @param KeyboardLayout A pointer to a buffer containing the retrieved
1347 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
1348 @retval EFI_NOT_FOUND The requested keyboard layout was not found.
1349 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was
1355 HiiGetKeyboardLayout (
1356 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1357 IN CONST EFI_GUID
*KeyGuid
,
1358 IN OUT UINT16
*KeyboardLayoutLength
,
1359 OUT EFI_HII_KEYBOARD_LAYOUT
*KeyboardLayout
1365 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine
1366 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
1367 group type. This is so that agents which are sensitive to the current keyboard layout being changed
1368 can be notified of this change.
1370 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1372 @param KeyGuid A pointer to the unique ID associated with a
1373 given keyboard layout.
1375 @retval EFI_SUCCESS The current keyboard layout was successfully set.
1376 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so
1378 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.
1383 HiiSetKeyboardLayout (
1384 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1385 IN CONST EFI_GUID
*KeyGuid
1391 Return the EFI handle associated with a package list.
1393 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1395 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired
1396 package list in the HIIdatabase.
1397 @param DriverHandle On return, contains the EFI_HANDLE which was
1398 registered with the package list in
1401 @retval EFI_SUCCESS The DriverHandle was returned successfully.
1402 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or
1403 DriverHandle was NULL.
1408 HiiGetPackageListHandle (
1409 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1410 IN EFI_HII_HANDLE PackageListHandle
,
1411 OUT EFI_HANDLE
*DriverHandle
1416 // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces
1421 This function allows a caller to extract the current configuration
1422 for one or more named elements from one or more drivers.
1424 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1426 @param Request A null-terminated Unicode string in
1427 <MultiConfigRequest> format.
1428 @param Progress On return, points to a character in the Request
1429 string. Points to the string's null terminator if
1430 request was successful. Points to the most recent
1431 & before the first failing name / value pair (or
1432 the beginning of the string if the failure is in
1433 the first name / value pair) if the request was
1435 @param Results Null-terminated Unicode string in
1436 <MultiConfigAltResp> format which has all values
1437 filled in for the names in the Request string.
1438 String to be allocated by the called function.
1440 @retval EFI_SUCCESS The Results string is filled with the values
1441 corresponding to all requested names.
1442 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1443 results that must be stored awaiting possible
1445 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.
1446 Progress set to the "G" in "GUID" of the
1447 routing header that doesn't match. Note: There
1448 is no requirement that all routing data
1449 be validated before any configuration extraction.
1450 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request
1451 parameter would result in this type of error. The
1452 Progress parameter is set to NULL.
1453 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &
1454 before the error or the beginning of the string.
1455 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the
1461 HiiConfigRoutingExtractConfig (
1462 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1463 IN CONST EFI_STRING Request
,
1464 OUT EFI_STRING
*Progress
,
1465 OUT EFI_STRING
*Results
1471 This function allows the caller to request the current configuration for the
1472 entirety of the current HII database and returns the data in a null-terminated Unicode string.
1474 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1476 @param Results Null-terminated Unicode string in
1477 <MultiConfigAltResp> format which has all values
1478 filled in for the names in the Request string.
1479 String to be allocated by the called function.
1480 De-allocation is up to the caller.
1482 @retval EFI_SUCCESS The Results string is filled with the values
1483 corresponding to all requested names.
1484 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1485 results that must be stored awaiting possible
1487 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results
1488 parameter would result in this type of error.
1493 HiiConfigRoutingExportConfig (
1494 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1495 OUT EFI_STRING
*Results
1501 This function processes the results of processing forms and routes it to the
1502 appropriate handlers or storage.
1504 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1506 @param Configuration A null-terminated Unicode string in
1507 <MulltiConfigResp> format.
1508 @param Progress A pointer to a string filled in with the offset
1509 of the most recent & before the first failing
1510 name / value pair (or the beginning of the string
1511 if the failure is in the first name / value pair)
1512 or the terminating NULL if all was successful.
1514 @retval EFI_SUCCESS The results have been distributed or are awaiting
1516 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1517 results that must be stored awaiting possible
1519 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter
1520 would result in this type of error.
1521 @retval EFI_NOT_FOUND Target for the specified routing data was not
1527 HiiConfigRoutingRouteConfig (
1528 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1529 IN CONST EFI_STRING Configuration
,
1530 OUT EFI_STRING
*Progress
1537 This helper function is to be called by drivers to map configuration data stored
1538 in byte array ("block") formats such as UEFI Variables into current configuration strings.
1540 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1542 @param ConfigRequest A null-terminated Unicode string in
1543 <ConfigRequest> format.
1544 @param Block Array of bytes defining the block's
1546 @param BlockSize Length in bytes of Block.
1547 @param Config Filled-in configuration string. String allocated
1548 by the function. Returned only if call is
1550 @param Progress A pointer to a string filled in with the offset
1551 of the most recent & before the first failing
1552 name/value pair (or the beginning of the string
1553 if the failure is in the first name / value pair)
1554 or the terminating NULL if all was successful.
1556 @retval EFI_SUCCESS The request succeeded. Progress points to the
1557 null terminator at the end of the ConfigRequest
1559 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1560 Progress points to the first character of
1562 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or
1563 Block parameter would result in this type of
1564 error. Progress points to the first character of
1566 @retval EFI_NOT_FOUND Target for the specified routing data was not
1567 found. Progress points to the "G" in "GUID" of
1568 the errant routing data.
1569 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.
1570 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.
1571 Block is left updated and Progress points at
1572 the '&' preceding the first non-<BlockName>.
1578 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1579 IN CONST EFI_STRING ConfigRequest
,
1580 IN CONST UINT8
*Block
,
1581 IN CONST UINTN BlockSize
,
1582 OUT EFI_STRING
*Config
,
1583 OUT EFI_STRING
*Progress
1589 This helper function is to be called by drivers to map configuration strings
1590 to configurations stored in byte array ("block") formats such as UEFI Variables.
1592 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1594 @param ConfigResp A null-terminated Unicode string in <ConfigResp>
1596 @param Block A possibly null array of bytes representing the
1597 current block. Only bytes referenced in the
1598 ConfigResp string in the block are modified. If
1599 this parameter is null or if the *BlockSize
1600 parameter is (on input) shorter than required by
1601 the Configuration string, only the BlockSize
1602 parameter is updated and an appropriate status
1603 (see below) is returned.
1604 @param BlockSize The length of the Block in units of UINT8. On
1605 input, this is the size of the Block. On output,
1606 if successful, contains the index of the last
1607 modified byte in the Block.
1608 @param Progress On return, points to an element of the ConfigResp
1609 string filled in with the offset of the most
1610 recent '&' before the first failing name / value
1611 pair (or the beginning of the string if the
1612 failure is in the first name / value pair) or
1613 the terminating NULL if all was successful.
1615 @retval EFI_SUCCESS The request succeeded. Progress points to the
1616 null terminator at the end of the ConfigResp
1618 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1619 Progress points to the first character of
1621 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or
1622 Block parameter would result in this type of
1623 error. Progress points to the first character of
1625 @retval EFI_NOT_FOUND Target for the specified routing data was not
1626 found. Progress points to the "G" in "GUID" of
1627 the errant routing data.
1628 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /
1629 value pair. Block is left updated and
1630 Progress points at the '&' preceding the first
1637 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1638 IN CONST EFI_STRING ConfigResp
,
1639 IN OUT UINT8
*Block
,
1640 IN OUT UINTN
*BlockSize
,
1641 OUT EFI_STRING
*Progress
1647 This helper function is to be called by drivers to extract portions of
1648 a larger configuration string.
1650 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1652 @param Configuration A null-terminated Unicode string in
1653 <MultiConfigAltResp> format.
1654 @param Guid A pointer to the GUID value to search for in the
1655 routing portion of the ConfigResp string when
1656 retrieving the requested data. If Guid is NULL,
1657 then all GUID values will be searched for.
1658 @param Name A pointer to the NAME value to search for in the
1659 routing portion of the ConfigResp string when
1660 retrieving the requested data. If Name is NULL,
1661 then all Name values will be searched for.
1662 @param DevicePath A pointer to the PATH value to search for in the
1663 routing portion of the ConfigResp string when
1664 retrieving the requested data. If DevicePath is
1665 NULL, then all DevicePath values will be
1667 @param AltCfgId A pointer to the ALTCFG value to search for in
1668 the routing portion of the ConfigResp string
1669 when retrieving the requested data. If this
1670 parameter is NULL, then the current setting will
1672 @param AltCfgResp A pointer to a buffer which will be allocated by
1673 the function which contains the retrieved string
1674 as requested. This buffer is only allocated if
1675 the call was successful.
1677 @retval EFI_SUCCESS The request succeeded. The requested data was
1678 extracted and placed in the newly allocated
1680 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.
1681 @retval EFI_INVALID_PARAMETER Any parameter is invalid.
1682 @retval EFI_NOT_FOUND Target for the specified routing data was not
1689 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1690 IN CONST EFI_STRING Configuration
,
1691 IN CONST EFI_GUID
*Guid
,
1692 IN CONST EFI_STRING Name
,
1693 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1694 IN CONST UINT16
*AltCfgId
,
1695 OUT EFI_STRING
*AltCfgResp
1703 extern EFI_EVENT gHiiKeyboardLayoutChanged
;