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>
46 #define HII_DATABASE_NOTIFY_GUID \
48 0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \
51 #define MAX_STRING_LENGTH 1024
52 #define MAX_FONT_NAME_LEN 256
53 #define NARROW_BASELINE 15
54 #define WIDE_BASELINE 14
55 #define SYS_FONT_INFO_MASK 0x37
56 #define REPLACE_UNKNOWN_GLYPH 0xFFFD
57 #define PROPORTIONAL_GLYPH 0x80
58 #define NARROW_GLYPH 0x40
60 #define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))
61 #define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))
62 #define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))
63 #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)
68 // BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure.
71 LIST_ENTRY Entry
; // Link to VarStorage
74 EFI_VARSTORE_ID VarStoreId
;
76 LIST_ENTRY BlockEntry
; // Link to its Block array
77 } IFR_VARSTORAGE_DATA
;
80 LIST_ENTRY Entry
; // Link to Block array
83 EFI_QUESTION_ID QuestionId
;
86 LIST_ENTRY DefaultValueEntry
; // Link to its default value array
99 #define EFI_HII_VARSTORE_BUFFER 0
100 #define EFI_HII_VARSTORE_NAME_VALUE 1
101 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
103 #define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G')
108 EFI_HII_HANDLE HiiHandle
;
109 EFI_HANDLE DriverHandle
;
111 UINT8 Type
; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE
115 } HII_FORMSET_STORAGE
;
119 // String Package definitions
121 #define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p')
122 typedef struct _HII_STRING_PACKAGE_INSTANCE
{
124 EFI_HII_STRING_PACKAGE_HDR
*StringPkgHdr
;
126 LIST_ENTRY StringEntry
;
127 LIST_ENTRY FontInfoList
; // local font info list
129 EFI_STRING_ID MaxStringId
; // record StringId
130 } HII_STRING_PACKAGE_INSTANCE
;
133 // Form Package definitions
135 #define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p')
136 typedef struct _HII_IFR_PACKAGE_INSTANCE
{
138 EFI_HII_PACKAGE_HEADER FormPkgHdr
;
141 } HII_IFR_PACKAGE_INSTANCE
;
144 // Simple Font Package definitions
146 #define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p')
147 typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE
{
149 EFI_HII_SIMPLE_FONT_PACKAGE_HDR
*SimpleFontPkgHdr
;
150 LIST_ENTRY SimpleFontEntry
;
151 } HII_SIMPLE_FONT_PACKAGE_INSTANCE
;
154 // Font Package definitions
156 #define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p')
157 typedef struct _HII_FONT_PACKAGE_INSTANCE
{
159 EFI_HII_FONT_PACKAGE_HDR
*FontPkgHdr
;
163 LIST_ENTRY FontEntry
;
164 LIST_ENTRY GlyphInfoList
;
165 } HII_FONT_PACKAGE_INSTANCE
;
167 #define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s')
168 typedef struct _HII_GLYPH_INFO
{
172 EFI_HII_GLYPH_INFO Cell
;
175 #define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i')
176 typedef struct _HII_FONT_INFO
{
179 LIST_ENTRY
*GlobalEntry
;
183 #define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i')
184 typedef struct _HII_GLOBAL_FONT_INFO
{
187 HII_FONT_PACKAGE_INSTANCE
*FontPackage
;
189 EFI_FONT_INFO
*FontInfo
;
190 } HII_GLOBAL_FONT_INFO
;
193 // Image Package definitions
196 #define HII_PIXEL_MASK 0x80
198 typedef struct _HII_IMAGE_PACKAGE_INSTANCE
{
199 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr
;
200 UINT32 ImageBlockSize
;
201 UINT32 PaletteInfoSize
;
204 } HII_IMAGE_PACKAGE_INSTANCE
;
207 // Keyboard Layout Pacakge definitions
209 #define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')
210 typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
{
213 LIST_ENTRY KeyboardEntry
;
214 } HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
;
217 // Guid Package definitions
219 #define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p')
220 typedef struct _HII_GUID_PACKAGE_INSTANCE
{
223 LIST_ENTRY GuidEntry
;
224 } HII_GUID_PACKAGE_INSTANCE
;
227 // A package list can contain only one or less than one device path package.
228 // This rule also applies to image package since ImageId can not be duplicate.
230 typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE
{
231 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr
;
232 LIST_ENTRY GuidPkgHdr
;
233 LIST_ENTRY FormPkgHdr
;
234 LIST_ENTRY KeyboardLayoutHdr
;
235 LIST_ENTRY StringPkgHdr
;
236 LIST_ENTRY FontPkgHdr
;
237 HII_IMAGE_PACKAGE_INSTANCE
*ImagePkg
;
238 LIST_ENTRY SimpleFontPkgHdr
;
239 UINT8
*DevicePathPkg
;
240 } HII_DATABASE_PACKAGE_LIST_INSTANCE
;
242 #define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l')
250 #define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r')
252 typedef struct _HII_DATABASE_RECORD
{
254 HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
;
255 EFI_HANDLE DriverHandle
;
256 EFI_HII_HANDLE Handle
;
257 LIST_ENTRY DatabaseEntry
;
258 } HII_DATABASE_RECORD
;
260 #define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n')
262 typedef struct _HII_DATABASE_NOTIFY
{
264 EFI_HANDLE NotifyHandle
;
266 EFI_GUID
*PackageGuid
;
267 EFI_HII_DATABASE_NOTIFY PackageNotifyFn
;
268 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
;
269 LIST_ENTRY DatabaseNotifyEntry
;
270 } HII_DATABASE_NOTIFY
;
272 #define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')
274 typedef struct _HII_DATABASE_PRIVATE_DATA
{
276 LIST_ENTRY DatabaseList
;
277 LIST_ENTRY DatabaseNotifyList
;
278 EFI_HII_FONT_PROTOCOL HiiFont
;
279 EFI_HII_IMAGE_PROTOCOL HiiImage
;
280 EFI_HII_STRING_PROTOCOL HiiString
;
281 EFI_HII_DATABASE_PROTOCOL HiiDatabase
;
282 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting
;
283 LIST_ENTRY HiiHandleList
;
285 LIST_ENTRY FontInfoList
; // global font info list
286 UINTN Attribute
; // default system color
287 EFI_GUID CurrentLayoutGuid
;
288 EFI_HII_KEYBOARD_LAYOUT
*CurrentLayout
;
289 } HII_DATABASE_PRIVATE_DATA
;
291 #define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
293 HII_DATABASE_PRIVATE_DATA, \
295 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
298 #define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
300 HII_DATABASE_PRIVATE_DATA, \
302 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
305 #define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
307 HII_DATABASE_PRIVATE_DATA, \
309 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
312 #define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
314 HII_DATABASE_PRIVATE_DATA, \
316 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
319 #define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
321 HII_DATABASE_PRIVATE_DATA, \
323 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
327 // Internal function prototypes.
331 This function checks whether a handle is a valid EFI_HII_HANDLE.
333 @param Handle Pointer to a EFI_HII_HANDLE
336 @retval FALSE Invalid
341 EFI_HII_HANDLE Handle
346 This function checks whether EFI_FONT_INFO exists in current database. If
347 FontInfoMask is specified, check what options can be used to make a match.
348 Note that the masks relate to where the system default should be supplied
349 are ignored by this function.
351 @param Private Hii database private structure.
352 @param FontInfo Points to EFI_FONT_INFO structure.
353 @param FontInfoMask If not NULL, describes what options can be used
354 to make a match between the font requested and
355 the font available. The caller must guarantee
357 @param FontHandle On entry, Points to the font handle returned by a
358 previous call to GetFontInfo() or NULL to start
360 @param GlobalFontInfo If not NULL, output the corresponding globa font
364 @retval FALSE Not existed
369 IN HII_DATABASE_PRIVATE_DATA
*Private
,
370 IN EFI_FONT_INFO
*FontInfo
,
371 IN EFI_FONT_INFO_MASK
*FontInfoMask
, OPTIONAL
372 IN EFI_FONT_HANDLE FontHandle
, OPTIONAL
373 OUT HII_GLOBAL_FONT_INFO
**GlobalFontInfo OPTIONAL
378 This function invokes the matching registered function.
380 @param Private HII Database driver private structure.
381 @param NotifyType The type of change concerning the database.
382 @param PackageInstance Points to the package referred to by the notification.
383 @param PackageType Package type
384 @param Handle The handle of the package list which contains the specified package.
386 @retval EFI_SUCCESS Already checked all registered function and invoked
388 @retval EFI_INVALID_PARAMETER Any input parameter is not valid.
392 InvokeRegisteredFunction (
393 IN HII_DATABASE_PRIVATE_DATA
*Private
,
394 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
395 IN VOID
*PackageInstance
,
396 IN UINT8 PackageType
,
397 IN EFI_HII_HANDLE Handle
402 Retrieve system default font and color.
404 @param Private HII database driver private data.
405 @param FontInfo Points to system default font output-related
406 information. It's caller's responsibility to free
408 @param FontInfoSize If not NULL, output the size of buffer FontInfo.
410 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.
411 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
413 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
418 IN HII_DATABASE_PRIVATE_DATA
*Private
,
419 OUT EFI_FONT_DISPLAY_INFO
**FontInfo
,
420 OUT UINTN
*FontInfoSize OPTIONAL
425 Parse all string blocks to find a String block specified by StringId.
426 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks
427 within this string package and backup its information. If LastStringId is
428 specified, the string id of last string block will also be output.
429 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).
431 @param Private Hii database private structure.
432 @param StringPackage Hii string package instance.
433 @param StringId The string's id, which is unique within
435 @param BlockType Output the block type of found string block.
436 @param StringBlockAddr Output the block address of found string block.
437 @param StringTextOffset Offset, relative to the found block address, of
438 the string text information.
439 @param LastStringId Output the last string id when StringId = 0 or StringId = -1.
440 @param StartStringId The first id in the skip block which StringId in the block.
442 @retval EFI_SUCCESS The string text and font is retrieved
444 @retval EFI_NOT_FOUND The specified text or font info can not be found
446 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
452 IN HII_DATABASE_PRIVATE_DATA
*Private
,
453 IN HII_STRING_PACKAGE_INSTANCE
*StringPackage
,
454 IN EFI_STRING_ID StringId
,
455 OUT UINT8
*BlockType
, OPTIONAL
456 OUT UINT8
**StringBlockAddr
, OPTIONAL
457 OUT UINTN
*StringTextOffset
, OPTIONAL
458 OUT EFI_STRING_ID
*LastStringId
, OPTIONAL
459 OUT EFI_STRING_ID
*StartStringId OPTIONAL
464 Parse all glyph blocks to find a glyph block specified by CharValue.
465 If CharValue = (CHAR16) (-1), collect all default character cell information
466 within this font package and backup its information.
468 @param FontPackage Hii string package instance.
469 @param CharValue Unicode character value, which identifies a glyph
471 @param GlyphBuffer Output the corresponding bitmap data of the found
472 block. It is the caller's responsiblity to free
474 @param Cell Output cell information of the encoded bitmap.
475 @param GlyphBufferLen If not NULL, output the length of GlyphBuffer.
477 @retval EFI_SUCCESS The bitmap data is retrieved successfully.
478 @retval EFI_NOT_FOUND The specified CharValue does not exist in current
480 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
486 IN HII_FONT_PACKAGE_INSTANCE
*FontPackage
,
488 OUT UINT8
**GlyphBuffer
, OPTIONAL
489 OUT EFI_HII_GLYPH_INFO
*Cell
, OPTIONAL
490 OUT UINTN
*GlyphBufferLen OPTIONAL
494 This function exports Form packages to a buffer.
495 This is a internal function.
497 @param Private Hii database private structure.
498 @param Handle Identification of a package list.
499 @param PackageList Pointer to a package list which will be exported.
500 @param UsedSize The length of buffer be used.
501 @param BufferSize Length of the Buffer.
502 @param Buffer Allocated space for storing exported data.
503 @param ResultSize The size of the already exported content of this
506 @retval EFI_SUCCESS Form Packages are exported successfully.
507 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
512 IN HII_DATABASE_PRIVATE_DATA
*Private
,
513 IN EFI_HII_HANDLE Handle
,
514 IN HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
,
518 IN OUT UINTN
*ResultSize
522 // EFI_HII_FONT_PROTOCOL protocol interfaces
527 Renders a string to a bitmap or to the display.
529 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
530 @param Flags Describes how the string is to be drawn.
531 @param String Points to the null-terminated string to be
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 Together with BltX, Specifies the offset from the left and top edge
547 of the image of the first character cell in the
549 @param BltY Together with BltY, Specifies the offset from the left and top edge
550 of the image of the first character cell in the
552 @param RowInfoArray If this is non-NULL on entry, then on exit, this
553 will point to an allocated buffer containing
554 row information and RowInfoArraySize will be
555 updated to contain the number of elements.
556 This array describes the characters which were at
557 least partially drawn and the heights of the
558 rows. It is the caller's responsibility to free
560 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
561 contains the number of elements in RowInfoArray.
562 @param ColumnInfoArray If this is non-NULL, then on return it will be
563 filled with the horizontal offset for each
564 character in the string on the row where it is
565 displayed. Non-printing characters will have
566 the offset ~0. The caller is responsible to
567 allocate a buffer large enough so that there
568 is one entry for each character in the string,
569 not including the null-terminator. It is possible
570 when character display is normalized that some
571 character cells overlap.
573 @retval EFI_SUCCESS The string was successfully rendered.
574 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
576 @retval EFI_INVALID_PARAMETER The String or Blt.
577 @retval EFI_INVALID_PARAMETER Flags were invalid combination..
583 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
584 IN EFI_HII_OUT_FLAGS Flags
,
585 IN CONST EFI_STRING String
,
586 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
587 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
590 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
591 OUT UINTN
*RowInfoArraySize OPTIONAL
,
592 OUT UINTN
*ColumnInfoArray OPTIONAL
597 Render a string to a bitmap or the screen containing the contents of the specified string.
599 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
600 @param Flags Describes how the string is to be drawn.
601 @param PackageList The package list in the HII database to search
602 for the specified string.
603 @param StringId The string's id, which is unique within
605 @param Language Points to the language for the retrieved string.
606 If NULL, then the current system language is
608 @param StringInfo Points to the string output information,
609 including the color and font. If NULL, then the
610 string will be output in the default system font
612 @param Blt If this points to a non-NULL on entry, this
613 points to the image, which is Width pixels wide
614 and Height pixels high. The string will be drawn
616 EFI_HII_OUT_FLAG_CLIP is implied. If this points
617 to a NULL on entry, then a buffer
618 will be allocated to hold the generated image and
619 the pointer updated on exit. It is the caller's
620 responsibility to free this buffer.
621 @param BltX Together with BltX, Specifies the offset from the left and top edge
622 of the image of the first character cell in the
624 @param BltY Together with BltY, Specifies the offset from the left and top edge
625 of the image of the first character cell in the
627 @param RowInfoArray If this is non-NULL on entry, then on exit, this
628 will point to an allocated buffer containing
629 row information and RowInfoArraySize will be
630 updated to contain the number of elements.
631 This array describes the characters which were at
632 least partially drawn and the heights of the
633 rows. It is the caller's responsibility to free
635 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
636 contains the number of elements in RowInfoArray.
637 @param ColumnInfoArray If this is non-NULL, then on return it will be
638 filled with the horizontal offset for each
639 character in the string on the row where it is
640 displayed. Non-printing characters will have
641 the offset ~0. The caller is responsible to
642 allocate a buffer large enough so that there
643 is one entry for each character in the string,
644 not including the null-terminator. It is possible
645 when character display is normalized that some
646 character cells overlap.
648 @retval EFI_SUCCESS The string was successfully rendered.
649 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
651 @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.
652 @retval EFI_INVALID_PARAMETER Flags were invalid combination.
653 @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not
654 in the specified PackageList.
660 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
661 IN EFI_HII_OUT_FLAGS Flags
,
662 IN EFI_HII_HANDLE PackageList
,
663 IN EFI_STRING_ID StringId
,
664 IN CONST CHAR8
* Language
,
665 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
666 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
669 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
670 OUT UINTN
*RowInfoArraySize OPTIONAL
,
671 OUT UINTN
*ColumnInfoArray OPTIONAL
676 Convert the glyph for a single character into a bitmap.
678 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
679 @param Char Character to retrieve.
680 @param StringInfo Points to the string font and color information
681 or NULL if the string should use the default
682 system font and color.
683 @param Blt Thus must point to a NULL on entry. A buffer will
684 be allocated to hold the output and the pointer
685 updated on exit. It is the caller's
686 responsibility to free this buffer.
687 @param Baseline Number of pixels from the bottom of the bitmap to
690 @retval EFI_SUCCESS Glyph bitmap created.
691 @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.
692 @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was replaced with the
693 glyph for Unicode character 0xFFFD.
694 @retval EFI_INVALID_PARAMETER Blt is NULL or *Blt is not NULL.
700 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
702 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo
,
703 OUT EFI_IMAGE_OUTPUT
**Blt
,
704 OUT UINTN
*Baseline OPTIONAL
709 This function iterates through fonts which match the specified font, using
710 the specified criteria. If String is non-NULL, then all of the characters in
711 the string must exist in order for a candidate font to be returned.
713 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
714 @param FontHandle On entry, points to the font handle returned by a
715 previous call to GetFontInfo() or NULL to start
716 with the first font. On return, points to the
717 returned font handle or points to NULL if there
718 are no more matching fonts.
719 @param StringInfoIn Upon entry, points to the font to return
720 information about. If NULL, then the information about the system default
721 font will be returned.
722 @param StringInfoOut Upon return, contains the matching font's
723 information. If NULL, then no information is
724 returned. It's caller's responsibility to free
726 @param String Points to the string which will be tested to
727 determine if all characters are available. If
728 NULL, then any font is acceptable.
730 @retval EFI_SUCCESS Matching font returned successfully.
731 @retval EFI_NOT_FOUND No matching font was found.
732 @retval EFI_INVALID_PARAMETER StringInfoIn is NULL.
733 @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.
734 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
740 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
741 IN OUT EFI_FONT_HANDLE
*FontHandle
,
742 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfoIn
, OPTIONAL
743 OUT EFI_FONT_DISPLAY_INFO
**StringInfoOut
,
744 IN CONST EFI_STRING String OPTIONAL
748 // EFI_HII_IMAGE_PROTOCOL interfaces
753 This function adds the image Image to the group of images owned by PackageList, and returns
754 a new image identifier (ImageId).
756 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
757 @param PackageList Handle of the package list where this image will
759 @param ImageId On return, contains the new image id, which is
760 unique within PackageList.
761 @param Image Points to the image.
763 @retval EFI_SUCCESS The new image was added successfully.
764 @retval EFI_NOT_FOUND The specified PackageList could not be found in
766 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.
767 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.
773 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
774 IN EFI_HII_HANDLE PackageList
,
775 OUT EFI_IMAGE_ID
*ImageId
,
776 IN CONST EFI_IMAGE_INPUT
*Image
781 This function retrieves the image specified by ImageId which is associated with
782 the specified PackageList and copies it into the buffer specified by Image.
784 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
785 @param PackageList Handle of the package list where this image will
787 @param ImageId The image's id,, which is unique within
789 @param Image Points to the image.
791 @retval EFI_SUCCESS The new image was returned successfully.
792 @retval EFI_NOT_FOUND The image specified by ImageId is not available.
793 The specified PackageList is not in the database.
794 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
796 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.
797 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
804 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
805 IN EFI_HII_HANDLE PackageList
,
806 IN EFI_IMAGE_ID ImageId
,
807 OUT EFI_IMAGE_INPUT
*Image
812 This function updates the image specified by ImageId in the specified PackageListHandle to
813 the image specified by Image.
815 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
816 @param PackageList The package list containing the images.
817 @param ImageId The image's id,, which is unique within
819 @param Image Points to the image.
821 @retval EFI_SUCCESS The new image was updated successfully.
822 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
823 database. The specified PackageList is not in the database.
824 @retval EFI_INVALID_PARAMETER The Image was NULL.
830 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
831 IN EFI_HII_HANDLE PackageList
,
832 IN EFI_IMAGE_ID ImageId
,
833 IN CONST EFI_IMAGE_INPUT
*Image
838 This function renders an image to a bitmap or the screen using the specified
839 color and options. It draws the image on an existing bitmap, allocates a new
840 bitmap or uses the screen. The images can be clipped.
842 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
843 @param Flags Describes how the image is to be drawn.
844 @param Image Points to the image to be displayed.
845 @param Blt If this points to a non-NULL on entry, this
846 points to the image, which is Width pixels wide
847 and Height pixels high. The image will be drawn
848 onto this image and EFI_HII_DRAW_FLAG_CLIP is
849 implied. If this points to a NULL on entry, then
850 a buffer will be allocated to hold the generated
851 image and the pointer updated on exit. It is the
852 caller's responsibility to free this buffer.
853 @param BltX Specifies the offset from the left and top edge
854 of the output image of the first pixel in the
856 @param BltY Specifies the offset from the left and top edge
857 of the output image of the first pixel in the
860 @retval EFI_SUCCESS The image was successfully drawn.
861 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
862 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.
863 @retval EFI_INVALID_PARAMETER Any combination of Flags is invalid.
869 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
870 IN EFI_HII_DRAW_FLAGS Flags
,
871 IN CONST EFI_IMAGE_INPUT
*Image
,
872 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
879 This function renders an image to a bitmap or the screen using the specified
880 color and options. It draws the image on an existing bitmap, allocates a new
881 bitmap or uses the screen. The images can be clipped.
883 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
884 @param Flags Describes how the image is to be drawn.
885 @param PackageList The package list in the HII database to search
886 for the specified image.
887 @param ImageId The image's id, which is unique within
889 @param Blt If this points to a non-NULL on entry, this
890 points to the image, which is Width pixels wide
891 and Height pixels high. The image will be drawn
893 EFI_HII_DRAW_FLAG_CLIP is implied. If this points
894 to a NULL on entry, then a buffer will be
895 allocated to hold the generated image and the
896 pointer updated on exit. It is the caller's
897 responsibility to free this buffer.
898 @param BltX Specifies the offset from the left and top edge
899 of the output image of the first pixel in the
901 @param BltY Specifies the offset from the left and top edge
902 of the output image of the first pixel in the
905 @retval EFI_SUCCESS The image was successfully drawn.
906 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
907 @retval EFI_INVALID_PARAMETER The Blt was NULL.
908 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
909 The specified PackageList is not in the database.
915 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
916 IN EFI_HII_DRAW_FLAGS Flags
,
917 IN EFI_HII_HANDLE PackageList
,
918 IN EFI_IMAGE_ID ImageId
,
919 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
927 // EFI_HII_STRING_PROTOCOL
932 This function adds the string String to the group of strings owned by PackageList, with the
933 specified font information StringFontInfo and returns a new string id.
935 @param This A pointer to the EFI_HII_STRING_PROTOCOL
937 @param PackageList Handle of the package list where this string will
939 @param StringId On return, contains the new strings id, which is
940 unique within PackageList.
941 @param Language Points to the language for the new string.
942 @param LanguageName Points to the printable language name to
943 associate with the passed in Language field.If
944 LanguageName is not NULL and the string package
945 header's LanguageName associated with a given
946 Language is not zero, the LanguageName being
947 passed in will be ignored.
948 @param String Points to the new null-terminated string.
949 @param StringFontInfo Points to the new string's font information or
950 NULL if the string should have the default system
951 font, size and style.
953 @retval EFI_SUCCESS The new string was added successfully.
954 @retval EFI_NOT_FOUND The specified PackageList could not be found in
956 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of
958 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL or Language is
965 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
966 IN EFI_HII_HANDLE PackageList
,
967 OUT EFI_STRING_ID
*StringId
,
968 IN CONST CHAR8
*Language
,
969 IN CONST CHAR16
*LanguageName
, OPTIONAL
970 IN CONST EFI_STRING String
,
971 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
976 This function retrieves the string specified by StringId which is associated
977 with the specified PackageList in the language Language and copies it into
978 the buffer specified by String.
980 @param This A pointer to the EFI_HII_STRING_PROTOCOL
982 @param Language Points to the language for the retrieved string.
983 @param PackageList The package list in the HII database to search
984 for the specified string.
985 @param StringId The string's id, which is unique within
987 @param String Points to the new null-terminated string.
988 @param StringSize On entry, points to the size of the buffer
989 pointed to by String, in bytes. On return,
990 points to the length of the string, in bytes.
991 @param StringFontInfo If not NULL, points to the string's font
992 information. It's caller's responsibility to
995 @retval EFI_SUCCESS The string was returned successfully.
996 @retval EFI_NOT_FOUND The string specified by StringId is not
998 @retval EFI_NOT_FOUND The string specified by StringId is available but
999 not in the specified language.
1000 The specified PackageList is not in the database.
1001 @retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but
1002 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small
1004 @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL.
1005 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
1012 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1013 IN CONST CHAR8
*Language
,
1014 IN EFI_HII_HANDLE PackageList
,
1015 IN EFI_STRING_ID StringId
,
1016 OUT EFI_STRING String
,
1017 IN OUT UINTN
*StringSize
,
1018 OUT EFI_FONT_INFO
**StringFontInfo OPTIONAL
1023 This function updates the string specified by StringId in the specified PackageList to the text
1024 specified by String and, optionally, the font information specified by StringFontInfo.
1026 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1028 @param PackageList The package list containing the strings.
1029 @param StringId The string's id, which is unique within
1031 @param Language Points to the language for the updated string.
1032 @param String Points to the new null-terminated string.
1033 @param StringFontInfo Points to the string's font information or NULL
1034 if the string font information is not changed.
1036 @retval EFI_SUCCESS The string was updated successfully.
1037 @retval EFI_NOT_FOUND The string specified by StringId is not in the
1039 @retval EFI_INVALID_PARAMETER The String or Language was NULL.
1040 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
1047 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1048 IN EFI_HII_HANDLE PackageList
,
1049 IN EFI_STRING_ID StringId
,
1050 IN CONST CHAR8
*Language
,
1051 IN CONST EFI_STRING String
,
1052 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
1057 This function returns the list of supported languages, in the format specified
1058 in Appendix M of UEFI 2.1 spec.
1060 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1062 @param PackageList The package list to examine.
1063 @param Languages Points to the buffer to hold the returned
1064 null-terminated ASCII string.
1065 @param LanguagesSize On entry, points to the size of the buffer
1066 pointed to by Languages, in bytes. On return,
1067 points to the length of Languages, in bytes.
1069 @retval EFI_SUCCESS The languages were returned successfully.
1070 @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.
1071 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list
1072 of supported languages. LanguageSize is updated
1073 to contain the required size.
1074 @retval EFI_NOT_FOUND Could not find string package in specified
1081 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1082 IN EFI_HII_HANDLE PackageList
,
1083 IN OUT CHAR8
*Languages
,
1084 IN OUT UINTN
*LanguagesSize
1089 Each string package has associated with it a single primary language and zero
1090 or more secondary languages. This routine returns the secondary languages
1091 associated with a package list.
1093 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1095 @param PackageList The package list to examine.
1096 @param PrimaryLanguage Points to the null-terminated ASCII string that specifies
1097 the primary language. Languages are specified in the
1098 format specified in Appendix M of the UEFI 2.0 specification.
1099 @param SecondaryLanguages Points to the buffer to hold the returned null-terminated
1100 ASCII string that describes the list of
1101 secondary languages for the specified
1102 PrimaryLanguage. If there are no secondary
1103 languages, the function returns successfully,
1104 but this is set to NULL.
1105 @param SecondaryLanguagesSize On entry, points to the size of the buffer
1106 pointed to by SecondaryLanguages, in bytes. On
1107 return, points to the length of SecondaryLanguages
1110 @retval EFI_SUCCESS Secondary languages were correctly returned.
1111 @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguages or
1112 SecondaryLanguagesSize was NULL.
1113 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is
1114 too small to hold the returned information.
1115 SecondaryLanguageSize is updated to hold the size of
1116 the buffer required.
1117 @retval EFI_INVALID_LANGUAGE The language specified by PrimaryLanguage is not
1118 present in the specified package list.
1119 @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
1124 HiiGetSecondaryLanguages (
1125 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1126 IN EFI_HII_HANDLE PackageList
,
1127 IN CONST CHAR8
*PrimaryLanguage
,
1128 IN OUT CHAR8
*SecondaryLanguages
,
1129 IN OUT UINTN
*SecondaryLanguagesSize
1133 // EFI_HII_DATABASE_PROTOCOL protocol interfaces
1138 This function adds the packages in the package list to the database and returns a handle. If there is a
1139 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will
1140 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.
1142 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1144 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1146 @param DriverHandle Associate the package list with this EFI handle.
1147 If a NULL is specified, this data will not be associate
1148 with any drivers and cannot have a callback induced.
1149 @param Handle A pointer to the EFI_HII_HANDLE instance.
1151 @retval EFI_SUCCESS The package list associated with the Handle was
1152 added to the HII database.
1153 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the
1154 new database contents.
1155 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.
1161 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1162 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
,
1163 IN CONST EFI_HANDLE DriverHandle
, OPTIONAL
1164 OUT EFI_HII_HANDLE
*Handle
1169 This function removes the package list that is associated with a handle Handle
1170 from the HII database. Before removing the package, any registered functions
1171 with the notification type REMOVE_PACK and the same package type will be called.
1173 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1175 @param Handle The handle that was registered to the data that
1176 is requested for removal.
1178 @retval EFI_SUCCESS The data associated with the Handle was removed
1179 from the HII database.
1180 @retval EFI_NOT_FOUND The specified Handle is not in database.
1185 HiiRemovePackageList (
1186 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1187 IN EFI_HII_HANDLE Handle
1192 This function updates the existing package list (which has the specified Handle)
1193 in the HII databases, using the new package list specified by PackageList.
1195 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1197 @param Handle The handle that was registered to the data that
1198 is requested to be updated.
1199 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1202 @retval EFI_SUCCESS The HII database was successfully updated.
1203 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated
1205 @retval EFI_INVALID_PARAMETER PackageList was NULL.
1206 @retval EFI_NOT_FOUND The specified Handle is not in database.
1211 HiiUpdatePackageList (
1212 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1213 IN EFI_HII_HANDLE Handle
,
1214 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
1219 This function returns a list of the package handles of the specified type
1220 that are currently active in the database. The pseudo-type
1221 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.
1223 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1225 @param PackageType Specifies the package type of the packages to
1226 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1228 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1229 this is the pointer to the GUID which must match
1230 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.
1231 Otherwise, it must be NULL.
1232 @param HandleBufferLength On input, a pointer to the length of the handle
1233 buffer. On output, the length of the handle
1234 buffer that is required for the handles found.
1235 @param Handle An array of EFI_HII_HANDLE instances returned.
1237 @retval EFI_SUCCESS The matching handles are outputed successfully.
1238 HandleBufferLength is updated with the actual length.
1239 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1240 Handle is too small to support the number of
1241 handles. HandleBufferLength is updated with a
1242 value that will enable the data to fit.
1243 @retval EFI_NOT_FOUND No matching handle could not be found in
1245 @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.
1246 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
1247 PackageGuid is not NULL, PackageType is a EFI_HII_
1248 PACKAGE_TYPE_GUID but PackageGuid is NULL.
1254 HiiListPackageLists (
1255 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1256 IN UINT8 PackageType
,
1257 IN CONST EFI_GUID
*PackageGuid
,
1258 IN OUT UINTN
*HandleBufferLength
,
1259 OUT EFI_HII_HANDLE
*Handle
1264 This function will export one or all package lists in the database to a buffer.
1265 For each package list exported, this function will call functions registered
1266 with EXPORT_PACK and then copy the package list to the buffer.
1268 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1270 @param Handle An EFI_HII_HANDLE that corresponds to the desired
1271 package list in the HII database to export or
1272 NULL to indicate all package lists should be
1274 @param BufferSize On input, a pointer to the length of the buffer.
1275 On output, the length of the buffer that is
1276 required for the exported data.
1277 @param Buffer A pointer to a buffer that will contain the
1278 results of the export function.
1280 @retval EFI_SUCCESS Package exported.
1281 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1282 Handle is too small to support the number of
1283 handles. HandleBufferLength is updated with
1284 a value that will enable the data to fit.
1285 @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the
1287 @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.
1292 HiiExportPackageLists (
1293 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1294 IN EFI_HII_HANDLE Handle
,
1295 IN OUT UINTN
*BufferSize
,
1296 OUT EFI_HII_PACKAGE_LIST_HEADER
*Buffer
1301 This function registers a function which will be called when specified actions related to packages of
1302 the specified type occur in the HII database. By registering a function, other HII-related drivers are
1303 notified when specific package types are added, removed or updated in the HII database.
1304 Each driver or application which registers a notification should use
1305 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.
1307 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1309 @param PackageType Specifies the package type of the packages to
1310 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1312 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1313 this is the pointer to the GUID which must match
1315 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must
1317 @param PackageNotifyFn Points to the function to be called when the
1319 NotificationType occurs.
1320 @param NotifyType Describes the types of notification which this
1321 function will be receiving.
1322 @param NotifyHandle Points to the unique handle assigned to the
1323 registered notification. Can be used in
1324 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()
1325 to stop notifications.
1327 @retval EFI_SUCCESS Notification registered successfully.
1328 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures
1329 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.
1330 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not
1331 EFI_HII_PACKAGE_TYPE_GUID.
1332 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is
1333 EFI_HII_PACKAGE_TYPE_GUID.
1338 HiiRegisterPackageNotify (
1339 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1340 IN UINT8 PackageType
,
1341 IN CONST EFI_GUID
*PackageGuid
,
1342 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn
,
1343 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
1344 OUT EFI_HANDLE
*NotifyHandle
1349 Removes the specified HII database package-related notification.
1351 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1353 @param NotificationHandle The handle of the notification function being
1356 @retval EFI_SUCCESS Notification is unregistered successfully.
1357 @retval EFI_NOT_FOUND The incoming notification handle does not exist
1358 in current hii database.
1363 HiiUnregisterPackageNotify (
1364 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1365 IN EFI_HANDLE NotificationHandle
1370 This routine retrieves an array of GUID values for each keyboard layout that
1371 was previously registered in the system.
1373 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1375 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard
1376 GUID buffer. On output, the length of the handle
1377 buffer that is required for the handles found.
1378 @param KeyGuidBuffer An array of keyboard layout GUID instances
1381 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.
1382 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates
1383 that KeyGuidBuffer is too small to support the
1384 number of GUIDs. KeyGuidBufferLength is
1385 updated with a value that will enable the data to
1387 @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was
1389 @retval EFI_NOT_FOUND There was no keyboard layout.
1394 HiiFindKeyboardLayouts (
1395 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1396 IN OUT UINT16
*KeyGuidBufferLength
,
1397 OUT EFI_GUID
*KeyGuidBuffer
1402 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys
1403 on a keyboard and the character(s) that are associated with a particular set of key strokes.
1405 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1407 @param KeyGuid A pointer to the unique ID associated with a
1408 given keyboard layout. If KeyGuid is NULL then
1409 the current layout will be retrieved.
1410 @param KeyboardLayoutLength On input, a pointer to the length of the
1411 KeyboardLayout buffer. On output, the length of
1412 the data placed into KeyboardLayout.
1413 @param KeyboardLayout A pointer to a buffer containing the retrieved
1416 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
1417 @retval EFI_NOT_FOUND The requested keyboard layout was not found.
1418 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was
1424 HiiGetKeyboardLayout (
1425 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1426 IN CONST EFI_GUID
*KeyGuid
,
1427 IN OUT UINT16
*KeyboardLayoutLength
,
1428 OUT EFI_HII_KEYBOARD_LAYOUT
*KeyboardLayout
1433 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine
1434 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
1435 group type. This is so that agents which are sensitive to the current keyboard layout being changed
1436 can be notified of this change.
1438 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1440 @param KeyGuid A pointer to the unique ID associated with a
1441 given keyboard layout.
1443 @retval EFI_SUCCESS The current keyboard layout was successfully set.
1444 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so
1446 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.
1451 HiiSetKeyboardLayout (
1452 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1453 IN CONST EFI_GUID
*KeyGuid
1458 Return the EFI handle associated with a package list.
1460 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1462 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired
1463 package list in the HIIdatabase.
1464 @param DriverHandle On return, contains the EFI_HANDLE which was
1465 registered with the package list in
1468 @retval EFI_SUCCESS The DriverHandle was returned successfully.
1469 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or
1470 DriverHandle was NULL.
1475 HiiGetPackageListHandle (
1476 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1477 IN EFI_HII_HANDLE PackageListHandle
,
1478 OUT EFI_HANDLE
*DriverHandle
1482 // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces
1487 This function allows a caller to extract the current configuration
1488 for one or more named elements from one or more drivers.
1490 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1492 @param Request A null-terminated Unicode string in
1493 <MultiConfigRequest> format.
1494 @param Progress On return, points to a character in the Request
1495 string. Points to the string's null terminator if
1496 request was successful. Points to the most recent
1497 & before the first failing name / value pair (or
1498 the beginning of the string if the failure is in
1499 the first name / value pair) if the request was
1501 @param Results Null-terminated Unicode string in
1502 <MultiConfigAltResp> format which has all values
1503 filled in for the names in the Request string.
1504 String to be allocated by the called function.
1506 @retval EFI_SUCCESS The Results string is filled with the values
1507 corresponding to all requested names.
1508 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1509 results that must be stored awaiting possible
1511 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.
1512 Progress set to the "G" in "GUID" of the
1513 routing header that doesn't match. Note: There
1514 is no requirement that all routing data
1515 be validated before any configuration extraction.
1516 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request
1517 parameter would result in this type of error. The
1518 Progress parameter is set to NULL.
1519 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &
1520 before the error or the beginning of the string.
1521 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the
1527 HiiConfigRoutingExtractConfig (
1528 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1529 IN CONST EFI_STRING Request
,
1530 OUT EFI_STRING
*Progress
,
1531 OUT EFI_STRING
*Results
1536 This function allows the caller to request the current configuration for the
1537 entirety of the current HII database and returns the data in a null-terminated Unicode string.
1539 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1541 @param Results Null-terminated Unicode string in
1542 <MultiConfigAltResp> format which has all values
1543 filled in for the names in the Request string.
1544 String to be allocated by the called function.
1545 De-allocation is up to the caller.
1547 @retval EFI_SUCCESS The Results string is filled with the values
1548 corresponding to all requested names.
1549 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1550 results that must be stored awaiting possible
1552 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results
1553 parameter would result in this type of error.
1558 HiiConfigRoutingExportConfig (
1559 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1560 OUT EFI_STRING
*Results
1565 This function processes the results of processing forms and routes it to the
1566 appropriate handlers or storage.
1568 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1570 @param Configuration A null-terminated Unicode string in
1571 <MulltiConfigResp> format.
1572 @param Progress A pointer to a string filled in with the offset
1573 of the most recent & before the first failing
1574 name / value pair (or the beginning of the string
1575 if the failure is in the first name / value pair)
1576 or the terminating NULL if all was successful.
1578 @retval EFI_SUCCESS The results have been distributed or are awaiting
1580 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1581 results that must be stored awaiting possible
1583 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter
1584 would result in this type of error.
1585 @retval EFI_NOT_FOUND Target for the specified routing data was not
1591 HiiConfigRoutingRouteConfig (
1592 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1593 IN CONST EFI_STRING Configuration
,
1594 OUT EFI_STRING
*Progress
1600 This helper function is to be called by drivers to map configuration data stored
1601 in byte array ("block") formats such as UEFI Variables into current configuration strings.
1603 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1605 @param ConfigRequest A null-terminated Unicode string in
1606 <ConfigRequest> format.
1607 @param Block Array of bytes defining the block's
1609 @param BlockSize Length in bytes of Block.
1610 @param Config Filled-in configuration string. String allocated
1611 by the function. Returned only if call is
1613 @param Progress A pointer to a string filled in with the offset
1614 of the most recent & before the first failing
1615 name/value pair (or the beginning of the string
1616 if the failure is in the first name / value pair)
1617 or the terminating NULL if all was successful.
1619 @retval EFI_SUCCESS The request succeeded. Progress points to the
1620 null terminator at the end of the ConfigRequest
1622 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1623 Progress points to the first character of
1625 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or
1626 Block parameter would result in this type of
1627 error. Progress points to the first character of
1629 @retval EFI_NOT_FOUND Target for the specified routing data was not
1630 found. Progress points to the "G" in "GUID" of
1631 the errant routing data.
1632 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.
1633 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.
1634 Block is left updated and Progress points at
1635 the '&' preceding the first non-<BlockName>.
1641 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1642 IN CONST EFI_STRING ConfigRequest
,
1643 IN CONST UINT8
*Block
,
1644 IN CONST UINTN BlockSize
,
1645 OUT EFI_STRING
*Config
,
1646 OUT EFI_STRING
*Progress
1651 This helper function is to be called by drivers to map configuration strings
1652 to configurations stored in byte array ("block") formats such as UEFI Variables.
1654 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1656 @param ConfigResp A null-terminated Unicode string in <ConfigResp>
1658 @param Block A possibly null array of bytes representing the
1659 current block. Only bytes referenced in the
1660 ConfigResp string in the block are modified. If
1661 this parameter is null or if the *BlockSize
1662 parameter is (on input) shorter than required by
1663 the Configuration string, only the BlockSize
1664 parameter is updated and an appropriate status
1665 (see below) is returned.
1666 @param BlockSize The length of the Block in units of UINT8. On
1667 input, this is the size of the Block. On output,
1668 if successful, contains the index of the last
1669 modified byte in the Block.
1670 @param Progress On return, points to an element of the ConfigResp
1671 string filled in with the offset of the most
1672 recent '&' before the first failing name / value
1673 pair (or the beginning of the string if the
1674 failure is in the first name / value pair) or
1675 the terminating NULL if all was successful.
1677 @retval EFI_SUCCESS The request succeeded. Progress points to the
1678 null terminator at the end of the ConfigResp
1680 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1681 Progress points to the first character of
1683 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or
1684 Block parameter would result in this type of
1685 error. Progress points to the first character of
1687 @retval EFI_NOT_FOUND Target for the specified routing data was not
1688 found. Progress points to the "G" in "GUID" of
1689 the errant routing data.
1690 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /
1691 value pair. Block is left updated and
1692 Progress points at the '&' preceding the first
1699 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1700 IN CONST EFI_STRING ConfigResp
,
1701 IN OUT UINT8
*Block
,
1702 IN OUT UINTN
*BlockSize
,
1703 OUT EFI_STRING
*Progress
1708 This helper function is to be called by drivers to extract portions of
1709 a larger configuration string.
1711 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1713 @param Configuration A null-terminated Unicode string in
1714 <MultiConfigAltResp> format.
1715 @param Guid A pointer to the GUID value to search for in the
1716 routing portion of the ConfigResp string when
1717 retrieving the requested data. If Guid is NULL,
1718 then all GUID values will be searched for.
1719 @param Name A pointer to the NAME value to search for in the
1720 routing portion of the ConfigResp string when
1721 retrieving the requested data. If Name is NULL,
1722 then all Name values will be searched for.
1723 @param DevicePath A pointer to the PATH value to search for in the
1724 routing portion of the ConfigResp string when
1725 retrieving the requested data. If DevicePath is
1726 NULL, then all DevicePath values will be
1728 @param AltCfgId A pointer to the ALTCFG value to search for in
1729 the routing portion of the ConfigResp string
1730 when retrieving the requested data. If this
1731 parameter is NULL, then the current setting will
1733 @param AltCfgResp A pointer to a buffer which will be allocated by
1734 the function which contains the retrieved string
1735 as requested. This buffer is only allocated if
1736 the call was successful.
1738 @retval EFI_SUCCESS The request succeeded. The requested data was
1739 extracted and placed in the newly allocated
1741 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.
1742 @retval EFI_INVALID_PARAMETER Any parameter is invalid.
1743 @retval EFI_NOT_FOUND Target for the specified routing data was not
1750 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1751 IN CONST EFI_STRING Configuration
,
1752 IN CONST EFI_GUID
*Guid
,
1753 IN CONST EFI_STRING Name
,
1754 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1755 IN CONST UINT16
*AltCfgId
,
1756 OUT EFI_STRING
*AltCfgResp
1761 Compare whether two names of languages are identical.
1763 @param Language1 Name of language 1 from StringPackage
1764 @param Language2 Name of language 2 to be compared with language 1.
1767 @retval FALSE not same
1771 HiiCompareLanguage (
1772 IN CHAR8
*Language1
,
1780 extern EFI_EVENT gHiiKeyboardLayoutChanged
;