2 Private structures definitions in HiiDatabase.
4 Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
5 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/DevicePath.h>
21 #include <Protocol/HiiFont.h>
22 #include <Protocol/HiiImage.h>
23 #include <Protocol/HiiString.h>
24 #include <Protocol/HiiDatabase.h>
25 #include <Protocol/HiiConfigRouting.h>
26 #include <Protocol/HiiConfigAccess.h>
27 #include <Protocol/SimpleTextOut.h>
29 #include <Guid/HiiKeyBoardLayout.h>
30 #include <Guid/GlobalVariable.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/UefiLib.h>
41 #include <Library/PcdLib.h>
42 #include <Library/UefiRuntimeServicesTableLib.h>
43 #include <Library/PrintLib.h>
45 #define MAX_STRING_LENGTH 1024
46 #define MAX_FONT_NAME_LEN 256
47 #define NARROW_BASELINE 15
48 #define WIDE_BASELINE 14
49 #define SYS_FONT_INFO_MASK 0x37
50 #define REPLACE_UNKNOWN_GLYPH 0xFFFD
51 #define PROPORTIONAL_GLYPH 0x80
52 #define NARROW_GLYPH 0x40
54 #define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))
55 #define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))
56 #define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))
57 #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)
62 // BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure.
65 LIST_ENTRY Entry
; // Link to VarStorage
68 EFI_VARSTORE_ID VarStoreId
;
70 LIST_ENTRY BlockEntry
; // Link to its Block array
71 } IFR_VARSTORAGE_DATA
;
74 LIST_ENTRY Entry
; // Link to Block array
77 EFI_QUESTION_ID QuestionId
;
80 LIST_ENTRY DefaultValueEntry
; // Link to its default value array
84 // Get default value from IFR data.
87 DEFAULT_VALUE_FROM_DEFAULT
= 0, // Get from the minimum or first one when not set default value.
88 DEFAULT_VALUE_FROM_FLAG
, // Get default value from the defalut flag.
89 DEFAULT_VALUE_FROM_OPCODE
// Get default value from default opcode, highest priority.
94 DEFAULT_VALUE_TYPE Type
;
95 BOOLEAN Cleaned
; // Whether this value is cleaned
96 // TRUE Cleaned, the value can't be used
97 // FALSE Not cleaned, the value can be used.
105 #define EFI_HII_VARSTORE_BUFFER 0
106 #define EFI_HII_VARSTORE_NAME_VALUE 1
107 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
109 #define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G')
114 EFI_HII_HANDLE HiiHandle
;
115 EFI_HANDLE DriverHandle
;
117 UINT8 Type
; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE
121 } HII_FORMSET_STORAGE
;
125 // String Package definitions
127 #define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p')
128 typedef struct _HII_STRING_PACKAGE_INSTANCE
{
130 EFI_HII_STRING_PACKAGE_HDR
*StringPkgHdr
;
132 LIST_ENTRY StringEntry
;
133 LIST_ENTRY FontInfoList
; // local font info list
135 EFI_STRING_ID MaxStringId
; // record StringId
136 } HII_STRING_PACKAGE_INSTANCE
;
139 // Form Package definitions
141 #define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p')
142 typedef struct _HII_IFR_PACKAGE_INSTANCE
{
144 EFI_HII_PACKAGE_HEADER FormPkgHdr
;
147 } HII_IFR_PACKAGE_INSTANCE
;
150 // Simple Font Package definitions
152 #define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p')
153 typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE
{
155 EFI_HII_SIMPLE_FONT_PACKAGE_HDR
*SimpleFontPkgHdr
;
156 LIST_ENTRY SimpleFontEntry
;
157 } HII_SIMPLE_FONT_PACKAGE_INSTANCE
;
160 // Font Package definitions
162 #define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p')
163 typedef struct _HII_FONT_PACKAGE_INSTANCE
{
165 EFI_HII_FONT_PACKAGE_HDR
*FontPkgHdr
;
169 LIST_ENTRY FontEntry
;
170 LIST_ENTRY GlyphInfoList
;
171 } HII_FONT_PACKAGE_INSTANCE
;
173 #define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s')
174 typedef struct _HII_GLYPH_INFO
{
178 EFI_HII_GLYPH_INFO Cell
;
181 #define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i')
182 typedef struct _HII_FONT_INFO
{
185 LIST_ENTRY
*GlobalEntry
;
189 #define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i')
190 typedef struct _HII_GLOBAL_FONT_INFO
{
193 HII_FONT_PACKAGE_INSTANCE
*FontPackage
;
195 EFI_FONT_INFO
*FontInfo
;
196 } HII_GLOBAL_FONT_INFO
;
199 // Image Package definitions
202 #define HII_PIXEL_MASK 0x80
204 typedef struct _HII_IMAGE_PACKAGE_INSTANCE
{
205 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr
;
206 UINT32 ImageBlockSize
;
207 UINT32 PaletteInfoSize
;
210 } HII_IMAGE_PACKAGE_INSTANCE
;
213 // Keyboard Layout Pacakge definitions
215 #define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')
216 typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
{
219 LIST_ENTRY KeyboardEntry
;
220 } HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
;
223 // Guid Package definitions
225 #define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p')
226 typedef struct _HII_GUID_PACKAGE_INSTANCE
{
229 LIST_ENTRY GuidEntry
;
230 } HII_GUID_PACKAGE_INSTANCE
;
233 // A package list can contain only one or less than one device path package.
234 // This rule also applies to image package since ImageId can not be duplicate.
236 typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE
{
237 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr
;
238 LIST_ENTRY GuidPkgHdr
;
239 LIST_ENTRY FormPkgHdr
;
240 LIST_ENTRY KeyboardLayoutHdr
;
241 LIST_ENTRY StringPkgHdr
;
242 LIST_ENTRY FontPkgHdr
;
243 HII_IMAGE_PACKAGE_INSTANCE
*ImagePkg
;
244 LIST_ENTRY SimpleFontPkgHdr
;
245 UINT8
*DevicePathPkg
;
246 } HII_DATABASE_PACKAGE_LIST_INSTANCE
;
248 #define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l')
256 #define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r')
258 typedef struct _HII_DATABASE_RECORD
{
260 HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
;
261 EFI_HANDLE DriverHandle
;
262 EFI_HII_HANDLE Handle
;
263 LIST_ENTRY DatabaseEntry
;
264 } HII_DATABASE_RECORD
;
266 #define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n')
268 typedef struct _HII_DATABASE_NOTIFY
{
270 EFI_HANDLE NotifyHandle
;
272 EFI_GUID
*PackageGuid
;
273 EFI_HII_DATABASE_NOTIFY PackageNotifyFn
;
274 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
;
275 LIST_ENTRY DatabaseNotifyEntry
;
276 } HII_DATABASE_NOTIFY
;
278 #define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')
280 typedef struct _HII_DATABASE_PRIVATE_DATA
{
282 LIST_ENTRY DatabaseList
;
283 LIST_ENTRY DatabaseNotifyList
;
284 EFI_HII_FONT_PROTOCOL HiiFont
;
285 EFI_HII_IMAGE_PROTOCOL HiiImage
;
286 EFI_HII_STRING_PROTOCOL HiiString
;
287 EFI_HII_DATABASE_PROTOCOL HiiDatabase
;
288 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting
;
289 LIST_ENTRY HiiHandleList
;
291 LIST_ENTRY FontInfoList
; // global font info list
292 UINTN Attribute
; // default system color
293 EFI_GUID CurrentLayoutGuid
;
294 EFI_HII_KEYBOARD_LAYOUT
*CurrentLayout
;
295 } HII_DATABASE_PRIVATE_DATA
;
297 #define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
299 HII_DATABASE_PRIVATE_DATA, \
301 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
304 #define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
306 HII_DATABASE_PRIVATE_DATA, \
308 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
311 #define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
313 HII_DATABASE_PRIVATE_DATA, \
315 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
318 #define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
320 HII_DATABASE_PRIVATE_DATA, \
322 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
325 #define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
327 HII_DATABASE_PRIVATE_DATA, \
329 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
333 // Internal function prototypes.
337 This function checks whether a handle is a valid EFI_HII_HANDLE.
339 @param Handle Pointer to a EFI_HII_HANDLE
342 @retval FALSE Invalid
347 EFI_HII_HANDLE Handle
352 This function checks whether EFI_FONT_INFO exists in current database. If
353 FontInfoMask is specified, check what options can be used to make a match.
354 Note that the masks relate to where the system default should be supplied
355 are ignored by this function.
357 @param Private Hii database private structure.
358 @param FontInfo Points to EFI_FONT_INFO structure.
359 @param FontInfoMask If not NULL, describes what options can be used
360 to make a match between the font requested and
361 the font available. The caller must guarantee
363 @param FontHandle On entry, Points to the font handle returned by a
364 previous call to GetFontInfo() or NULL to start
366 @param GlobalFontInfo If not NULL, output the corresponding globa font
370 @retval FALSE Not existed
375 IN HII_DATABASE_PRIVATE_DATA
*Private
,
376 IN EFI_FONT_INFO
*FontInfo
,
377 IN EFI_FONT_INFO_MASK
*FontInfoMask
, OPTIONAL
378 IN EFI_FONT_HANDLE FontHandle
, OPTIONAL
379 OUT HII_GLOBAL_FONT_INFO
**GlobalFontInfo OPTIONAL
384 This function invokes the matching registered function.
386 @param Private HII Database driver private structure.
387 @param NotifyType The type of change concerning the database.
388 @param PackageInstance Points to the package referred to by the notification.
389 @param PackageType Package type
390 @param Handle The handle of the package list which contains the specified package.
392 @retval EFI_SUCCESS Already checked all registered function and invoked
394 @retval EFI_INVALID_PARAMETER Any input parameter is not valid.
398 InvokeRegisteredFunction (
399 IN HII_DATABASE_PRIVATE_DATA
*Private
,
400 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
401 IN VOID
*PackageInstance
,
402 IN UINT8 PackageType
,
403 IN EFI_HII_HANDLE Handle
408 Retrieve system default font and color.
410 @param Private HII database driver private data.
411 @param FontInfo Points to system default font output-related
412 information. It's caller's responsibility to free
414 @param FontInfoSize If not NULL, output the size of buffer FontInfo.
416 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.
417 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
419 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
424 IN HII_DATABASE_PRIVATE_DATA
*Private
,
425 OUT EFI_FONT_DISPLAY_INFO
**FontInfo
,
426 OUT UINTN
*FontInfoSize OPTIONAL
431 Parse all string blocks to find a String block specified by StringId.
432 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks
433 within this string package and backup its information. If LastStringId is
434 specified, the string id of last string block will also be output.
435 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).
437 @param Private Hii database private structure.
438 @param StringPackage Hii string package instance.
439 @param StringId The string's id, which is unique within
441 @param BlockType Output the block type of found string block.
442 @param StringBlockAddr Output the block address of found string block.
443 @param StringTextOffset Offset, relative to the found block address, of
444 the string text information.
445 @param LastStringId Output the last string id when StringId = 0 or StringId = -1.
446 @param StartStringId The first id in the skip block which StringId in the block.
448 @retval EFI_SUCCESS The string text and font is retrieved
450 @retval EFI_NOT_FOUND The specified text or font info can not be found
452 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
458 IN HII_DATABASE_PRIVATE_DATA
*Private
,
459 IN HII_STRING_PACKAGE_INSTANCE
*StringPackage
,
460 IN EFI_STRING_ID StringId
,
461 OUT UINT8
*BlockType
, OPTIONAL
462 OUT UINT8
**StringBlockAddr
, OPTIONAL
463 OUT UINTN
*StringTextOffset
, OPTIONAL
464 OUT EFI_STRING_ID
*LastStringId
, OPTIONAL
465 OUT EFI_STRING_ID
*StartStringId OPTIONAL
470 Parse all glyph blocks to find a glyph block specified by CharValue.
471 If CharValue = (CHAR16) (-1), collect all default character cell information
472 within this font package and backup its information.
474 @param FontPackage Hii string package instance.
475 @param CharValue Unicode character value, which identifies a glyph
477 @param GlyphBuffer Output the corresponding bitmap data of the found
478 block. It is the caller's responsiblity to free
480 @param Cell Output cell information of the encoded bitmap.
481 @param GlyphBufferLen If not NULL, output the length of GlyphBuffer.
483 @retval EFI_SUCCESS The bitmap data is retrieved successfully.
484 @retval EFI_NOT_FOUND The specified CharValue does not exist in current
486 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
492 IN HII_FONT_PACKAGE_INSTANCE
*FontPackage
,
494 OUT UINT8
**GlyphBuffer
, OPTIONAL
495 OUT EFI_HII_GLYPH_INFO
*Cell
, OPTIONAL
496 OUT UINTN
*GlyphBufferLen OPTIONAL
500 This function exports Form packages to a buffer.
501 This is a internal function.
503 @param Private Hii database private structure.
504 @param Handle Identification of a package list.
505 @param PackageList Pointer to a package list which will be exported.
506 @param UsedSize The length of buffer be used.
507 @param BufferSize Length of the Buffer.
508 @param Buffer Allocated space for storing exported data.
509 @param ResultSize The size of the already exported content of this
512 @retval EFI_SUCCESS Form Packages are exported successfully.
513 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
518 IN HII_DATABASE_PRIVATE_DATA
*Private
,
519 IN EFI_HII_HANDLE Handle
,
520 IN HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
,
524 IN OUT UINTN
*ResultSize
528 // EFI_HII_FONT_PROTOCOL protocol interfaces
533 Renders a string to a bitmap or to the display.
535 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
536 @param Flags Describes how the string is to be drawn.
537 @param String Points to the null-terminated string to be
539 @param StringInfo Points to the string output information,
540 including the color and font. If NULL, then the
541 string will be output in the default system font
543 @param Blt If this points to a non-NULL on entry, this
544 points to the image, which is Width pixels wide
545 and Height pixels high. The string will be drawn
547 EFI_HII_OUT_FLAG_CLIP is implied. If this points
548 to a NULL on entry, then a buffer
549 will be allocated to hold the generated image and
550 the pointer updated on exit. It is the caller's
551 responsibility to free this buffer.
552 @param BltX Together with BltX, Specifies the offset from the left and top edge
553 of the image of the first character cell in the
555 @param BltY Together with BltY, Specifies the offset from the left and top edge
556 of the image of the first character cell in the
558 @param RowInfoArray If this is non-NULL on entry, then on exit, this
559 will point to an allocated buffer containing
560 row information and RowInfoArraySize will be
561 updated to contain the number of elements.
562 This array describes the characters which were at
563 least partially drawn and the heights of the
564 rows. It is the caller's responsibility to free
566 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
567 contains the number of elements in RowInfoArray.
568 @param ColumnInfoArray If this is non-NULL, then on return it will be
569 filled with the horizontal offset for each
570 character in the string on the row where it is
571 displayed. Non-printing characters will have
572 the offset ~0. The caller is responsible to
573 allocate a buffer large enough so that there
574 is one entry for each character in the string,
575 not including the null-terminator. It is possible
576 when character display is normalized that some
577 character cells overlap.
579 @retval EFI_SUCCESS The string was successfully rendered.
580 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
582 @retval EFI_INVALID_PARAMETER The String or Blt.
583 @retval EFI_INVALID_PARAMETER Flags were invalid combination..
589 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
590 IN EFI_HII_OUT_FLAGS Flags
,
591 IN CONST EFI_STRING String
,
592 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
593 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
596 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
597 OUT UINTN
*RowInfoArraySize OPTIONAL
,
598 OUT UINTN
*ColumnInfoArray OPTIONAL
603 Render a string to a bitmap or the screen containing the contents of the specified string.
605 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
606 @param Flags Describes how the string is to be drawn.
607 @param PackageList The package list in the HII database to search
608 for the specified string.
609 @param StringId The string's id, which is unique within
611 @param Language Points to the language for the retrieved string.
612 If NULL, then the current system language is
614 @param StringInfo Points to the string output information,
615 including the color and font. If NULL, then the
616 string will be output in the default system font
618 @param Blt If this points to a non-NULL on entry, this
619 points to the image, which is Width pixels wide
620 and Height pixels high. The string will be drawn
622 EFI_HII_OUT_FLAG_CLIP is implied. If this points
623 to a NULL on entry, then a buffer
624 will be allocated to hold the generated image and
625 the pointer updated on exit. It is the caller's
626 responsibility to free this buffer.
627 @param BltX Together with BltX, Specifies the offset from the left and top edge
628 of the image of the first character cell in the
630 @param BltY Together with BltY, Specifies the offset from the left and top edge
631 of the image of the first character cell in the
633 @param RowInfoArray If this is non-NULL on entry, then on exit, this
634 will point to an allocated buffer containing
635 row information and RowInfoArraySize will be
636 updated to contain the number of elements.
637 This array describes the characters which were at
638 least partially drawn and the heights of the
639 rows. It is the caller's responsibility to free
641 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
642 contains the number of elements in RowInfoArray.
643 @param ColumnInfoArray If this is non-NULL, then on return it will be
644 filled with the horizontal offset for each
645 character in the string on the row where it is
646 displayed. Non-printing characters will have
647 the offset ~0. The caller is responsible to
648 allocate a buffer large enough so that there
649 is one entry for each character in the string,
650 not including the null-terminator. It is possible
651 when character display is normalized that some
652 character cells overlap.
654 @retval EFI_SUCCESS The string was successfully rendered.
655 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
657 @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.
658 @retval EFI_INVALID_PARAMETER Flags were invalid combination.
659 @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not
660 in the specified PackageList.
666 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
667 IN EFI_HII_OUT_FLAGS Flags
,
668 IN EFI_HII_HANDLE PackageList
,
669 IN EFI_STRING_ID StringId
,
670 IN CONST CHAR8
* Language
,
671 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
672 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
675 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
676 OUT UINTN
*RowInfoArraySize OPTIONAL
,
677 OUT UINTN
*ColumnInfoArray OPTIONAL
682 Convert the glyph for a single character into a bitmap.
684 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
685 @param Char Character to retrieve.
686 @param StringInfo Points to the string font and color information
687 or NULL if the string should use the default
688 system font and color.
689 @param Blt Thus must point to a NULL on entry. A buffer will
690 be allocated to hold the output and the pointer
691 updated on exit. It is the caller's
692 responsibility to free this buffer.
693 @param Baseline Number of pixels from the bottom of the bitmap to
696 @retval EFI_SUCCESS Glyph bitmap created.
697 @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.
698 @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was replaced with the
699 glyph for Unicode character 0xFFFD.
700 @retval EFI_INVALID_PARAMETER Blt is NULL or *Blt is not NULL.
706 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
708 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo
,
709 OUT EFI_IMAGE_OUTPUT
**Blt
,
710 OUT UINTN
*Baseline OPTIONAL
715 This function iterates through fonts which match the specified font, using
716 the specified criteria. If String is non-NULL, then all of the characters in
717 the string must exist in order for a candidate font to be returned.
719 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
720 @param FontHandle On entry, points to the font handle returned by a
721 previous call to GetFontInfo() or NULL to start
722 with the first font. On return, points to the
723 returned font handle or points to NULL if there
724 are no more matching fonts.
725 @param StringInfoIn Upon entry, points to the font to return
726 information about. If NULL, then the information about the system default
727 font will be returned.
728 @param StringInfoOut Upon return, contains the matching font's
729 information. If NULL, then no information is
730 returned. It's caller's responsibility to free
732 @param String Points to the string which will be tested to
733 determine if all characters are available. If
734 NULL, then any font is acceptable.
736 @retval EFI_SUCCESS Matching font returned successfully.
737 @retval EFI_NOT_FOUND No matching font was found.
738 @retval EFI_INVALID_PARAMETER StringInfoIn is NULL.
739 @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.
740 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
746 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
747 IN OUT EFI_FONT_HANDLE
*FontHandle
,
748 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfoIn
, OPTIONAL
749 OUT EFI_FONT_DISPLAY_INFO
**StringInfoOut
,
750 IN CONST EFI_STRING String OPTIONAL
754 // EFI_HII_IMAGE_PROTOCOL interfaces
759 This function adds the image Image to the group of images owned by PackageList, and returns
760 a new image identifier (ImageId).
762 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
763 @param PackageList Handle of the package list where this image will
765 @param ImageId On return, contains the new image id, which is
766 unique within PackageList.
767 @param Image Points to the image.
769 @retval EFI_SUCCESS The new image was added successfully.
770 @retval EFI_NOT_FOUND The specified PackageList could not be found in
772 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.
773 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.
779 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
780 IN EFI_HII_HANDLE PackageList
,
781 OUT EFI_IMAGE_ID
*ImageId
,
782 IN CONST EFI_IMAGE_INPUT
*Image
787 This function retrieves the image specified by ImageId which is associated with
788 the specified PackageList and copies it into the buffer specified by Image.
790 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
791 @param PackageList Handle of the package list where this image will
793 @param ImageId The image's id,, which is unique within
795 @param Image Points to the image.
797 @retval EFI_SUCCESS The new image was returned successfully.
798 @retval EFI_NOT_FOUND The image specified by ImageId is not available.
799 The specified PackageList is not in the database.
800 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
802 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.
803 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
810 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
811 IN EFI_HII_HANDLE PackageList
,
812 IN EFI_IMAGE_ID ImageId
,
813 OUT EFI_IMAGE_INPUT
*Image
818 This function updates the image specified by ImageId in the specified PackageListHandle to
819 the image specified by Image.
821 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
822 @param PackageList The package list containing the images.
823 @param ImageId The image's id,, which is unique within
825 @param Image Points to the image.
827 @retval EFI_SUCCESS The new image was updated successfully.
828 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
829 database. The specified PackageList is not in the database.
830 @retval EFI_INVALID_PARAMETER The Image was NULL.
836 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
837 IN EFI_HII_HANDLE PackageList
,
838 IN EFI_IMAGE_ID ImageId
,
839 IN CONST EFI_IMAGE_INPUT
*Image
844 This function renders an image to a bitmap or the screen using the specified
845 color and options. It draws the image on an existing bitmap, allocates a new
846 bitmap or uses the screen. The images can be clipped.
848 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
849 @param Flags Describes how the image is to be drawn.
850 @param Image Points to the image to be displayed.
851 @param Blt If this points to a non-NULL on entry, this
852 points to the image, which is Width pixels wide
853 and Height pixels high. The image will be drawn
854 onto this image and EFI_HII_DRAW_FLAG_CLIP is
855 implied. If this points to a NULL on entry, then
856 a buffer will be allocated to hold the generated
857 image and the pointer updated on exit. It is the
858 caller's responsibility to free this buffer.
859 @param BltX Specifies the offset from the left and top edge
860 of the output image of the first pixel in the
862 @param BltY Specifies the offset from the left and top edge
863 of the output image of the first pixel in the
866 @retval EFI_SUCCESS The image was successfully drawn.
867 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
868 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.
869 @retval EFI_INVALID_PARAMETER Any combination of Flags is invalid.
875 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
876 IN EFI_HII_DRAW_FLAGS Flags
,
877 IN CONST EFI_IMAGE_INPUT
*Image
,
878 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
885 This function renders an image to a bitmap or the screen using the specified
886 color and options. It draws the image on an existing bitmap, allocates a new
887 bitmap or uses the screen. The images can be clipped.
889 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
890 @param Flags Describes how the image is to be drawn.
891 @param PackageList The package list in the HII database to search
892 for the specified image.
893 @param ImageId The image's id, which is unique within
895 @param Blt If this points to a non-NULL on entry, this
896 points to the image, which is Width pixels wide
897 and Height pixels high. The image will be drawn
899 EFI_HII_DRAW_FLAG_CLIP is implied. If this points
900 to a NULL on entry, then a buffer will be
901 allocated to hold the generated image and the
902 pointer updated on exit. It is the caller's
903 responsibility to free this buffer.
904 @param BltX Specifies the offset from the left and top edge
905 of the output image of the first pixel in the
907 @param BltY Specifies the offset from the left and top edge
908 of the output image of the first pixel in the
911 @retval EFI_SUCCESS The image was successfully drawn.
912 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
913 @retval EFI_INVALID_PARAMETER The Blt was NULL.
914 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
915 The specified PackageList is not in the database.
921 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
922 IN EFI_HII_DRAW_FLAGS Flags
,
923 IN EFI_HII_HANDLE PackageList
,
924 IN EFI_IMAGE_ID ImageId
,
925 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
933 // EFI_HII_STRING_PROTOCOL
938 This function adds the string String to the group of strings owned by PackageList, with the
939 specified font information StringFontInfo and returns a new string id.
941 @param This A pointer to the EFI_HII_STRING_PROTOCOL
943 @param PackageList Handle of the package list where this string will
945 @param StringId On return, contains the new strings id, which is
946 unique within PackageList.
947 @param Language Points to the language for the new string.
948 @param LanguageName Points to the printable language name to
949 associate with the passed in Language field.If
950 LanguageName is not NULL and the string package
951 header's LanguageName associated with a given
952 Language is not zero, the LanguageName being
953 passed in will be ignored.
954 @param String Points to the new null-terminated string.
955 @param StringFontInfo Points to the new string's font information or
956 NULL if the string should have the default system
957 font, size and style.
959 @retval EFI_SUCCESS The new string was added successfully.
960 @retval EFI_NOT_FOUND The specified PackageList could not be found in
962 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of
964 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL or Language is
971 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
972 IN EFI_HII_HANDLE PackageList
,
973 OUT EFI_STRING_ID
*StringId
,
974 IN CONST CHAR8
*Language
,
975 IN CONST CHAR16
*LanguageName
, OPTIONAL
976 IN CONST EFI_STRING String
,
977 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
982 This function retrieves the string specified by StringId which is associated
983 with the specified PackageList in the language Language and copies it into
984 the buffer specified by String.
986 @param This A pointer to the EFI_HII_STRING_PROTOCOL
988 @param Language Points to the language for the retrieved string.
989 @param PackageList The package list in the HII database to search
990 for the specified string.
991 @param StringId The string's id, which is unique within
993 @param String Points to the new null-terminated string.
994 @param StringSize On entry, points to the size of the buffer
995 pointed to by String, in bytes. On return,
996 points to the length of the string, in bytes.
997 @param StringFontInfo If not NULL, points to the string's font
998 information. It's caller's responsibility to
1001 @retval EFI_SUCCESS The string was returned successfully.
1002 @retval EFI_NOT_FOUND The string specified by StringId is not
1004 @retval EFI_NOT_FOUND The string specified by StringId is available but
1005 not in the specified language.
1006 The specified PackageList is not in the database.
1007 @retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but
1008 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small
1010 @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL.
1011 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
1018 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1019 IN CONST CHAR8
*Language
,
1020 IN EFI_HII_HANDLE PackageList
,
1021 IN EFI_STRING_ID StringId
,
1022 OUT EFI_STRING String
,
1023 IN OUT UINTN
*StringSize
,
1024 OUT EFI_FONT_INFO
**StringFontInfo OPTIONAL
1029 This function updates the string specified by StringId in the specified PackageList to the text
1030 specified by String and, optionally, the font information specified by StringFontInfo.
1032 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1034 @param PackageList The package list containing the strings.
1035 @param StringId The string's id, which is unique within
1037 @param Language Points to the language for the updated string.
1038 @param String Points to the new null-terminated string.
1039 @param StringFontInfo Points to the string's font information or NULL
1040 if the string font information is not changed.
1042 @retval EFI_SUCCESS The string was updated successfully.
1043 @retval EFI_NOT_FOUND The string specified by StringId is not in the
1045 @retval EFI_INVALID_PARAMETER The String or Language was NULL.
1046 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
1053 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1054 IN EFI_HII_HANDLE PackageList
,
1055 IN EFI_STRING_ID StringId
,
1056 IN CONST CHAR8
*Language
,
1057 IN CONST EFI_STRING String
,
1058 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
1063 This function returns the list of supported languages, in the format specified
1064 in Appendix M of UEFI 2.1 spec.
1066 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1068 @param PackageList The package list to examine.
1069 @param Languages Points to the buffer to hold the returned
1070 null-terminated ASCII string.
1071 @param LanguagesSize On entry, points to the size of the buffer
1072 pointed to by Languages, in bytes. On return,
1073 points to the length of Languages, in bytes.
1075 @retval EFI_SUCCESS The languages were returned successfully.
1076 @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.
1077 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list
1078 of supported languages. LanguageSize is updated
1079 to contain the required size.
1080 @retval EFI_NOT_FOUND Could not find string package in specified
1087 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1088 IN EFI_HII_HANDLE PackageList
,
1089 IN OUT CHAR8
*Languages
,
1090 IN OUT UINTN
*LanguagesSize
1095 Each string package has associated with it a single primary language and zero
1096 or more secondary languages. This routine returns the secondary languages
1097 associated with a package list.
1099 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1101 @param PackageList The package list to examine.
1102 @param PrimaryLanguage Points to the null-terminated ASCII string that specifies
1103 the primary language. Languages are specified in the
1104 format specified in Appendix M of the UEFI 2.0 specification.
1105 @param SecondaryLanguages Points to the buffer to hold the returned null-terminated
1106 ASCII string that describes the list of
1107 secondary languages for the specified
1108 PrimaryLanguage. If there are no secondary
1109 languages, the function returns successfully,
1110 but this is set to NULL.
1111 @param SecondaryLanguagesSize On entry, points to the size of the buffer
1112 pointed to by SecondaryLanguages, in bytes. On
1113 return, points to the length of SecondaryLanguages
1116 @retval EFI_SUCCESS Secondary languages were correctly returned.
1117 @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguages or
1118 SecondaryLanguagesSize was NULL.
1119 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is
1120 too small to hold the returned information.
1121 SecondaryLanguageSize is updated to hold the size of
1122 the buffer required.
1123 @retval EFI_INVALID_LANGUAGE The language specified by PrimaryLanguage is not
1124 present in the specified package list.
1125 @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
1130 HiiGetSecondaryLanguages (
1131 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1132 IN EFI_HII_HANDLE PackageList
,
1133 IN CONST CHAR8
*PrimaryLanguage
,
1134 IN OUT CHAR8
*SecondaryLanguages
,
1135 IN OUT UINTN
*SecondaryLanguagesSize
1139 // EFI_HII_DATABASE_PROTOCOL protocol interfaces
1144 This function adds the packages in the package list to the database and returns a handle. If there is a
1145 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will
1146 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.
1148 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1150 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1152 @param DriverHandle Associate the package list with this EFI handle.
1153 If a NULL is specified, this data will not be associate
1154 with any drivers and cannot have a callback induced.
1155 @param Handle A pointer to the EFI_HII_HANDLE instance.
1157 @retval EFI_SUCCESS The package list associated with the Handle was
1158 added to the HII database.
1159 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the
1160 new database contents.
1161 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.
1167 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1168 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
,
1169 IN CONST EFI_HANDLE DriverHandle
, OPTIONAL
1170 OUT EFI_HII_HANDLE
*Handle
1175 This function removes the package list that is associated with a handle Handle
1176 from the HII database. Before removing the package, any registered functions
1177 with the notification type REMOVE_PACK and the same package type will be called.
1179 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1181 @param Handle The handle that was registered to the data that
1182 is requested for removal.
1184 @retval EFI_SUCCESS The data associated with the Handle was removed
1185 from the HII database.
1186 @retval EFI_NOT_FOUND The specified Handle is not in database.
1191 HiiRemovePackageList (
1192 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1193 IN EFI_HII_HANDLE Handle
1198 This function updates the existing package list (which has the specified Handle)
1199 in the HII databases, using the new package list specified by PackageList.
1201 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1203 @param Handle The handle that was registered to the data that
1204 is requested to be updated.
1205 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1208 @retval EFI_SUCCESS The HII database was successfully updated.
1209 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated
1211 @retval EFI_INVALID_PARAMETER PackageList was NULL.
1212 @retval EFI_NOT_FOUND The specified Handle is not in database.
1217 HiiUpdatePackageList (
1218 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1219 IN EFI_HII_HANDLE Handle
,
1220 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
1225 This function returns a list of the package handles of the specified type
1226 that are currently active in the database. The pseudo-type
1227 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.
1229 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1231 @param PackageType Specifies the package type of the packages to
1232 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1234 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1235 this is the pointer to the GUID which must match
1236 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.
1237 Otherwise, it must be NULL.
1238 @param HandleBufferLength On input, a pointer to the length of the handle
1239 buffer. On output, the length of the handle
1240 buffer that is required for the handles found.
1241 @param Handle An array of EFI_HII_HANDLE instances returned.
1243 @retval EFI_SUCCESS The matching handles are outputed successfully.
1244 HandleBufferLength is updated with the actual length.
1245 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1246 Handle is too small to support the number of
1247 handles. HandleBufferLength is updated with a
1248 value that will enable the data to fit.
1249 @retval EFI_NOT_FOUND No matching handle could not be found in
1251 @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.
1252 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
1253 PackageGuid is not NULL, PackageType is a EFI_HII_
1254 PACKAGE_TYPE_GUID but PackageGuid is NULL.
1260 HiiListPackageLists (
1261 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1262 IN UINT8 PackageType
,
1263 IN CONST EFI_GUID
*PackageGuid
,
1264 IN OUT UINTN
*HandleBufferLength
,
1265 OUT EFI_HII_HANDLE
*Handle
1270 This function will export one or all package lists in the database to a buffer.
1271 For each package list exported, this function will call functions registered
1272 with EXPORT_PACK and then copy the package list to the buffer.
1274 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1276 @param Handle An EFI_HII_HANDLE that corresponds to the desired
1277 package list in the HII database to export or
1278 NULL to indicate all package lists should be
1280 @param BufferSize On input, a pointer to the length of the buffer.
1281 On output, the length of the buffer that is
1282 required for the exported data.
1283 @param Buffer A pointer to a buffer that will contain the
1284 results of the export function.
1286 @retval EFI_SUCCESS Package exported.
1287 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1288 Handle is too small to support the number of
1289 handles. HandleBufferLength is updated with
1290 a value that will enable the data to fit.
1291 @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the
1293 @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.
1298 HiiExportPackageLists (
1299 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1300 IN EFI_HII_HANDLE Handle
,
1301 IN OUT UINTN
*BufferSize
,
1302 OUT EFI_HII_PACKAGE_LIST_HEADER
*Buffer
1307 This function registers a function which will be called when specified actions related to packages of
1308 the specified type occur in the HII database. By registering a function, other HII-related drivers are
1309 notified when specific package types are added, removed or updated in the HII database.
1310 Each driver or application which registers a notification should use
1311 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.
1313 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1315 @param PackageType Specifies the package type of the packages to
1316 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1318 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1319 this is the pointer to the GUID which must match
1321 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must
1323 @param PackageNotifyFn Points to the function to be called when the
1325 NotificationType occurs.
1326 @param NotifyType Describes the types of notification which this
1327 function will be receiving.
1328 @param NotifyHandle Points to the unique handle assigned to the
1329 registered notification. Can be used in
1330 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()
1331 to stop notifications.
1333 @retval EFI_SUCCESS Notification registered successfully.
1334 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures
1335 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.
1336 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not
1337 EFI_HII_PACKAGE_TYPE_GUID.
1338 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is
1339 EFI_HII_PACKAGE_TYPE_GUID.
1344 HiiRegisterPackageNotify (
1345 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1346 IN UINT8 PackageType
,
1347 IN CONST EFI_GUID
*PackageGuid
,
1348 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn
,
1349 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
1350 OUT EFI_HANDLE
*NotifyHandle
1355 Removes the specified HII database package-related notification.
1357 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1359 @param NotificationHandle The handle of the notification function being
1362 @retval EFI_SUCCESS Notification is unregistered successfully.
1363 @retval EFI_NOT_FOUND The incoming notification handle does not exist
1364 in current hii database.
1369 HiiUnregisterPackageNotify (
1370 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1371 IN EFI_HANDLE NotificationHandle
1376 This routine retrieves an array of GUID values for each keyboard layout that
1377 was previously registered in the system.
1379 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1381 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard
1382 GUID buffer. On output, the length of the handle
1383 buffer that is required for the handles found.
1384 @param KeyGuidBuffer An array of keyboard layout GUID instances
1387 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.
1388 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates
1389 that KeyGuidBuffer is too small to support the
1390 number of GUIDs. KeyGuidBufferLength is
1391 updated with a value that will enable the data to
1393 @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was
1395 @retval EFI_NOT_FOUND There was no keyboard layout.
1400 HiiFindKeyboardLayouts (
1401 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1402 IN OUT UINT16
*KeyGuidBufferLength
,
1403 OUT EFI_GUID
*KeyGuidBuffer
1408 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys
1409 on a keyboard and the character(s) that are associated with a particular set of key strokes.
1411 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1413 @param KeyGuid A pointer to the unique ID associated with a
1414 given keyboard layout. If KeyGuid is NULL then
1415 the current layout will be retrieved.
1416 @param KeyboardLayoutLength On input, a pointer to the length of the
1417 KeyboardLayout buffer. On output, the length of
1418 the data placed into KeyboardLayout.
1419 @param KeyboardLayout A pointer to a buffer containing the retrieved
1422 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
1423 @retval EFI_NOT_FOUND The requested keyboard layout was not found.
1424 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was
1430 HiiGetKeyboardLayout (
1431 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1432 IN CONST EFI_GUID
*KeyGuid
,
1433 IN OUT UINT16
*KeyboardLayoutLength
,
1434 OUT EFI_HII_KEYBOARD_LAYOUT
*KeyboardLayout
1439 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine
1440 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
1441 group type. This is so that agents which are sensitive to the current keyboard layout being changed
1442 can be notified of this change.
1444 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1446 @param KeyGuid A pointer to the unique ID associated with a
1447 given keyboard layout.
1449 @retval EFI_SUCCESS The current keyboard layout was successfully set.
1450 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so
1452 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.
1457 HiiSetKeyboardLayout (
1458 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1459 IN CONST EFI_GUID
*KeyGuid
1464 Return the EFI handle associated with a package list.
1466 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1468 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired
1469 package list in the HIIdatabase.
1470 @param DriverHandle On return, contains the EFI_HANDLE which was
1471 registered with the package list in
1474 @retval EFI_SUCCESS The DriverHandle was returned successfully.
1475 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or
1476 DriverHandle was NULL.
1481 HiiGetPackageListHandle (
1482 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1483 IN EFI_HII_HANDLE PackageListHandle
,
1484 OUT EFI_HANDLE
*DriverHandle
1488 // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces
1493 This function allows a caller to extract the current configuration
1494 for one or more named elements from one or more drivers.
1496 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1498 @param Request A null-terminated Unicode string in
1499 <MultiConfigRequest> format.
1500 @param Progress On return, points to a character in the Request
1501 string. Points to the string's null terminator if
1502 request was successful. Points to the most recent
1503 & before the first failing name / value pair (or
1504 the beginning of the string if the failure is in
1505 the first name / value pair) if the request was
1507 @param Results Null-terminated Unicode string in
1508 <MultiConfigAltResp> format which has all values
1509 filled in for the names in the Request string.
1510 String to be allocated by the called function.
1512 @retval EFI_SUCCESS The Results string is filled with the values
1513 corresponding to all requested names.
1514 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1515 results that must be stored awaiting possible
1517 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.
1518 Progress set to the "G" in "GUID" of the
1519 routing header that doesn't match. Note: There
1520 is no requirement that all routing data
1521 be validated before any configuration extraction.
1522 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request
1523 parameter would result in this type of error. The
1524 Progress parameter is set to NULL.
1525 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &
1526 before the error or the beginning of the string.
1527 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the
1533 HiiConfigRoutingExtractConfig (
1534 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1535 IN CONST EFI_STRING Request
,
1536 OUT EFI_STRING
*Progress
,
1537 OUT EFI_STRING
*Results
1542 This function allows the caller to request the current configuration for the
1543 entirety of the current HII database and returns the data in a null-terminated Unicode string.
1545 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1547 @param Results Null-terminated Unicode string in
1548 <MultiConfigAltResp> format which has all values
1549 filled in for the names in the Request string.
1550 String to be allocated by the called function.
1551 De-allocation is up to the caller.
1553 @retval EFI_SUCCESS The Results string is filled with the values
1554 corresponding to all requested names.
1555 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1556 results that must be stored awaiting possible
1558 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results
1559 parameter would result in this type of error.
1564 HiiConfigRoutingExportConfig (
1565 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1566 OUT EFI_STRING
*Results
1571 This function processes the results of processing forms and routes it to the
1572 appropriate handlers or storage.
1574 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1576 @param Configuration A null-terminated Unicode string in
1577 <MulltiConfigResp> format.
1578 @param Progress A pointer to a string filled in with the offset
1579 of the most recent & before the first failing
1580 name / value pair (or the beginning of the string
1581 if the failure is in the first name / value pair)
1582 or the terminating NULL if all was successful.
1584 @retval EFI_SUCCESS The results have been distributed or are awaiting
1586 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1587 results that must be stored awaiting possible
1589 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter
1590 would result in this type of error.
1591 @retval EFI_NOT_FOUND Target for the specified routing data was not
1597 HiiConfigRoutingRouteConfig (
1598 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1599 IN CONST EFI_STRING Configuration
,
1600 OUT EFI_STRING
*Progress
1606 This helper function is to be called by drivers to map configuration data stored
1607 in byte array ("block") formats such as UEFI Variables into current configuration strings.
1609 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1611 @param ConfigRequest A null-terminated Unicode string in
1612 <ConfigRequest> format.
1613 @param Block Array of bytes defining the block's
1615 @param BlockSize Length in bytes of Block.
1616 @param Config Filled-in configuration string. String allocated
1617 by the function. Returned only if call is
1619 @param Progress A pointer to a string filled in with the offset
1620 of the most recent & before the first failing
1621 name/value pair (or the beginning of the string
1622 if the failure is in the first name / value pair)
1623 or the terminating NULL if all was successful.
1625 @retval EFI_SUCCESS The request succeeded. Progress points to the
1626 null terminator at the end of the ConfigRequest
1628 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1629 Progress points to the first character of
1631 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or
1632 Block parameter would result in this type of
1633 error. Progress points to the first character of
1635 @retval EFI_NOT_FOUND Target for the specified routing data was not
1636 found. Progress points to the "G" in "GUID" of
1637 the errant routing data.
1638 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.
1639 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.
1640 Block is left updated and Progress points at
1641 the '&' preceding the first non-<BlockName>.
1647 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1648 IN CONST EFI_STRING ConfigRequest
,
1649 IN CONST UINT8
*Block
,
1650 IN CONST UINTN BlockSize
,
1651 OUT EFI_STRING
*Config
,
1652 OUT EFI_STRING
*Progress
1657 This helper function is to be called by drivers to map configuration strings
1658 to configurations stored in byte array ("block") formats such as UEFI Variables.
1660 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1662 @param ConfigResp A null-terminated Unicode string in <ConfigResp>
1664 @param Block A possibly null array of bytes representing the
1665 current block. Only bytes referenced in the
1666 ConfigResp string in the block are modified. If
1667 this parameter is null or if the *BlockSize
1668 parameter is (on input) shorter than required by
1669 the Configuration string, only the BlockSize
1670 parameter is updated and an appropriate status
1671 (see below) is returned.
1672 @param BlockSize The length of the Block in units of UINT8. On
1673 input, this is the size of the Block. On output,
1674 if successful, contains the index of the last
1675 modified byte in the Block.
1676 @param Progress On return, points to an element of the ConfigResp
1677 string filled in with the offset of the most
1678 recent '&' before the first failing name / value
1679 pair (or the beginning of the string if the
1680 failure is in the first name / value pair) or
1681 the terminating NULL if all was successful.
1683 @retval EFI_SUCCESS The request succeeded. Progress points to the
1684 null terminator at the end of the ConfigResp
1686 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1687 Progress points to the first character of
1689 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or
1690 Block parameter would result in this type of
1691 error. Progress points to the first character of
1693 @retval EFI_NOT_FOUND Target for the specified routing data was not
1694 found. Progress points to the "G" in "GUID" of
1695 the errant routing data.
1696 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /
1697 value pair. Block is left updated and
1698 Progress points at the '&' preceding the first
1705 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1706 IN CONST EFI_STRING ConfigResp
,
1707 IN OUT UINT8
*Block
,
1708 IN OUT UINTN
*BlockSize
,
1709 OUT EFI_STRING
*Progress
1714 This helper function is to be called by drivers to extract portions of
1715 a larger configuration string.
1717 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1719 @param Configuration A null-terminated Unicode string in
1720 <MultiConfigAltResp> format.
1721 @param Guid A pointer to the GUID value to search for in the
1722 routing portion of the ConfigResp string when
1723 retrieving the requested data. If Guid is NULL,
1724 then all GUID values will be searched for.
1725 @param Name A pointer to the NAME value to search for in the
1726 routing portion of the ConfigResp string when
1727 retrieving the requested data. If Name is NULL,
1728 then all Name values will be searched for.
1729 @param DevicePath A pointer to the PATH value to search for in the
1730 routing portion of the ConfigResp string when
1731 retrieving the requested data. If DevicePath is
1732 NULL, then all DevicePath values will be
1734 @param AltCfgId A pointer to the ALTCFG value to search for in
1735 the routing portion of the ConfigResp string
1736 when retrieving the requested data. If this
1737 parameter is NULL, then the current setting will
1739 @param AltCfgResp A pointer to a buffer which will be allocated by
1740 the function which contains the retrieved string
1741 as requested. This buffer is only allocated if
1742 the call was successful.
1744 @retval EFI_SUCCESS The request succeeded. The requested data was
1745 extracted and placed in the newly allocated
1747 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.
1748 @retval EFI_INVALID_PARAMETER Any parameter is invalid.
1749 @retval EFI_NOT_FOUND Target for the specified routing data was not
1756 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1757 IN CONST EFI_STRING Configuration
,
1758 IN CONST EFI_GUID
*Guid
,
1759 IN CONST EFI_STRING Name
,
1760 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1761 IN CONST UINT16
*AltCfgId
,
1762 OUT EFI_STRING
*AltCfgResp
1767 Compare whether two names of languages are identical.
1769 @param Language1 Name of language 1 from StringPackage
1770 @param Language2 Name of language 2 to be compared with language 1.
1773 @retval FALSE not same
1777 HiiCompareLanguage (
1778 IN CHAR8
*Language1
,
1786 extern EFI_EVENT gHiiKeyboardLayoutChanged
;