3 Copyright (c) 2007 - 2008, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Private structures definitions in HiiDatabase.
25 #ifndef __HII_DATABASE_PRIVATE_H__
26 #define __HII_DATABASE_PRIVATE_H__
30 #include <Protocol/ConsoleControl.h>
31 #include <Protocol/DevicePath.h>
32 #include <Protocol/HiiFont.h>
33 #include <Protocol/HiiImage.h>
34 #include <Protocol/HiiString.h>
35 #include <Protocol/HiiDatabase.h>
36 #include <Protocol/HiiConfigRouting.h>
37 #include <Protocol/HiiConfigAccess.h>
38 #include <Protocol/SimpleTextOut.h>
40 #include <Guid/HiiKeyBoardLayout.h>
43 #include <Library/DebugLib.h>
44 #include <Library/BaseMemoryLib.h>
45 #include <Library/UefiDriverEntryPoint.h>
46 #include <Library/UefiBootServicesTableLib.h>
47 #include <Library/BaseLib.h>
48 #include <Library/DevicePathLib.h>
49 #include <Library/MemoryAllocationLib.h>
50 #include <Library/IfrSupportLib.h>
51 #include <Library/HiiLib.h>
53 #define HII_DATABASE_NOTIFY_GUID \
55 0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \
58 #define MAX_STRING_LENGTH 1024
59 #define MAX_FONT_NAME_LEN 256
60 #define NARROW_BASELINE 15
61 #define WIDE_BASELINE 14
62 #define SYS_FONT_INFO_MASK 0x37
63 #define REPLACE_UNKNOWN_GLYPH 0xFFFD
64 #define PROPORTIONAL_GLYPH 0x80
65 #define NARROW_GLYPH 0x40
67 #define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))
68 #define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))
69 #define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))
70 #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)
75 #define EFI_HII_VARSTORE_BUFFER 0
76 #define EFI_HII_VARSTORE_NAME_VALUE 1
77 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
79 #define HII_FORMSET_STORAGE_SIGNATURE EFI_SIGNATURE_32 ('H', 'S', 'T', 'G')
84 EFI_HII_HANDLE HiiHandle
;
85 EFI_HANDLE DriverHandle
;
87 UINT8 Type
; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE
91 } HII_FORMSET_STORAGE
;
93 #define HII_FORMSET_STORAGE_FROM_LINK(a) CR (a, HII_FORMSET_STORAGE, Link, HII_FORMSET_STORAGE_SIGNATURE)
97 // String Package definitions
99 #define HII_STRING_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','s','p')
100 typedef struct _HII_STRING_PACKAGE_INSTANCE
{
102 EFI_HII_STRING_PACKAGE_HDR
*StringPkgHdr
;
104 LIST_ENTRY StringEntry
;
105 LIST_ENTRY FontInfoList
; // local font info list
107 } HII_STRING_PACKAGE_INSTANCE
;
110 // Form Package definitions
112 #define HII_IFR_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','f','r','p')
113 typedef struct _HII_IFR_PACKAGE_INSTANCE
{
115 EFI_HII_PACKAGE_HEADER FormPkgHdr
;
118 } HII_IFR_PACKAGE_INSTANCE
;
121 // Simple Font Package definitions
123 #define HII_S_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','s','f','p')
124 typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE
{
126 EFI_HII_SIMPLE_FONT_PACKAGE_HDR
*SimpleFontPkgHdr
;
127 LIST_ENTRY SimpleFontEntry
;
128 } HII_SIMPLE_FONT_PACKAGE_INSTANCE
;
131 // Font Package definitions
133 #define HII_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','f','p')
134 typedef struct _HII_FONT_PACKAGE_INSTANCE
{
136 EFI_HII_FONT_PACKAGE_HDR
*FontPkgHdr
;
138 LIST_ENTRY FontEntry
;
139 LIST_ENTRY GlyphInfoList
;
140 } HII_FONT_PACKAGE_INSTANCE
;
142 #define HII_GLYPH_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','i','s')
143 typedef struct _HII_GLYPH_INFO
{
147 EFI_HII_GLYPH_INFO Cell
;
150 #define HII_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','l','f','i')
151 typedef struct _HII_FONT_INFO
{
154 LIST_ENTRY
*GlobalEntry
;
158 #define HII_GLOBAL_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','f','i')
159 typedef struct _HII_GLOBAL_FONT_INFO
{
162 HII_FONT_PACKAGE_INSTANCE
*FontPackage
;
164 EFI_FONT_INFO
*FontInfo
;
165 } HII_GLOBAL_FONT_INFO
;
168 // Image Package definitions
171 #define HII_PIXEL_MASK 0x80
173 typedef struct _HII_IMAGE_PACKAGE_INSTANCE
{
174 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr
;
175 UINT32 ImageBlockSize
;
176 UINT32 PaletteInfoSize
;
179 } HII_IMAGE_PACKAGE_INSTANCE
;
182 // Keyboard Layout Pacakge definitions
184 #define HII_KB_LAYOUT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','k','l','p')
185 typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
{
188 LIST_ENTRY KeyboardEntry
;
189 } HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
;
192 // Guid Package definitions
194 #define HII_GUID_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','g','p')
195 typedef struct _HII_GUID_PACKAGE_INSTANCE
{
198 LIST_ENTRY GuidEntry
;
199 } HII_GUID_PACKAGE_INSTANCE
;
202 // A package list can contain only one or less than one device path package.
203 // This rule also applies to image package since ImageId can not be duplicate.
205 typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE
{
206 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr
;
207 LIST_ENTRY GuidPkgHdr
;
208 LIST_ENTRY FormPkgHdr
;
209 LIST_ENTRY KeyboardLayoutHdr
;
210 LIST_ENTRY StringPkgHdr
;
211 LIST_ENTRY FontPkgHdr
;
212 HII_IMAGE_PACKAGE_INSTANCE
*ImagePkg
;
213 LIST_ENTRY SimpleFontPkgHdr
;
214 UINT8
*DevicePathPkg
;
215 } HII_DATABASE_PACKAGE_LIST_INSTANCE
;
217 #define HII_HANDLE_SIGNATURE EFI_SIGNATURE_32 ('h','i','h','l')
225 #define HII_DATABASE_RECORD_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','r')
227 typedef struct _HII_DATABASE_RECORD
{
229 HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
;
230 EFI_HANDLE DriverHandle
;
231 EFI_HII_HANDLE Handle
;
232 LIST_ENTRY DatabaseEntry
;
233 } HII_DATABASE_RECORD
;
235 #define HII_DATABASE_NOTIFY_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','n')
237 typedef struct _HII_DATABASE_NOTIFY
{
239 EFI_HANDLE NotifyHandle
;
241 EFI_GUID
*PackageGuid
;
242 EFI_HII_DATABASE_NOTIFY PackageNotifyFn
;
243 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
;
244 LIST_ENTRY DatabaseNotifyEntry
;
245 } HII_DATABASE_NOTIFY
;
247 #define HII_DATABASE_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('H', 'i', 'D', 'p')
249 typedef struct _HII_DATABASE_PRIVATE_DATA
{
251 LIST_ENTRY DatabaseList
;
252 LIST_ENTRY DatabaseNotifyList
;
253 EFI_HII_FONT_PROTOCOL HiiFont
;
254 #ifndef DISABLE_UNUSED_HII_PROTOCOLS
255 EFI_HII_IMAGE_PROTOCOL HiiImage
;
257 EFI_HII_STRING_PROTOCOL HiiString
;
258 EFI_HII_DATABASE_PROTOCOL HiiDatabase
;
259 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting
;
260 LIST_ENTRY HiiHandleList
;
262 LIST_ENTRY FontInfoList
; // global font info list
263 UINTN Attribute
; // default system color
264 EFI_GUID CurrentLayoutGuid
;
265 EFI_HII_KEYBOARD_LAYOUT
*CurrentLayout
;
266 } HII_DATABASE_PRIVATE_DATA
;
268 #define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
270 HII_DATABASE_PRIVATE_DATA, \
272 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
275 #define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
277 HII_DATABASE_PRIVATE_DATA, \
279 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
282 #define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
284 HII_DATABASE_PRIVATE_DATA, \
286 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
289 #define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
291 HII_DATABASE_PRIVATE_DATA, \
293 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
296 #define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
298 HII_DATABASE_PRIVATE_DATA, \
300 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
304 // Internal function prototypes.
308 This function checks whether a handle is a valid EFI_HII_HANDLE
310 @param Handle Pointer to a EFI_HII_HANDLE
313 @retval FALSE Invalid
318 EFI_HII_HANDLE Handle
324 This function checks whether EFI_FONT_INFO exists in current database. If
325 FontInfoMask is specified, check what options can be used to make a match.
326 Note that the masks relate to where the system default should be supplied
327 are ignored by this function.
329 @param Private Hii database private structure.
330 @param FontInfo Points to EFI_FONT_INFO structure.
331 @param FontInfoMask If not NULL, describes what options can be used
332 to make a match between the font requested and
333 the font available. The caller must guarantee
335 @param FontHandle On entry, Points to the font handle returned by a
336 previous call to GetFontInfo() or NULL to start
338 @param GlobalFontInfo If not NULL, output the corresponding globa font
342 @retval FALSE Not existed
347 IN HII_DATABASE_PRIVATE_DATA
*Private
,
348 IN EFI_FONT_INFO
*FontInfo
,
349 IN EFI_FONT_INFO_MASK
*FontInfoMask
, OPTIONAL
350 IN EFI_FONT_HANDLE FontHandle
, OPTIONAL
351 OUT HII_GLOBAL_FONT_INFO
**GlobalFontInfo OPTIONAL
357 Retrieve system default font and color.
359 @param Private HII database driver private data.
360 @param FontInfo Points to system default font output-related
361 information. It's caller's responsibility to free
363 @param FontInfoSize If not NULL, output the size of buffer FontInfo.
365 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.
366 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
368 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
373 IN HII_DATABASE_PRIVATE_DATA
*Private
,
374 OUT EFI_FONT_DISPLAY_INFO
**FontInfo
,
375 OUT UINTN
*FontInfoSize OPTIONAL
381 Parse all string blocks to find a String block specified by StringId.
382 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks
383 within this string package and backup its information.
384 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END).
386 @param Private Hii database private structure.
387 @param StringPackage Hii string package instance.
388 @param StringId The string's id, which is unique within
390 @param BlockType Output the block type of found string block.
391 @param StringBlockAddr Output the block address of found string block.
392 @param StringTextOffset Offset, relative to the found block address, of
393 the string text information.
394 @param LastStringId Output the last string id when StringId = 0.
396 @retval EFI_SUCCESS The string text and font is retrieved
398 @retval EFI_NOT_FOUND The specified text or font info can not be found
400 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
406 IN HII_DATABASE_PRIVATE_DATA
*Private
,
407 IN HII_STRING_PACKAGE_INSTANCE
*StringPackage
,
408 IN EFI_STRING_ID StringId
,
409 OUT UINT8
*BlockType
, OPTIONAL
410 OUT UINT8
**StringBlockAddr
, OPTIONAL
411 OUT UINTN
*StringTextOffset
, OPTIONAL
412 OUT EFI_STRING_ID
*LastStringId OPTIONAL
418 Parse all glyph blocks to find a glyph block specified by CharValue.
419 If CharValue = (CHAR16) (-1), collect all default character cell information
420 within this font package and backup its information.
422 @param FontPackage Hii string package instance.
423 @param CharValue Unicode character value, which identifies a glyph
425 @param GlyphBuffer Output the corresponding bitmap data of the found
426 block. It is the caller's responsiblity to free
428 @param Cell Output cell information of the encoded bitmap.
429 @param GlyphBufferLen If not NULL, output the length of GlyphBuffer.
431 @retval EFI_SUCCESS The bitmap data is retrieved successfully.
432 @retval EFI_NOT_FOUND The specified CharValue does not exist in current
434 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
440 IN HII_FONT_PACKAGE_INSTANCE
*FontPackage
,
442 OUT UINT8
**GlyphBuffer
, OPTIONAL
443 OUT EFI_HII_GLYPH_INFO
*Cell
, OPTIONAL
444 OUT UINTN
*GlyphBufferLen OPTIONAL
449 // EFI_HII_FONT_PROTOCOL protocol interfaces
454 Renders a string to a bitmap or to the display.
456 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
457 @param Flags Describes how the string is to be drawn.
458 @param String Points to the null-terminated string to be
460 @param StringInfo Points to the string output information,
461 including the color and font. If NULL, then the
462 string will be output in the default system font
464 @param Blt If this points to a non-NULL on entry, this
465 points to the image, which is Width pixels wide
466 and Height pixels high. The string will be drawn
468 EFI_HII_OUT_FLAG_CLIP is implied. If this points
469 to a NULL on entry, then a buffer
470 will be allocated to hold the generated image and
471 the pointer updated on exit. It is the caller's
472 responsibility to free this buffer.
473 @param BltX,BLTY Specifies the offset from the left and top edge
474 of the image of the first character cell in the
476 @param RowInfoArray If this is non-NULL on entry, then on exit, this
477 will point to an allocated buffer containing
478 row information and RowInfoArraySize will be
479 updated to contain the number of elements.
480 This array describes the characters which were at
481 least partially drawn and the heights of the
482 rows. It is the caller's responsibility to free
484 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
485 contains the number of elements in RowInfoArray.
486 @param ColumnInfoArray If this is non-NULL, then on return it will be
487 filled with the horizontal offset for each
488 character in the string on the row where it is
489 displayed. Non-printing characters will have
490 the offset ~0. The caller is responsible to
491 allocate a buffer large enough so that there
492 is one entry for each character in the string,
493 not including the null-terminator. It is possible
494 when character display is normalized that some
495 character cells overlap.
497 @retval EFI_SUCCESS The string was successfully rendered.
498 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
500 @retval EFI_INVALID_PARAMETER The String or Blt.
501 @retval EFI_INVALID_PARAMETER Flags were invalid combination..
507 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
508 IN EFI_HII_OUT_FLAGS Flags
,
509 IN CONST EFI_STRING String
,
510 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
511 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
514 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
515 OUT UINTN
*RowInfoArraySize OPTIONAL
,
516 OUT UINTN
*ColumnInfoArray OPTIONAL
522 Render a string to a bitmap or the screen containing the contents of the specified string.
524 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
525 @param Flags Describes how the string is to be drawn.
526 @param PackageList The package list in the HII database to search
527 for the specified string.
528 @param StringId The string's id, which is unique within
530 @param Language Points to the language for the retrieved string.
531 If NULL, then the current system language is
533 @param StringInfo Points to the string output information,
534 including the color and font. If NULL, then the
535 string will be output in the default system font
537 @param Blt If this points to a non-NULL on entry, this
538 points to the image, which is Width pixels wide
539 and Height pixels high. The string will be drawn
541 EFI_HII_OUT_FLAG_CLIP is implied. If this points
542 to a NULL on entry, then a buffer
543 will be allocated to hold the generated image and
544 the pointer updated on exit. It is the caller's
545 responsibility to free this buffer.
546 @param BltX,BLTY Specifies the offset from the left and top edge
547 of the image of the first character cell in the
549 @param RowInfoArray If this is non-NULL on entry, then on exit, this
550 will point to an allocated buffer containing
551 row information and RowInfoArraySize will be
552 updated to contain the number of elements.
553 This array describes the characters which were at
554 least partially drawn and the heights of the
555 rows. It is the caller's responsibility to free
557 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
558 contains the number of elements in RowInfoArray.
559 @param ColumnInfoArray If this is non-NULL, then on return it will be
560 filled with the horizontal offset for each
561 character in the string on the row where it is
562 displayed. Non-printing characters will have
563 the offset ~0. The caller is responsible to
564 allocate a buffer large enough so that there
565 is one entry for each character in the string,
566 not including the null-terminator. It is possible
567 when character display is normalized that some
568 character cells overlap.
570 @retval EFI_SUCCESS The string was successfully rendered.
571 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
573 @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.
574 @retval EFI_INVALID_PARAMETER Flags were invalid combination.
575 @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not
576 in the specified PackageList.
582 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
583 IN EFI_HII_OUT_FLAGS Flags
,
584 IN EFI_HII_HANDLE PackageList
,
585 IN EFI_STRING_ID StringId
,
586 IN CONST CHAR8
* Language
,
587 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
588 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
591 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
592 OUT UINTN
*RowInfoArraySize OPTIONAL
,
593 OUT UINTN
*ColumnInfoArray OPTIONAL
599 Convert the glyph for a single character into a bitmap.
601 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
602 @param Char Character to retrieve.
603 @param StringInfo Points to the string font and color information
604 or NULL if the string should use the default
605 system font and color.
606 @param Blt Thus must point to a NULL on entry. A buffer will
607 be allocated to hold the output and the pointer
608 updated on exit. It is the caller's
609 responsibility to free this buffer.
610 @param Baseline Number of pixels from the bottom of the bitmap to
613 @retval EFI_SUCCESS Glyph bitmap created.
614 @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.
615 @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was replaced with the
616 glyph for Unicode character 0xFFFD.
617 @retval EFI_INVALID_PARAMETER Blt is NULL or *Blt is not NULL.
623 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
625 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo
, OPTIONAL
626 OUT EFI_IMAGE_OUTPUT
**Blt
,
627 OUT UINTN
*Baseline OPTIONAL
633 This function iterates through fonts which match the specified font, using
634 the specified criteria. If String is non-NULL, then all of the characters in
635 the string must exist in order for a candidate font to be returned.
637 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
638 @param FontHandle On entry, points to the font handle returned by a
639 previous call to GetFontInfo() or NULL to start
640 with the first font. On return, points to the
641 returned font handle or points to NULL if there
642 are no more matching fonts.
643 @param StringInfoIn Upon entry, points to the font to return
644 information about. If NULL, then the information about the system default
645 font will be returned.
646 @param StringInfoOut Upon return, contains the matching font's
647 information. If NULL, then no information is
648 returned. It's caller's responsibility to free
650 @param String Points to the string which will be tested to
651 determine if all characters are available. If
652 NULL, then any font is acceptable.
654 @retval EFI_SUCCESS Matching font returned successfully.
655 @retval EFI_NOT_FOUND No matching font was found.
656 @retval EFI_INVALID_PARAMETER StringInfoIn is NULL.
657 @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.
658 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
664 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
665 IN OUT EFI_FONT_HANDLE
*FontHandle
,
666 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfoIn
,
667 OUT EFI_FONT_DISPLAY_INFO
**StringInfoOut
,
668 IN CONST EFI_STRING String OPTIONAL
673 // EFI_HII_IMAGE_PROTOCOL interfaces
678 This function adds the image Image to the group of images owned by PackageList, and returns
679 a new image identifier (ImageId).
681 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
682 @param PackageList Handle of the package list where this image will
684 @param ImageId On return, contains the new image id, which is
685 unique within PackageList.
686 @param Image Points to the image.
688 @retval EFI_SUCCESS The new image was added successfully.
689 @retval EFI_NOT_FOUND The specified PackageList could not be found in
691 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.
692 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.
698 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
699 IN EFI_HII_HANDLE PackageList
,
700 OUT EFI_IMAGE_ID
*ImageId
,
701 IN CONST EFI_IMAGE_INPUT
*Image
707 This function retrieves the image specified by ImageId which is associated with
708 the specified PackageList and copies it into the buffer specified by Image.
710 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
711 @param PackageList Handle of the package list where this image will
713 @param ImageId The image's id,, which is unique within
715 @param Image Points to the image.
717 @retval EFI_SUCCESS The new image was returned successfully.
718 @retval EFI_NOT_FOUND The image specified by ImageId is not available.
719 The specified PackageList is not in the database.
720 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
722 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.
723 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
730 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
731 IN EFI_HII_HANDLE PackageList
,
732 IN EFI_IMAGE_ID ImageId
,
733 OUT EFI_IMAGE_INPUT
*Image
739 This function updates the image specified by ImageId in the specified PackageListHandle to
740 the image specified by Image.
742 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
743 @param PackageList The package list containing the images.
744 @param ImageId The image's id,, which is unique within
746 @param Image Points to the image.
748 @retval EFI_SUCCESS The new image was updated successfully.
749 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
750 database. The specified PackageList is not in the database.
751 @retval EFI_INVALID_PARAMETER The Image was NULL.
757 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
758 IN EFI_HII_HANDLE PackageList
,
759 IN EFI_IMAGE_ID ImageId
,
760 IN CONST EFI_IMAGE_INPUT
*Image
766 This function renders an image to a bitmap or the screen using the specified
767 color and options. It draws the image on an existing bitmap, allocates a new
768 bitmap or uses the screen. The images can be clipped.
770 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
771 @param Flags Describes how the image is to be drawn.
772 @param Image Points to the image to be displayed.
773 @param Blt If this points to a non-NULL on entry, this
774 points to the image, which is Width pixels wide
775 and Height pixels high. The image will be drawn
776 onto this image and EFI_HII_DRAW_FLAG_CLIP is
777 implied. If this points to a NULL on entry, then
778 a buffer will be allocated to hold the generated
779 image and the pointer updated on exit. It is the
780 caller's responsibility to free this buffer.
781 @param BltY Specifies the offset from the left and top edge
782 of the output image of the first pixel in the
785 @retval EFI_SUCCESS The image was successfully drawn.
786 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
787 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.
788 @retval EFI_INVALID_PARAMETER Any combination of Flags is invalid.
794 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
795 IN EFI_HII_DRAW_FLAGS Flags
,
796 IN CONST EFI_IMAGE_INPUT
*Image
,
797 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
805 This function renders an image to a bitmap or the screen using the specified
806 color and options. It draws the image on an existing bitmap, allocates a new
807 bitmap or uses the screen. The images can be clipped.
809 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
810 @param Flags Describes how the image is to be drawn.
811 @param PackageList The package list in the HII database to search
812 for the specified image.
813 @param ImageId The image's id, which is unique within
815 @param Blt If this points to a non-NULL on entry, this
816 points to the image, which is Width pixels wide
817 and Height pixels high. The image will be drawn
819 EFI_HII_DRAW_FLAG_CLIP is implied. If this points
820 to a NULL on entry, then a buffer will be
821 allocated to hold the generated image and the
822 pointer updated on exit. It is the caller's
823 responsibility to free this buffer.
824 @param BltY Specifies the offset from the left and top edge
825 of the output image of the first pixel in the
828 @retval EFI_SUCCESS The image was successfully drawn.
829 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
830 @retval EFI_INVALID_PARAMETER The Blt was NULL.
831 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
832 The specified PackageList is not in the database.
838 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
839 IN EFI_HII_DRAW_FLAGS Flags
,
840 IN EFI_HII_HANDLE PackageList
,
841 IN EFI_IMAGE_ID ImageId
,
842 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
850 // EFI_HII_STRING_PROTOCOL
855 This function adds the string String to the group of strings owned by PackageList, with the
856 specified font information StringFontInfo and returns a new string id.
858 @param This A pointer to the EFI_HII_STRING_PROTOCOL
860 @param PackageList Handle of the package list where this string will
862 @param StringId On return, contains the new strings id, which is
863 unique within PackageList.
864 @param Language Points to the language for the new string.
865 @param LanguageName Points to the printable language name to
866 associate with the passed in Language field.If
867 LanguageName is not NULL and the string package
868 header's LanguageName associated with a given
869 Language is not zero, the LanguageName being
870 passed in will be ignored.
871 @param String Points to the new null-terminated string.
872 @param StringFontInfo Points to the new string's font information or
873 NULL if the string should have the default system
874 font, size and style.
876 @retval EFI_SUCCESS The new string was added successfully.
877 @retval EFI_NOT_FOUND The specified PackageList could not be found in
879 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of
881 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL or Language is
888 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
889 IN EFI_HII_HANDLE PackageList
,
890 OUT EFI_STRING_ID
*StringId
,
891 IN CONST CHAR8
*Language
,
892 IN CONST CHAR16
*LanguageName
, OPTIONAL
893 IN CONST EFI_STRING String
,
894 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
900 This function retrieves the string specified by StringId which is associated
901 with the specified PackageList in the language Language and copies it into
902 the buffer specified by String.
904 @param This A pointer to the EFI_HII_STRING_PROTOCOL
906 @param Language Points to the language for the retrieved string.
907 @param PackageList The package list in the HII database to search
908 for the specified string.
909 @param StringId The string's id, which is unique within
911 @param String Points to the new null-terminated string.
912 @param StringSize On entry, points to the size of the buffer
913 pointed to by String, in bytes. On return,
914 points to the length of the string, in bytes.
915 @param StringFontInfo If not NULL, points to the string's font
916 information. It's caller's responsibility to
919 @retval EFI_SUCCESS The string was returned successfully.
920 @retval EFI_NOT_FOUND The string specified by StringId is not
922 @retval EFI_NOT_FOUND The string specified by StringId is available but
923 not in the specified language.
924 The specified PackageList is not in the database.
925 @retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but
926 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small
928 @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL.
929 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
936 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
937 IN CONST CHAR8
*Language
,
938 IN EFI_HII_HANDLE PackageList
,
939 IN EFI_STRING_ID StringId
,
940 OUT EFI_STRING String
,
941 IN OUT UINTN
*StringSize
,
942 OUT EFI_FONT_INFO
**StringFontInfo OPTIONAL
948 This function updates the string specified by StringId in the specified PackageList to the text
949 specified by String and, optionally, the font information specified by StringFontInfo.
951 @param This A pointer to the EFI_HII_STRING_PROTOCOL
953 @param PackageList The package list containing the strings.
954 @param StringId The string's id, which is unique within
956 @param Language Points to the language for the updated string.
957 @param String Points to the new null-terminated string.
958 @param StringFontInfo Points to the string's font information or NULL
959 if the string font information is not changed.
961 @retval EFI_SUCCESS The string was updated successfully.
962 @retval EFI_NOT_FOUND The string specified by StringId is not in the
964 @retval EFI_INVALID_PARAMETER The String or Language was NULL.
965 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
972 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
973 IN EFI_HII_HANDLE PackageList
,
974 IN EFI_STRING_ID StringId
,
975 IN CONST CHAR8
*Language
,
976 IN CONST EFI_STRING String
,
977 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
983 This function returns the list of supported languages, in the format specified
984 in Appendix M of UEFI 2.1 spec.
986 @param This A pointer to the EFI_HII_STRING_PROTOCOL
988 @param PackageList The package list to examine.
989 @param Languages Points to the buffer to hold the returned string.
990 @param LanguagesSize On entry, points to the size of the buffer
991 pointed to by Languages, in bytes. On return,
992 points to the length of Languages, in bytes.
994 @retval EFI_SUCCESS The languages were returned successfully.
995 @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.
996 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list
997 of supported languages. LanguageSize is updated
998 to contain the required size.
999 @retval EFI_NOT_FOUND Could not find string package in specified
1006 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1007 IN EFI_HII_HANDLE PackageList
,
1008 IN OUT CHAR8
*Languages
,
1009 IN OUT UINTN
*LanguagesSize
1015 Each string package has associated with it a single primary language and zero
1016 or more secondary languages. This routine returns the secondary languages
1017 associated with a package list.
1019 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1021 @param PackageList The package list to examine.
1022 @param FirstLanguage Points to the primary language.
1023 @param SecondaryLanguages Points to the buffer to hold the returned list of
1024 secondary languages for the specified
1025 FirstLanguage. If there are no secondary
1026 languages, the function returns successfully,
1027 but this is set to NULL.
1028 @param SecondaryLanguageSize On entry, points to the size of the buffer
1029 pointed to by SecondLanguages, in bytes. On
1030 return, points to the length of SecondLanguages
1033 @retval EFI_SUCCESS Secondary languages were correctly returned.
1034 @retval EFI_INVALID_PARAMETER FirstLanguage or SecondLanguages or
1035 SecondLanguagesSize was NULL.
1036 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondLanguagesSize is
1037 too small to hold the returned information.
1038 SecondLanguageSize is updated to hold the size of
1039 the buffer required.
1040 @retval EFI_INVALID_LANGUAGE The language specified by FirstLanguage is not
1041 present in the specified package list.
1042 @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
1047 HiiGetSecondaryLanguages (
1048 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1049 IN EFI_HII_HANDLE PackageList
,
1050 IN CONST CHAR8
*FirstLanguage
,
1051 IN OUT CHAR8
*SecondLanguages
,
1052 IN OUT UINTN
*SecondLanguagesSize
1057 // EFI_HII_DATABASE_PROTOCOL protocol interfaces
1062 This function adds the packages in the package list to the database and returns a handle. If there is a
1063 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will
1064 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.
1066 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1068 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1070 @param DriverHandle Associate the package list with this EFI handle.
1071 @param Handle A pointer to the EFI_HII_HANDLE instance.
1073 @retval EFI_SUCCESS The package list associated with the Handle was
1074 added to the HII database.
1075 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the
1076 new database contents.
1077 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.
1083 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1084 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
,
1085 IN CONST EFI_HANDLE DriverHandle
,
1086 OUT EFI_HII_HANDLE
*Handle
1092 This function removes the package list that is associated with a handle Handle
1093 from the HII database. Before removing the package, any registered functions
1094 with the notification type REMOVE_PACK and the same package type will be called.
1096 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1098 @param Handle The handle that was registered to the data that
1099 is requested for removal.
1101 @retval EFI_SUCCESS The data associated with the Handle was removed
1102 from the HII database.
1103 @retval EFI_NOT_FOUND The specified Handle is not in database.
1108 HiiRemovePackageList (
1109 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1110 IN EFI_HII_HANDLE Handle
1116 This function updates the existing package list (which has the specified Handle)
1117 in the HII databases, using the new package list specified by PackageList.
1119 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1121 @param Handle The handle that was registered to the data that
1122 is requested to be updated.
1123 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1126 @retval EFI_SUCCESS The HII database was successfully updated.
1127 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated
1129 @retval EFI_INVALID_PARAMETER PackageList was NULL.
1130 @retval EFI_NOT_FOUND The specified Handle is not in database.
1135 HiiUpdatePackageList (
1136 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1137 IN EFI_HII_HANDLE Handle
,
1138 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
1144 This function returns a list of the package handles of the specified type
1145 that are currently active in the database. The pseudo-type
1146 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.
1148 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1150 @param PackageType Specifies the package type of the packages to
1151 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1153 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1154 this is the pointer to the GUID which must match
1155 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.
1156 Otherwise, it must be NULL.
1157 @param HandleBufferLength On input, a pointer to the length of the handle
1158 buffer. On output, the length of the handle
1159 buffer that is required for the handles found.
1160 @param Handle An array of EFI_HII_HANDLE instances returned.
1162 @retval EFI_SUCCESS The matching handles are outputed successfully.
1163 HandleBufferLength is updated with the actual length.
1164 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1165 Handle is too small to support the number of
1166 handles. HandleBufferLength is updated with a
1167 value that will enable the data to fit.
1168 @retval EFI_NOT_FOUND No matching handle could not be found in
1170 @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.
1171 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
1172 PackageGuid is not NULL, PackageType is a EFI_HII_
1173 PACKAGE_TYPE_GUID but PackageGuid is NULL.
1179 HiiListPackageLists (
1180 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1181 IN UINT8 PackageType
,
1182 IN CONST EFI_GUID
*PackageGuid
,
1183 IN OUT UINTN
*HandleBufferLength
,
1184 OUT EFI_HII_HANDLE
*Handle
1190 This function will export one or all package lists in the database to a buffer.
1191 For each package list exported, this function will call functions registered
1192 with EXPORT_PACK and then copy the package list to the buffer.
1194 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1196 @param Handle An EFI_HII_HANDLE that corresponds to the desired
1197 package list in the HII database to export or
1198 NULL to indicate all package lists should be
1200 @param BufferSize On input, a pointer to the length of the buffer.
1201 On output, the length of the buffer that is
1202 required for the exported data.
1203 @param Buffer A pointer to a buffer that will contain the
1204 results of the export function.
1206 @retval EFI_SUCCESS Package exported.
1207 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1208 Handle is too small to support the number of
1209 handles. HandleBufferLength is updated with
1210 a value that will enable the data to fit.
1211 @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the
1213 @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.
1218 HiiExportPackageLists (
1219 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1220 IN EFI_HII_HANDLE Handle
,
1221 IN OUT UINTN
*BufferSize
,
1222 OUT EFI_HII_PACKAGE_LIST_HEADER
*Buffer
1228 This function registers a function which will be called when specified actions related to packages of
1229 the specified type occur in the HII database. By registering a function, other HII-related drivers are
1230 notified when specific package types are added, removed or updated in the HII database.
1231 Each driver or application which registers a notification should use
1232 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.
1234 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1236 @param PackageType Specifies the package type of the packages to
1237 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1239 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1240 this is the pointer to the GUID which must match
1242 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must
1244 @param PackageNotifyFn Points to the function to be called when the
1246 NotificationType occurs.
1247 @param NotifyType Describes the types of notification which this
1248 function will be receiving.
1249 @param NotifyHandle Points to the unique handle assigned to the
1250 registered notification. Can be used in
1251 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()
1252 to stop notifications.
1254 @retval EFI_SUCCESS Notification registered successfully.
1255 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures
1256 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.
1257 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not
1258 EFI_HII_PACKAGE_TYPE_GUID.
1259 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is
1260 EFI_HII_PACKAGE_TYPE_GUID.
1265 HiiRegisterPackageNotify (
1266 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1267 IN UINT8 PackageType
,
1268 IN CONST EFI_GUID
*PackageGuid
,
1269 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn
,
1270 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
1271 OUT EFI_HANDLE
*NotifyHandle
1277 Removes the specified HII database package-related notification.
1279 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1281 @param NotifyHandle The handle of the notification function being
1284 @retval EFI_SUCCESS Notification is unregistered successfully.
1285 @retval EFI_NOT_FOUND The incoming notification handle does not exist
1286 in current hii database.
1291 HiiUnregisterPackageNotify (
1292 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1293 IN EFI_HANDLE NotificationHandle
1299 This routine retrieves an array of GUID values for each keyboard layout that
1300 was previously registered in the system.
1302 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1304 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard
1305 GUID buffer. On output, the length of the handle
1306 buffer that is required for the handles found.
1307 @param KeyGuidBuffer An array of keyboard layout GUID instances
1310 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.
1311 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates
1312 that KeyGuidBuffer is too small to support the
1313 number of GUIDs. KeyGuidBufferLength is
1314 updated with a value that will enable the data to
1316 @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was
1318 @retval EFI_NOT_FOUND There was no keyboard layout.
1323 HiiFindKeyboardLayouts (
1324 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1325 IN OUT UINT16
*KeyGuidBufferLength
,
1326 OUT EFI_GUID
*KeyGuidBuffer
1332 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys
1333 on a keyboard and the character(s) that are associated with a particular set of key strokes.
1335 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1337 @param KeyGuid A pointer to the unique ID associated with a
1338 given keyboard layout. If KeyGuid is NULL then
1339 the current layout will be retrieved.
1340 @param KeyboardLayoutLength On input, a pointer to the length of the
1341 KeyboardLayout buffer. On output, the length of
1342 the data placed into KeyboardLayout.
1343 @param KeyboardLayout A pointer to a buffer containing the retrieved
1346 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
1347 @retval EFI_NOT_FOUND The requested keyboard layout was not found.
1348 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was
1354 HiiGetKeyboardLayout (
1355 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1356 IN CONST EFI_GUID
*KeyGuid
,
1357 IN OUT UINT16
*KeyboardLayoutLength
,
1358 OUT EFI_HII_KEYBOARD_LAYOUT
*KeyboardLayout
1364 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine
1365 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
1366 group type. This is so that agents which are sensitive to the current keyboard layout being changed
1367 can be notified of this change.
1369 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1371 @param KeyGuid A pointer to the unique ID associated with a
1372 given keyboard layout.
1374 @retval EFI_SUCCESS The current keyboard layout was successfully set.
1375 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so
1377 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.
1382 HiiSetKeyboardLayout (
1383 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1384 IN CONST EFI_GUID
*KeyGuid
1390 Return the EFI handle associated with a package list.
1392 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1394 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired
1395 package list in the HIIdatabase.
1396 @param DriverHandle On return, contains the EFI_HANDLE which was
1397 registered with the package list in
1400 @retval EFI_SUCCESS The DriverHandle was returned successfully.
1401 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or
1402 DriverHandle was NULL.
1407 HiiGetPackageListHandle (
1408 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1409 IN EFI_HII_HANDLE PackageListHandle
,
1410 OUT EFI_HANDLE
*DriverHandle
1415 // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces
1420 This function allows a caller to extract the current configuration
1421 for one or more named elements from one or more drivers.
1423 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1425 @param Request A null-terminated Unicode string in
1426 <MultiConfigRequest> format.
1427 @param Progress On return, points to a character in the Request
1428 string. Points to the string's null terminator if
1429 request was successful. Points to the most recent
1430 & before the first failing name / value pair (or
1431 the beginning of the string if the failure is in
1432 the first name / value pair) if the request was
1434 @param Results Null-terminated Unicode string in
1435 <MultiConfigAltResp> format which has all values
1436 filled in for the names in the Request string.
1437 String to be allocated by the called function.
1439 @retval EFI_SUCCESS The Results string is filled with the values
1440 corresponding to all requested names.
1441 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1442 results that must be stored awaiting possible
1444 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.
1445 Progress set to the "G" in "GUID" of the
1446 routing header that doesn't match. Note: There
1447 is no requirement that all routing data
1448 be validated before any configuration extraction.
1449 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request
1450 parameter would result in this type of error. The
1451 Progress parameter is set to NULL.
1452 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &
1453 before the error or the beginning of the string.
1454 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the
1460 HiiConfigRoutingExtractConfig (
1461 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1462 IN CONST EFI_STRING Request
,
1463 OUT EFI_STRING
*Progress
,
1464 OUT EFI_STRING
*Results
1470 This function allows the caller to request the current configuration for the
1471 entirety of the current HII database and returns the data in a null-terminated Unicode string.
1473 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1475 @param Results Null-terminated Unicode string in
1476 <MultiConfigAltResp> format which has all values
1477 filled in for the names in the Request string.
1478 String to be allocated by the called function.
1479 De-allocation is up to the caller.
1481 @retval EFI_SUCCESS The Results string is filled with the values
1482 corresponding to all requested names.
1483 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1484 results that must be stored awaiting possible
1486 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results
1487 parameter would result in this type of error.
1492 HiiConfigRoutingExportConfig (
1493 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1494 OUT EFI_STRING
*Results
1500 This function processes the results of processing forms and routes it to the
1501 appropriate handlers or storage.
1503 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1505 @param Configuration A null-terminated Unicode string in
1506 <MulltiConfigResp> format.
1507 @param Progress A pointer to a string filled in with the offset
1508 of the most recent & before the first failing
1509 name / value pair (or the beginning of the string
1510 if the failure is in the first name / value pair)
1511 or the terminating NULL if all was successful.
1513 @retval EFI_SUCCESS The results have been distributed or are awaiting
1515 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1516 results that must be stored awaiting possible
1518 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter
1519 would result in this type of error.
1520 @retval EFI_NOT_FOUND Target for the specified routing data was not
1526 HiiConfigRoutingRouteConfig (
1527 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1528 IN CONST EFI_STRING Configuration
,
1529 OUT EFI_STRING
*Progress
1536 This helper function is to be called by drivers to map configuration data stored
1537 in byte array ("block") formats such as UEFI Variables into current configuration strings.
1539 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1541 @param ConfigRequest A null-terminated Unicode string in
1542 <ConfigRequest> format.
1543 @param Block Array of bytes defining the block's
1545 @param BlockSize Length in bytes of Block.
1546 @param Config Filled-in configuration string. String allocated
1547 by the function. Returned only if call is
1549 @param Progress A pointer to a string filled in with the offset
1550 of the most recent & before the first failing
1551 name/value pair (or the beginning of the string
1552 if the failure is in the first name / value pair)
1553 or the terminating NULL if all was successful.
1555 @retval EFI_SUCCESS The request succeeded. Progress points to the
1556 null terminator at the end of the ConfigRequest
1558 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1559 Progress points to the first character of
1561 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or
1562 Block parameter would result in this type of
1563 error. Progress points to the first character of
1565 @retval EFI_NOT_FOUND Target for the specified routing data was not
1566 found. Progress points to the "G" in "GUID" of
1567 the errant routing data.
1568 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.
1569 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.
1570 Block is left updated and Progress points at
1571 the '&' preceding the first non-<BlockName>.
1577 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1578 IN CONST EFI_STRING ConfigRequest
,
1579 IN CONST UINT8
*Block
,
1580 IN CONST UINTN BlockSize
,
1581 OUT EFI_STRING
*Config
,
1582 OUT EFI_STRING
*Progress
1588 This helper function is to be called by drivers to map configuration strings
1589 to configurations stored in byte array ("block") formats such as UEFI Variables.
1591 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1593 @param ConfigResp A null-terminated Unicode string in <ConfigResp>
1595 @param Block A possibly null array of bytes representing the
1596 current block. Only bytes referenced in the
1597 ConfigResp string in the block are modified. If
1598 this parameter is null or if the *BlockSize
1599 parameter is (on input) shorter than required by
1600 the Configuration string, only the BlockSize
1601 parameter is updated and an appropriate status
1602 (see below) is returned.
1603 @param BlockSize The length of the Block in units of UINT8. On
1604 input, this is the size of the Block. On output,
1605 if successful, contains the index of the last
1606 modified byte in the Block.
1607 @param Progress On return, points to an element of the ConfigResp
1608 string filled in with the offset of the most
1609 recent '&' before the first failing name / value
1610 pair (or the beginning of the string if the
1611 failure is in the first name / value pair) or
1612 the terminating NULL if all was successful.
1614 @retval EFI_SUCCESS The request succeeded. Progress points to the
1615 null terminator at the end of the ConfigResp
1617 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1618 Progress points to the first character of
1620 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or
1621 Block parameter would result in this type of
1622 error. Progress points to the first character of
1624 @retval EFI_NOT_FOUND Target for the specified routing data was not
1625 found. Progress points to the "G" in "GUID" of
1626 the errant routing data.
1627 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /
1628 value pair. Block is left updated and
1629 Progress points at the '&' preceding the first
1636 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1637 IN CONST EFI_STRING ConfigResp
,
1638 IN OUT UINT8
*Block
,
1639 IN OUT UINTN
*BlockSize
,
1640 OUT EFI_STRING
*Progress
1646 This helper function is to be called by drivers to extract portions of
1647 a larger configuration string.
1649 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1651 @param Configuration A null-terminated Unicode string in
1652 <MultiConfigAltResp> format.
1653 @param Guid A pointer to the GUID value to search for in the
1654 routing portion of the ConfigResp string when
1655 retrieving the requested data. If Guid is NULL,
1656 then all GUID values will be searched for.
1657 @param Name A pointer to the NAME value to search for in the
1658 routing portion of the ConfigResp string when
1659 retrieving the requested data. If Name is NULL,
1660 then all Name values will be searched for.
1661 @param DevicePath A pointer to the PATH value to search for in the
1662 routing portion of the ConfigResp string when
1663 retrieving the requested data. If DevicePath is
1664 NULL, then all DevicePath values will be
1666 @param AltCfgId A pointer to the ALTCFG value to search for in
1667 the routing portion of the ConfigResp string
1668 when retrieving the requested data. If this
1669 parameter is NULL, then the current setting will
1671 @param AltCfgResp A pointer to a buffer which will be allocated by
1672 the function which contains the retrieved string
1673 as requested. This buffer is only allocated if
1674 the call was successful.
1676 @retval EFI_SUCCESS The request succeeded. The requested data was
1677 extracted and placed in the newly allocated
1679 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.
1680 @retval EFI_INVALID_PARAMETER Any parameter is invalid.
1681 @retval EFI_NOT_FOUND Target for the specified routing data was not
1688 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1689 IN CONST EFI_STRING Configuration
,
1690 IN CONST EFI_GUID
*Guid
,
1691 IN CONST EFI_STRING Name
,
1692 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1693 IN CONST UINT16
*AltCfgId
,
1694 OUT EFI_STRING
*AltCfgResp
1702 extern EFI_EVENT gHiiKeyboardLayoutChanged
;