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
93 #define EFI_HII_VARSTORE_BUFFER 0
94 #define EFI_HII_VARSTORE_NAME_VALUE 1
95 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
97 #define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G')
102 EFI_HII_HANDLE HiiHandle
;
103 EFI_HANDLE DriverHandle
;
105 UINT8 Type
; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE
109 } HII_FORMSET_STORAGE
;
113 // String Package definitions
115 #define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p')
116 typedef struct _HII_STRING_PACKAGE_INSTANCE
{
118 EFI_HII_STRING_PACKAGE_HDR
*StringPkgHdr
;
120 LIST_ENTRY StringEntry
;
121 LIST_ENTRY FontInfoList
; // local font info list
123 EFI_STRING_ID MaxStringId
; // record StringId
124 } HII_STRING_PACKAGE_INSTANCE
;
127 // Form Package definitions
129 #define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p')
130 typedef struct _HII_IFR_PACKAGE_INSTANCE
{
132 EFI_HII_PACKAGE_HEADER FormPkgHdr
;
135 } HII_IFR_PACKAGE_INSTANCE
;
138 // Simple Font Package definitions
140 #define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p')
141 typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE
{
143 EFI_HII_SIMPLE_FONT_PACKAGE_HDR
*SimpleFontPkgHdr
;
144 LIST_ENTRY SimpleFontEntry
;
145 } HII_SIMPLE_FONT_PACKAGE_INSTANCE
;
148 // Font Package definitions
150 #define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p')
151 typedef struct _HII_FONT_PACKAGE_INSTANCE
{
153 EFI_HII_FONT_PACKAGE_HDR
*FontPkgHdr
;
157 LIST_ENTRY FontEntry
;
158 LIST_ENTRY GlyphInfoList
;
159 } HII_FONT_PACKAGE_INSTANCE
;
161 #define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s')
162 typedef struct _HII_GLYPH_INFO
{
166 EFI_HII_GLYPH_INFO Cell
;
169 #define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i')
170 typedef struct _HII_FONT_INFO
{
173 LIST_ENTRY
*GlobalEntry
;
177 #define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i')
178 typedef struct _HII_GLOBAL_FONT_INFO
{
181 HII_FONT_PACKAGE_INSTANCE
*FontPackage
;
183 EFI_FONT_INFO
*FontInfo
;
184 } HII_GLOBAL_FONT_INFO
;
187 // Image Package definitions
190 #define HII_PIXEL_MASK 0x80
192 typedef struct _HII_IMAGE_PACKAGE_INSTANCE
{
193 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr
;
194 UINT32 ImageBlockSize
;
195 UINT32 PaletteInfoSize
;
198 } HII_IMAGE_PACKAGE_INSTANCE
;
201 // Keyboard Layout Pacakge definitions
203 #define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')
204 typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
{
207 LIST_ENTRY KeyboardEntry
;
208 } HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE
;
211 // Guid Package definitions
213 #define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p')
214 typedef struct _HII_GUID_PACKAGE_INSTANCE
{
217 LIST_ENTRY GuidEntry
;
218 } HII_GUID_PACKAGE_INSTANCE
;
221 // A package list can contain only one or less than one device path package.
222 // This rule also applies to image package since ImageId can not be duplicate.
224 typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE
{
225 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr
;
226 LIST_ENTRY GuidPkgHdr
;
227 LIST_ENTRY FormPkgHdr
;
228 LIST_ENTRY KeyboardLayoutHdr
;
229 LIST_ENTRY StringPkgHdr
;
230 LIST_ENTRY FontPkgHdr
;
231 HII_IMAGE_PACKAGE_INSTANCE
*ImagePkg
;
232 LIST_ENTRY SimpleFontPkgHdr
;
233 UINT8
*DevicePathPkg
;
234 } HII_DATABASE_PACKAGE_LIST_INSTANCE
;
236 #define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l')
244 #define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r')
246 typedef struct _HII_DATABASE_RECORD
{
248 HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
;
249 EFI_HANDLE DriverHandle
;
250 EFI_HII_HANDLE Handle
;
251 LIST_ENTRY DatabaseEntry
;
252 } HII_DATABASE_RECORD
;
254 #define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n')
256 typedef struct _HII_DATABASE_NOTIFY
{
258 EFI_HANDLE NotifyHandle
;
260 EFI_GUID
*PackageGuid
;
261 EFI_HII_DATABASE_NOTIFY PackageNotifyFn
;
262 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
;
263 LIST_ENTRY DatabaseNotifyEntry
;
264 } HII_DATABASE_NOTIFY
;
266 #define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')
268 typedef struct _HII_DATABASE_PRIVATE_DATA
{
270 LIST_ENTRY DatabaseList
;
271 LIST_ENTRY DatabaseNotifyList
;
272 EFI_HII_FONT_PROTOCOL HiiFont
;
273 EFI_HII_IMAGE_PROTOCOL HiiImage
;
274 EFI_HII_STRING_PROTOCOL HiiString
;
275 EFI_HII_DATABASE_PROTOCOL HiiDatabase
;
276 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting
;
277 LIST_ENTRY HiiHandleList
;
279 LIST_ENTRY FontInfoList
; // global font info list
280 UINTN Attribute
; // default system color
281 EFI_GUID CurrentLayoutGuid
;
282 EFI_HII_KEYBOARD_LAYOUT
*CurrentLayout
;
283 } HII_DATABASE_PRIVATE_DATA
;
285 #define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
287 HII_DATABASE_PRIVATE_DATA, \
289 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
292 #define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
294 HII_DATABASE_PRIVATE_DATA, \
296 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
299 #define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
301 HII_DATABASE_PRIVATE_DATA, \
303 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
306 #define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
308 HII_DATABASE_PRIVATE_DATA, \
310 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
313 #define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
315 HII_DATABASE_PRIVATE_DATA, \
317 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
321 // Internal function prototypes.
325 This function checks whether a handle is a valid EFI_HII_HANDLE.
327 @param Handle Pointer to a EFI_HII_HANDLE
330 @retval FALSE Invalid
335 EFI_HII_HANDLE Handle
340 This function checks whether EFI_FONT_INFO exists in current database. If
341 FontInfoMask is specified, check what options can be used to make a match.
342 Note that the masks relate to where the system default should be supplied
343 are ignored by this function.
345 @param Private Hii database private structure.
346 @param FontInfo Points to EFI_FONT_INFO structure.
347 @param FontInfoMask If not NULL, describes what options can be used
348 to make a match between the font requested and
349 the font available. The caller must guarantee
351 @param FontHandle On entry, Points to the font handle returned by a
352 previous call to GetFontInfo() or NULL to start
354 @param GlobalFontInfo If not NULL, output the corresponding globa font
358 @retval FALSE Not existed
363 IN HII_DATABASE_PRIVATE_DATA
*Private
,
364 IN EFI_FONT_INFO
*FontInfo
,
365 IN EFI_FONT_INFO_MASK
*FontInfoMask
, OPTIONAL
366 IN EFI_FONT_HANDLE FontHandle
, OPTIONAL
367 OUT HII_GLOBAL_FONT_INFO
**GlobalFontInfo OPTIONAL
372 This function invokes the matching registered function.
374 @param Private HII Database driver private structure.
375 @param NotifyType The type of change concerning the database.
376 @param PackageInstance Points to the package referred to by the notification.
377 @param PackageType Package type
378 @param Handle The handle of the package list which contains the specified package.
380 @retval EFI_SUCCESS Already checked all registered function and invoked
382 @retval EFI_INVALID_PARAMETER Any input parameter is not valid.
386 InvokeRegisteredFunction (
387 IN HII_DATABASE_PRIVATE_DATA
*Private
,
388 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
389 IN VOID
*PackageInstance
,
390 IN UINT8 PackageType
,
391 IN EFI_HII_HANDLE Handle
396 Retrieve system default font and color.
398 @param Private HII database driver private data.
399 @param FontInfo Points to system default font output-related
400 information. It's caller's responsibility to free
402 @param FontInfoSize If not NULL, output the size of buffer FontInfo.
404 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.
405 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
407 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
412 IN HII_DATABASE_PRIVATE_DATA
*Private
,
413 OUT EFI_FONT_DISPLAY_INFO
**FontInfo
,
414 OUT UINTN
*FontInfoSize OPTIONAL
419 Parse all string blocks to find a String block specified by StringId.
420 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks
421 within this string package and backup its information. If LastStringId is
422 specified, the string id of last string block will also be output.
423 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).
425 @param Private Hii database private structure.
426 @param StringPackage Hii string package instance.
427 @param StringId The string's id, which is unique within
429 @param BlockType Output the block type of found string block.
430 @param StringBlockAddr Output the block address of found string block.
431 @param StringTextOffset Offset, relative to the found block address, of
432 the string text information.
433 @param LastStringId Output the last string id when StringId = 0 or StringId = -1.
434 @param StartStringId The first id in the skip block which StringId in the block.
436 @retval EFI_SUCCESS The string text and font is retrieved
438 @retval EFI_NOT_FOUND The specified text or font info can not be found
440 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
446 IN HII_DATABASE_PRIVATE_DATA
*Private
,
447 IN HII_STRING_PACKAGE_INSTANCE
*StringPackage
,
448 IN EFI_STRING_ID StringId
,
449 OUT UINT8
*BlockType
, OPTIONAL
450 OUT UINT8
**StringBlockAddr
, OPTIONAL
451 OUT UINTN
*StringTextOffset
, OPTIONAL
452 OUT EFI_STRING_ID
*LastStringId
, OPTIONAL
453 OUT EFI_STRING_ID
*StartStringId OPTIONAL
458 Parse all glyph blocks to find a glyph block specified by CharValue.
459 If CharValue = (CHAR16) (-1), collect all default character cell information
460 within this font package and backup its information.
462 @param FontPackage Hii string package instance.
463 @param CharValue Unicode character value, which identifies a glyph
465 @param GlyphBuffer Output the corresponding bitmap data of the found
466 block. It is the caller's responsiblity to free
468 @param Cell Output cell information of the encoded bitmap.
469 @param GlyphBufferLen If not NULL, output the length of GlyphBuffer.
471 @retval EFI_SUCCESS The bitmap data is retrieved successfully.
472 @retval EFI_NOT_FOUND The specified CharValue does not exist in current
474 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
480 IN HII_FONT_PACKAGE_INSTANCE
*FontPackage
,
482 OUT UINT8
**GlyphBuffer
, OPTIONAL
483 OUT EFI_HII_GLYPH_INFO
*Cell
, OPTIONAL
484 OUT UINTN
*GlyphBufferLen OPTIONAL
488 This function exports Form packages to a buffer.
489 This is a internal function.
491 @param Private Hii database private structure.
492 @param Handle Identification of a package list.
493 @param PackageList Pointer to a package list which will be exported.
494 @param UsedSize The length of buffer be used.
495 @param BufferSize Length of the Buffer.
496 @param Buffer Allocated space for storing exported data.
497 @param ResultSize The size of the already exported content of this
500 @retval EFI_SUCCESS Form Packages are exported successfully.
501 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
506 IN HII_DATABASE_PRIVATE_DATA
*Private
,
507 IN EFI_HII_HANDLE Handle
,
508 IN HII_DATABASE_PACKAGE_LIST_INSTANCE
*PackageList
,
512 IN OUT UINTN
*ResultSize
516 // EFI_HII_FONT_PROTOCOL protocol interfaces
521 Renders a string to a bitmap or to the display.
523 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
524 @param Flags Describes how the string is to be drawn.
525 @param String Points to the null-terminated string to be
527 @param StringInfo Points to the string output information,
528 including the color and font. If NULL, then the
529 string will be output in the default system font
531 @param Blt If this points to a non-NULL on entry, this
532 points to the image, which is Width pixels wide
533 and Height pixels high. The string will be drawn
535 EFI_HII_OUT_FLAG_CLIP is implied. If this points
536 to a NULL on entry, then a buffer
537 will be allocated to hold the generated image and
538 the pointer updated on exit. It is the caller's
539 responsibility to free this buffer.
540 @param BltX Together with BltX, Specifies the offset from the left and top edge
541 of the image of the first character cell in the
543 @param BltY Together with BltY, Specifies the offset from the left and top edge
544 of the image of the first character cell in the
546 @param RowInfoArray If this is non-NULL on entry, then on exit, this
547 will point to an allocated buffer containing
548 row information and RowInfoArraySize will be
549 updated to contain the number of elements.
550 This array describes the characters which were at
551 least partially drawn and the heights of the
552 rows. It is the caller's responsibility to free
554 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
555 contains the number of elements in RowInfoArray.
556 @param ColumnInfoArray If this is non-NULL, then on return it will be
557 filled with the horizontal offset for each
558 character in the string on the row where it is
559 displayed. Non-printing characters will have
560 the offset ~0. The caller is responsible to
561 allocate a buffer large enough so that there
562 is one entry for each character in the string,
563 not including the null-terminator. It is possible
564 when character display is normalized that some
565 character cells overlap.
567 @retval EFI_SUCCESS The string was successfully rendered.
568 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
570 @retval EFI_INVALID_PARAMETER The String or Blt.
571 @retval EFI_INVALID_PARAMETER Flags were invalid combination..
577 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
578 IN EFI_HII_OUT_FLAGS Flags
,
579 IN CONST EFI_STRING String
,
580 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
581 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
584 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
585 OUT UINTN
*RowInfoArraySize OPTIONAL
,
586 OUT UINTN
*ColumnInfoArray OPTIONAL
591 Render a string to a bitmap or the screen containing the contents of the specified string.
593 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
594 @param Flags Describes how the string is to be drawn.
595 @param PackageList The package list in the HII database to search
596 for the specified string.
597 @param StringId The string's id, which is unique within
599 @param Language Points to the language for the retrieved string.
600 If NULL, then the current system language is
602 @param StringInfo Points to the string output information,
603 including the color and font. If NULL, then the
604 string will be output in the default system font
606 @param Blt If this points to a non-NULL on entry, this
607 points to the image, which is Width pixels wide
608 and Height pixels high. The string will be drawn
610 EFI_HII_OUT_FLAG_CLIP is implied. If this points
611 to a NULL on entry, then a buffer
612 will be allocated to hold the generated image and
613 the pointer updated on exit. It is the caller's
614 responsibility to free this buffer.
615 @param BltX Together with BltX, Specifies the offset from the left and top edge
616 of the image of the first character cell in the
618 @param BltY Together with BltY, Specifies the offset from the left and top edge
619 of the image of the first character cell in the
621 @param RowInfoArray If this is non-NULL on entry, then on exit, this
622 will point to an allocated buffer containing
623 row information and RowInfoArraySize will be
624 updated to contain the number of elements.
625 This array describes the characters which were at
626 least partially drawn and the heights of the
627 rows. It is the caller's responsibility to free
629 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
630 contains the number of elements in RowInfoArray.
631 @param ColumnInfoArray If this is non-NULL, then on return it will be
632 filled with the horizontal offset for each
633 character in the string on the row where it is
634 displayed. Non-printing characters will have
635 the offset ~0. The caller is responsible to
636 allocate a buffer large enough so that there
637 is one entry for each character in the string,
638 not including the null-terminator. It is possible
639 when character display is normalized that some
640 character cells overlap.
642 @retval EFI_SUCCESS The string was successfully rendered.
643 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
645 @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.
646 @retval EFI_INVALID_PARAMETER Flags were invalid combination.
647 @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not
648 in the specified PackageList.
654 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
655 IN EFI_HII_OUT_FLAGS Flags
,
656 IN EFI_HII_HANDLE PackageList
,
657 IN EFI_STRING_ID StringId
,
658 IN CONST CHAR8
* Language
,
659 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo OPTIONAL
,
660 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
663 OUT EFI_HII_ROW_INFO
**RowInfoArray OPTIONAL
,
664 OUT UINTN
*RowInfoArraySize OPTIONAL
,
665 OUT UINTN
*ColumnInfoArray OPTIONAL
670 Convert the glyph for a single character into a bitmap.
672 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
673 @param Char Character to retrieve.
674 @param StringInfo Points to the string font and color information
675 or NULL if the string should use the default
676 system font and color.
677 @param Blt Thus must point to a NULL on entry. A buffer will
678 be allocated to hold the output and the pointer
679 updated on exit. It is the caller's
680 responsibility to free this buffer.
681 @param Baseline Number of pixels from the bottom of the bitmap to
684 @retval EFI_SUCCESS Glyph bitmap created.
685 @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.
686 @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was replaced with the
687 glyph for Unicode character 0xFFFD.
688 @retval EFI_INVALID_PARAMETER Blt is NULL or *Blt is not NULL.
694 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
696 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfo
,
697 OUT EFI_IMAGE_OUTPUT
**Blt
,
698 OUT UINTN
*Baseline OPTIONAL
703 This function iterates through fonts which match the specified font, using
704 the specified criteria. If String is non-NULL, then all of the characters in
705 the string must exist in order for a candidate font to be returned.
707 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
708 @param FontHandle On entry, points to the font handle returned by a
709 previous call to GetFontInfo() or NULL to start
710 with the first font. On return, points to the
711 returned font handle or points to NULL if there
712 are no more matching fonts.
713 @param StringInfoIn Upon entry, points to the font to return
714 information about. If NULL, then the information about the system default
715 font will be returned.
716 @param StringInfoOut Upon return, contains the matching font's
717 information. If NULL, then no information is
718 returned. It's caller's responsibility to free
720 @param String Points to the string which will be tested to
721 determine if all characters are available. If
722 NULL, then any font is acceptable.
724 @retval EFI_SUCCESS Matching font returned successfully.
725 @retval EFI_NOT_FOUND No matching font was found.
726 @retval EFI_INVALID_PARAMETER StringInfoIn is NULL.
727 @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.
728 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
734 IN CONST EFI_HII_FONT_PROTOCOL
*This
,
735 IN OUT EFI_FONT_HANDLE
*FontHandle
,
736 IN CONST EFI_FONT_DISPLAY_INFO
*StringInfoIn
, OPTIONAL
737 OUT EFI_FONT_DISPLAY_INFO
**StringInfoOut
,
738 IN CONST EFI_STRING String OPTIONAL
742 // EFI_HII_IMAGE_PROTOCOL interfaces
747 This function adds the image Image to the group of images owned by PackageList, and returns
748 a new image identifier (ImageId).
750 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
751 @param PackageList Handle of the package list where this image will
753 @param ImageId On return, contains the new image id, which is
754 unique within PackageList.
755 @param Image Points to the image.
757 @retval EFI_SUCCESS The new image was added successfully.
758 @retval EFI_NOT_FOUND The specified PackageList could not be found in
760 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.
761 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.
767 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
768 IN EFI_HII_HANDLE PackageList
,
769 OUT EFI_IMAGE_ID
*ImageId
,
770 IN CONST EFI_IMAGE_INPUT
*Image
775 This function retrieves the image specified by ImageId which is associated with
776 the specified PackageList and copies it into the buffer specified by Image.
778 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
779 @param PackageList Handle of the package list where this image will
781 @param ImageId The image's id,, which is unique within
783 @param Image Points to the image.
785 @retval EFI_SUCCESS The new image was returned successfully.
786 @retval EFI_NOT_FOUND The image specified by ImageId is not available.
787 The specified PackageList is not in the database.
788 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
790 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.
791 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
798 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
799 IN EFI_HII_HANDLE PackageList
,
800 IN EFI_IMAGE_ID ImageId
,
801 OUT EFI_IMAGE_INPUT
*Image
806 This function updates the image specified by ImageId in the specified PackageListHandle to
807 the image specified by Image.
809 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
810 @param PackageList The package list containing the images.
811 @param ImageId The image's id,, which is unique within
813 @param Image Points to the image.
815 @retval EFI_SUCCESS The new image was updated successfully.
816 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
817 database. The specified PackageList is not in the database.
818 @retval EFI_INVALID_PARAMETER The Image was NULL.
824 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
825 IN EFI_HII_HANDLE PackageList
,
826 IN EFI_IMAGE_ID ImageId
,
827 IN CONST EFI_IMAGE_INPUT
*Image
832 This function renders an image to a bitmap or the screen using the specified
833 color and options. It draws the image on an existing bitmap, allocates a new
834 bitmap or uses the screen. The images can be clipped.
836 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
837 @param Flags Describes how the image is to be drawn.
838 @param Image Points to the image to be displayed.
839 @param Blt If this points to a non-NULL on entry, this
840 points to the image, which is Width pixels wide
841 and Height pixels high. The image will be drawn
842 onto this image and EFI_HII_DRAW_FLAG_CLIP is
843 implied. If this points to a NULL on entry, then
844 a buffer will be allocated to hold the generated
845 image and the pointer updated on exit. It is the
846 caller's responsibility to free this buffer.
847 @param BltX Specifies the offset from the left and top edge
848 of the output image of the first pixel in the
850 @param BltY Specifies the offset from the left and top edge
851 of the output image of the first pixel in the
854 @retval EFI_SUCCESS The image was successfully drawn.
855 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
856 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.
857 @retval EFI_INVALID_PARAMETER Any combination of Flags is invalid.
863 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
864 IN EFI_HII_DRAW_FLAGS Flags
,
865 IN CONST EFI_IMAGE_INPUT
*Image
,
866 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
873 This function renders an image to a bitmap or the screen using the specified
874 color and options. It draws the image on an existing bitmap, allocates a new
875 bitmap or uses the screen. The images can be clipped.
877 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
878 @param Flags Describes how the image is to be drawn.
879 @param PackageList The package list in the HII database to search
880 for the specified image.
881 @param ImageId The image's id, which is unique within
883 @param Blt If this points to a non-NULL on entry, this
884 points to the image, which is Width pixels wide
885 and Height pixels high. The image will be drawn
887 EFI_HII_DRAW_FLAG_CLIP is implied. If this points
888 to a NULL on entry, then a buffer will be
889 allocated to hold the generated image and the
890 pointer updated on exit. It is the caller's
891 responsibility to free this buffer.
892 @param BltX Specifies the offset from the left and top edge
893 of the output image of the first pixel in the
895 @param BltY Specifies the offset from the left and top edge
896 of the output image of the first pixel in the
899 @retval EFI_SUCCESS The image was successfully drawn.
900 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
901 @retval EFI_INVALID_PARAMETER The Blt was NULL.
902 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
903 The specified PackageList is not in the database.
909 IN CONST EFI_HII_IMAGE_PROTOCOL
*This
,
910 IN EFI_HII_DRAW_FLAGS Flags
,
911 IN EFI_HII_HANDLE PackageList
,
912 IN EFI_IMAGE_ID ImageId
,
913 IN OUT EFI_IMAGE_OUTPUT
**Blt
,
921 // EFI_HII_STRING_PROTOCOL
926 This function adds the string String to the group of strings owned by PackageList, with the
927 specified font information StringFontInfo and returns a new string id.
929 @param This A pointer to the EFI_HII_STRING_PROTOCOL
931 @param PackageList Handle of the package list where this string will
933 @param StringId On return, contains the new strings id, which is
934 unique within PackageList.
935 @param Language Points to the language for the new string.
936 @param LanguageName Points to the printable language name to
937 associate with the passed in Language field.If
938 LanguageName is not NULL and the string package
939 header's LanguageName associated with a given
940 Language is not zero, the LanguageName being
941 passed in will be ignored.
942 @param String Points to the new null-terminated string.
943 @param StringFontInfo Points to the new string's font information or
944 NULL if the string should have the default system
945 font, size and style.
947 @retval EFI_SUCCESS The new string was added successfully.
948 @retval EFI_NOT_FOUND The specified PackageList could not be found in
950 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of
952 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL or Language is
959 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
960 IN EFI_HII_HANDLE PackageList
,
961 OUT EFI_STRING_ID
*StringId
,
962 IN CONST CHAR8
*Language
,
963 IN CONST CHAR16
*LanguageName
, OPTIONAL
964 IN CONST EFI_STRING String
,
965 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
970 This function retrieves the string specified by StringId which is associated
971 with the specified PackageList in the language Language and copies it into
972 the buffer specified by String.
974 @param This A pointer to the EFI_HII_STRING_PROTOCOL
976 @param Language Points to the language for the retrieved string.
977 @param PackageList The package list in the HII database to search
978 for the specified string.
979 @param StringId The string's id, which is unique within
981 @param String Points to the new null-terminated string.
982 @param StringSize On entry, points to the size of the buffer
983 pointed to by String, in bytes. On return,
984 points to the length of the string, in bytes.
985 @param StringFontInfo If not NULL, points to the string's font
986 information. It's caller's responsibility to
989 @retval EFI_SUCCESS The string was returned successfully.
990 @retval EFI_NOT_FOUND The string specified by StringId is not
992 @retval EFI_NOT_FOUND The string specified by StringId is available but
993 not in the specified language.
994 The specified PackageList is not in the database.
995 @retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but
996 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small
998 @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL.
999 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
1006 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1007 IN CONST CHAR8
*Language
,
1008 IN EFI_HII_HANDLE PackageList
,
1009 IN EFI_STRING_ID StringId
,
1010 OUT EFI_STRING String
,
1011 IN OUT UINTN
*StringSize
,
1012 OUT EFI_FONT_INFO
**StringFontInfo OPTIONAL
1017 This function updates the string specified by StringId in the specified PackageList to the text
1018 specified by String and, optionally, the font information specified by StringFontInfo.
1020 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1022 @param PackageList The package list containing the strings.
1023 @param StringId The string's id, which is unique within
1025 @param Language Points to the language for the updated string.
1026 @param String Points to the new null-terminated string.
1027 @param StringFontInfo Points to the string's font information or NULL
1028 if the string font information is not changed.
1030 @retval EFI_SUCCESS The string was updated successfully.
1031 @retval EFI_NOT_FOUND The string specified by StringId is not in the
1033 @retval EFI_INVALID_PARAMETER The String or Language was NULL.
1034 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
1041 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1042 IN EFI_HII_HANDLE PackageList
,
1043 IN EFI_STRING_ID StringId
,
1044 IN CONST CHAR8
*Language
,
1045 IN CONST EFI_STRING String
,
1046 IN CONST EFI_FONT_INFO
*StringFontInfo OPTIONAL
1051 This function returns the list of supported languages, in the format specified
1052 in Appendix M of UEFI 2.1 spec.
1054 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1056 @param PackageList The package list to examine.
1057 @param Languages Points to the buffer to hold the returned
1058 null-terminated ASCII string.
1059 @param LanguagesSize On entry, points to the size of the buffer
1060 pointed to by Languages, in bytes. On return,
1061 points to the length of Languages, in bytes.
1063 @retval EFI_SUCCESS The languages were returned successfully.
1064 @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.
1065 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list
1066 of supported languages. LanguageSize is updated
1067 to contain the required size.
1068 @retval EFI_NOT_FOUND Could not find string package in specified
1075 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1076 IN EFI_HII_HANDLE PackageList
,
1077 IN OUT CHAR8
*Languages
,
1078 IN OUT UINTN
*LanguagesSize
1083 Each string package has associated with it a single primary language and zero
1084 or more secondary languages. This routine returns the secondary languages
1085 associated with a package list.
1087 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1089 @param PackageList The package list to examine.
1090 @param PrimaryLanguage Points to the null-terminated ASCII string that specifies
1091 the primary language. Languages are specified in the
1092 format specified in Appendix M of the UEFI 2.0 specification.
1093 @param SecondaryLanguages Points to the buffer to hold the returned null-terminated
1094 ASCII string that describes the list of
1095 secondary languages for the specified
1096 PrimaryLanguage. If there are no secondary
1097 languages, the function returns successfully,
1098 but this is set to NULL.
1099 @param SecondaryLanguagesSize On entry, points to the size of the buffer
1100 pointed to by SecondaryLanguages, in bytes. On
1101 return, points to the length of SecondaryLanguages
1104 @retval EFI_SUCCESS Secondary languages were correctly returned.
1105 @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguages or
1106 SecondaryLanguagesSize was NULL.
1107 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is
1108 too small to hold the returned information.
1109 SecondaryLanguageSize is updated to hold the size of
1110 the buffer required.
1111 @retval EFI_INVALID_LANGUAGE The language specified by PrimaryLanguage is not
1112 present in the specified package list.
1113 @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
1118 HiiGetSecondaryLanguages (
1119 IN CONST EFI_HII_STRING_PROTOCOL
*This
,
1120 IN EFI_HII_HANDLE PackageList
,
1121 IN CONST CHAR8
*PrimaryLanguage
,
1122 IN OUT CHAR8
*SecondaryLanguages
,
1123 IN OUT UINTN
*SecondaryLanguagesSize
1127 // EFI_HII_DATABASE_PROTOCOL protocol interfaces
1132 This function adds the packages in the package list to the database and returns a handle. If there is a
1133 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will
1134 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.
1136 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1138 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1140 @param DriverHandle Associate the package list with this EFI handle.
1141 If a NULL is specified, this data will not be associate
1142 with any drivers and cannot have a callback induced.
1143 @param Handle A pointer to the EFI_HII_HANDLE instance.
1145 @retval EFI_SUCCESS The package list associated with the Handle was
1146 added to the HII database.
1147 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the
1148 new database contents.
1149 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.
1155 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1156 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
,
1157 IN CONST EFI_HANDLE DriverHandle
, OPTIONAL
1158 OUT EFI_HII_HANDLE
*Handle
1163 This function removes the package list that is associated with a handle Handle
1164 from the HII database. Before removing the package, any registered functions
1165 with the notification type REMOVE_PACK and the same package type will be called.
1167 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1169 @param Handle The handle that was registered to the data that
1170 is requested for removal.
1172 @retval EFI_SUCCESS The data associated with the Handle was removed
1173 from the HII database.
1174 @retval EFI_NOT_FOUND The specified Handle is not in database.
1179 HiiRemovePackageList (
1180 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1181 IN EFI_HII_HANDLE Handle
1186 This function updates the existing package list (which has the specified Handle)
1187 in the HII databases, using the new package list specified by PackageList.
1189 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1191 @param Handle The handle that was registered to the data that
1192 is requested to be updated.
1193 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1196 @retval EFI_SUCCESS The HII database was successfully updated.
1197 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated
1199 @retval EFI_INVALID_PARAMETER PackageList was NULL.
1200 @retval EFI_NOT_FOUND The specified Handle is not in database.
1205 HiiUpdatePackageList (
1206 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1207 IN EFI_HII_HANDLE Handle
,
1208 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
1213 This function returns a list of the package handles of the specified type
1214 that are currently active in the database. The pseudo-type
1215 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.
1217 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1219 @param PackageType Specifies the package type of the packages to
1220 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1222 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1223 this is the pointer to the GUID which must match
1224 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.
1225 Otherwise, it must be NULL.
1226 @param HandleBufferLength On input, a pointer to the length of the handle
1227 buffer. On output, the length of the handle
1228 buffer that is required for the handles found.
1229 @param Handle An array of EFI_HII_HANDLE instances returned.
1231 @retval EFI_SUCCESS The matching handles are outputed successfully.
1232 HandleBufferLength is updated with the actual length.
1233 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1234 Handle is too small to support the number of
1235 handles. HandleBufferLength is updated with a
1236 value that will enable the data to fit.
1237 @retval EFI_NOT_FOUND No matching handle could not be found in
1239 @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.
1240 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
1241 PackageGuid is not NULL, PackageType is a EFI_HII_
1242 PACKAGE_TYPE_GUID but PackageGuid is NULL.
1248 HiiListPackageLists (
1249 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1250 IN UINT8 PackageType
,
1251 IN CONST EFI_GUID
*PackageGuid
,
1252 IN OUT UINTN
*HandleBufferLength
,
1253 OUT EFI_HII_HANDLE
*Handle
1258 This function will export one or all package lists in the database to a buffer.
1259 For each package list exported, this function will call functions registered
1260 with EXPORT_PACK and then copy the package list to the buffer.
1262 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1264 @param Handle An EFI_HII_HANDLE that corresponds to the desired
1265 package list in the HII database to export or
1266 NULL to indicate all package lists should be
1268 @param BufferSize On input, a pointer to the length of the buffer.
1269 On output, the length of the buffer that is
1270 required for the exported data.
1271 @param Buffer A pointer to a buffer that will contain the
1272 results of the export function.
1274 @retval EFI_SUCCESS Package exported.
1275 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1276 Handle is too small to support the number of
1277 handles. HandleBufferLength is updated with
1278 a value that will enable the data to fit.
1279 @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the
1281 @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.
1286 HiiExportPackageLists (
1287 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1288 IN EFI_HII_HANDLE Handle
,
1289 IN OUT UINTN
*BufferSize
,
1290 OUT EFI_HII_PACKAGE_LIST_HEADER
*Buffer
1295 This function registers a function which will be called when specified actions related to packages of
1296 the specified type occur in the HII database. By registering a function, other HII-related drivers are
1297 notified when specific package types are added, removed or updated in the HII database.
1298 Each driver or application which registers a notification should use
1299 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.
1301 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1303 @param PackageType Specifies the package type of the packages to
1304 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1306 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1307 this is the pointer to the GUID which must match
1309 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must
1311 @param PackageNotifyFn Points to the function to be called when the
1313 NotificationType occurs.
1314 @param NotifyType Describes the types of notification which this
1315 function will be receiving.
1316 @param NotifyHandle Points to the unique handle assigned to the
1317 registered notification. Can be used in
1318 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()
1319 to stop notifications.
1321 @retval EFI_SUCCESS Notification registered successfully.
1322 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures
1323 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.
1324 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not
1325 EFI_HII_PACKAGE_TYPE_GUID.
1326 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is
1327 EFI_HII_PACKAGE_TYPE_GUID.
1332 HiiRegisterPackageNotify (
1333 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1334 IN UINT8 PackageType
,
1335 IN CONST EFI_GUID
*PackageGuid
,
1336 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn
,
1337 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
1338 OUT EFI_HANDLE
*NotifyHandle
1343 Removes the specified HII database package-related notification.
1345 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1347 @param NotificationHandle The handle of the notification function being
1350 @retval EFI_SUCCESS Notification is unregistered successfully.
1351 @retval EFI_NOT_FOUND The incoming notification handle does not exist
1352 in current hii database.
1357 HiiUnregisterPackageNotify (
1358 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1359 IN EFI_HANDLE NotificationHandle
1364 This routine retrieves an array of GUID values for each keyboard layout that
1365 was previously registered in the system.
1367 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1369 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard
1370 GUID buffer. On output, the length of the handle
1371 buffer that is required for the handles found.
1372 @param KeyGuidBuffer An array of keyboard layout GUID instances
1375 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.
1376 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates
1377 that KeyGuidBuffer is too small to support the
1378 number of GUIDs. KeyGuidBufferLength is
1379 updated with a value that will enable the data to
1381 @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was
1383 @retval EFI_NOT_FOUND There was no keyboard layout.
1388 HiiFindKeyboardLayouts (
1389 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1390 IN OUT UINT16
*KeyGuidBufferLength
,
1391 OUT EFI_GUID
*KeyGuidBuffer
1396 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys
1397 on a keyboard and the character(s) that are associated with a particular set of key strokes.
1399 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1401 @param KeyGuid A pointer to the unique ID associated with a
1402 given keyboard layout. If KeyGuid is NULL then
1403 the current layout will be retrieved.
1404 @param KeyboardLayoutLength On input, a pointer to the length of the
1405 KeyboardLayout buffer. On output, the length of
1406 the data placed into KeyboardLayout.
1407 @param KeyboardLayout A pointer to a buffer containing the retrieved
1410 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
1411 @retval EFI_NOT_FOUND The requested keyboard layout was not found.
1412 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was
1418 HiiGetKeyboardLayout (
1419 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1420 IN CONST EFI_GUID
*KeyGuid
,
1421 IN OUT UINT16
*KeyboardLayoutLength
,
1422 OUT EFI_HII_KEYBOARD_LAYOUT
*KeyboardLayout
1427 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine
1428 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
1429 group type. This is so that agents which are sensitive to the current keyboard layout being changed
1430 can be notified of this change.
1432 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1434 @param KeyGuid A pointer to the unique ID associated with a
1435 given keyboard layout.
1437 @retval EFI_SUCCESS The current keyboard layout was successfully set.
1438 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so
1440 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.
1445 HiiSetKeyboardLayout (
1446 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1447 IN CONST EFI_GUID
*KeyGuid
1452 Return the EFI handle associated with a package list.
1454 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1456 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired
1457 package list in the HIIdatabase.
1458 @param DriverHandle On return, contains the EFI_HANDLE which was
1459 registered with the package list in
1462 @retval EFI_SUCCESS The DriverHandle was returned successfully.
1463 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or
1464 DriverHandle was NULL.
1469 HiiGetPackageListHandle (
1470 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
1471 IN EFI_HII_HANDLE PackageListHandle
,
1472 OUT EFI_HANDLE
*DriverHandle
1476 // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces
1481 This function allows a caller to extract the current configuration
1482 for one or more named elements from one or more drivers.
1484 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1486 @param Request A null-terminated Unicode string in
1487 <MultiConfigRequest> format.
1488 @param Progress On return, points to a character in the Request
1489 string. Points to the string's null terminator if
1490 request was successful. Points to the most recent
1491 & before the first failing name / value pair (or
1492 the beginning of the string if the failure is in
1493 the first name / value pair) if the request was
1495 @param Results Null-terminated Unicode string in
1496 <MultiConfigAltResp> format which has all values
1497 filled in for the names in the Request string.
1498 String to be allocated by the called function.
1500 @retval EFI_SUCCESS The Results string is filled with the values
1501 corresponding to all requested names.
1502 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1503 results that must be stored awaiting possible
1505 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.
1506 Progress set to the "G" in "GUID" of the
1507 routing header that doesn't match. Note: There
1508 is no requirement that all routing data
1509 be validated before any configuration extraction.
1510 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request
1511 parameter would result in this type of error. The
1512 Progress parameter is set to NULL.
1513 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &
1514 before the error or the beginning of the string.
1515 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the
1521 HiiConfigRoutingExtractConfig (
1522 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1523 IN CONST EFI_STRING Request
,
1524 OUT EFI_STRING
*Progress
,
1525 OUT EFI_STRING
*Results
1530 This function allows the caller to request the current configuration for the
1531 entirety of the current HII database and returns the data in a null-terminated Unicode string.
1533 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1535 @param Results Null-terminated Unicode string in
1536 <MultiConfigAltResp> format which has all values
1537 filled in for the names in the Request string.
1538 String to be allocated by the called function.
1539 De-allocation is up to the caller.
1541 @retval EFI_SUCCESS The Results string is filled with the values
1542 corresponding to all requested names.
1543 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1544 results that must be stored awaiting possible
1546 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results
1547 parameter would result in this type of error.
1552 HiiConfigRoutingExportConfig (
1553 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1554 OUT EFI_STRING
*Results
1559 This function processes the results of processing forms and routes it to the
1560 appropriate handlers or storage.
1562 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1564 @param Configuration A null-terminated Unicode string in
1565 <MulltiConfigResp> format.
1566 @param Progress A pointer to a string filled in with the offset
1567 of the most recent & before the first failing
1568 name / value pair (or the beginning of the string
1569 if the failure is in the first name / value pair)
1570 or the terminating NULL if all was successful.
1572 @retval EFI_SUCCESS The results have been distributed or are awaiting
1574 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1575 results that must be stored awaiting possible
1577 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter
1578 would result in this type of error.
1579 @retval EFI_NOT_FOUND Target for the specified routing data was not
1585 HiiConfigRoutingRouteConfig (
1586 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1587 IN CONST EFI_STRING Configuration
,
1588 OUT EFI_STRING
*Progress
1594 This helper function is to be called by drivers to map configuration data stored
1595 in byte array ("block") formats such as UEFI Variables into current configuration strings.
1597 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1599 @param ConfigRequest A null-terminated Unicode string in
1600 <ConfigRequest> format.
1601 @param Block Array of bytes defining the block's
1603 @param BlockSize Length in bytes of Block.
1604 @param Config Filled-in configuration string. String allocated
1605 by the function. Returned only if call is
1607 @param Progress A pointer to a string filled in with the offset
1608 of the most recent & before the first failing
1609 name/value pair (or the beginning of the string
1610 if the failure is in the first name / value pair)
1611 or the terminating NULL if all was successful.
1613 @retval EFI_SUCCESS The request succeeded. Progress points to the
1614 null terminator at the end of the ConfigRequest
1616 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1617 Progress points to the first character of
1619 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or
1620 Block parameter would result in this type of
1621 error. Progress points to the first character of
1623 @retval EFI_NOT_FOUND Target for the specified routing data was not
1624 found. Progress points to the "G" in "GUID" of
1625 the errant routing data.
1626 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.
1627 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.
1628 Block is left updated and Progress points at
1629 the '&' preceding the first non-<BlockName>.
1635 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1636 IN CONST EFI_STRING ConfigRequest
,
1637 IN CONST UINT8
*Block
,
1638 IN CONST UINTN BlockSize
,
1639 OUT EFI_STRING
*Config
,
1640 OUT EFI_STRING
*Progress
1645 This helper function is to be called by drivers to map configuration strings
1646 to configurations stored in byte array ("block") formats such as UEFI Variables.
1648 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1650 @param ConfigResp A null-terminated Unicode string in <ConfigResp>
1652 @param Block A possibly null array of bytes representing the
1653 current block. Only bytes referenced in the
1654 ConfigResp string in the block are modified. If
1655 this parameter is null or if the *BlockSize
1656 parameter is (on input) shorter than required by
1657 the Configuration string, only the BlockSize
1658 parameter is updated and an appropriate status
1659 (see below) is returned.
1660 @param BlockSize The length of the Block in units of UINT8. On
1661 input, this is the size of the Block. On output,
1662 if successful, contains the index of the last
1663 modified byte in the Block.
1664 @param Progress On return, points to an element of the ConfigResp
1665 string filled in with the offset of the most
1666 recent '&' before the first failing name / value
1667 pair (or the beginning of the string if the
1668 failure is in the first name / value pair) or
1669 the terminating NULL if all was successful.
1671 @retval EFI_SUCCESS The request succeeded. Progress points to the
1672 null terminator at the end of the ConfigResp
1674 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1675 Progress points to the first character of
1677 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or
1678 Block parameter would result in this type of
1679 error. Progress points to the first character of
1681 @retval EFI_NOT_FOUND Target for the specified routing data was not
1682 found. Progress points to the "G" in "GUID" of
1683 the errant routing data.
1684 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /
1685 value pair. Block is left updated and
1686 Progress points at the '&' preceding the first
1693 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1694 IN CONST EFI_STRING ConfigResp
,
1695 IN OUT UINT8
*Block
,
1696 IN OUT UINTN
*BlockSize
,
1697 OUT EFI_STRING
*Progress
1702 This helper function is to be called by drivers to extract portions of
1703 a larger configuration string.
1705 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1707 @param Configuration A null-terminated Unicode string in
1708 <MultiConfigAltResp> format.
1709 @param Guid A pointer to the GUID value to search for in the
1710 routing portion of the ConfigResp string when
1711 retrieving the requested data. If Guid is NULL,
1712 then all GUID values will be searched for.
1713 @param Name A pointer to the NAME value to search for in the
1714 routing portion of the ConfigResp string when
1715 retrieving the requested data. If Name is NULL,
1716 then all Name values will be searched for.
1717 @param DevicePath A pointer to the PATH value to search for in the
1718 routing portion of the ConfigResp string when
1719 retrieving the requested data. If DevicePath is
1720 NULL, then all DevicePath values will be
1722 @param AltCfgId A pointer to the ALTCFG value to search for in
1723 the routing portion of the ConfigResp string
1724 when retrieving the requested data. If this
1725 parameter is NULL, then the current setting will
1727 @param AltCfgResp A pointer to a buffer which will be allocated by
1728 the function which contains the retrieved string
1729 as requested. This buffer is only allocated if
1730 the call was successful.
1732 @retval EFI_SUCCESS The request succeeded. The requested data was
1733 extracted and placed in the newly allocated
1735 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.
1736 @retval EFI_INVALID_PARAMETER Any parameter is invalid.
1737 @retval EFI_NOT_FOUND Target for the specified routing data was not
1744 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL
*This
,
1745 IN CONST EFI_STRING Configuration
,
1746 IN CONST EFI_GUID
*Guid
,
1747 IN CONST EFI_STRING Name
,
1748 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1749 IN CONST UINT16
*AltCfgId
,
1750 OUT EFI_STRING
*AltCfgResp
1755 Compare whether two names of languages are identical.
1757 @param Language1 Name of language 1 from StringPackage
1758 @param Language2 Name of language 2 to be compared with language 1.
1761 @retval FALSE not same
1765 HiiCompareLanguage (
1766 IN CHAR8
*Language1
,
1774 extern EFI_EVENT gHiiKeyboardLayoutChanged
;