]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
1. Add address check for "RegisterForRuntime" APIs of PciLib, PciCf8Lib, PciExpressLi...
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / HiiDatabase.h
CommitLineData
ac644614 1/** @file\r
e90b081a 2Private structures definitions in HiiDatabase.\r
ac644614 3\r
9937b365 4Copyright (c) 2007 - 2009, Intel Corporation\r
ac644614 5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
ac644614 13**/\r
14\r
15#ifndef __HII_DATABASE_PRIVATE_H__\r
16#define __HII_DATABASE_PRIVATE_H__\r
17\r
60c93673 18#include <Uefi.h>\r
ac644614 19\r
ac644614 20#include <Protocol/DevicePath.h>\r
21#include <Protocol/HiiFont.h>\r
22#include <Protocol/HiiImage.h>\r
23#include <Protocol/HiiString.h>\r
24#include <Protocol/HiiDatabase.h>\r
25#include <Protocol/HiiConfigRouting.h>\r
26#include <Protocol/HiiConfigAccess.h>\r
27#include <Protocol/SimpleTextOut.h>\r
28\r
29#include <Guid/HiiKeyBoardLayout.h>\r
b9982883 30#include <Guid/GlobalVariable.h>\r
ac644614 31\r
32\r
33#include <Library/DebugLib.h>\r
34#include <Library/BaseMemoryLib.h>\r
35#include <Library/UefiDriverEntryPoint.h>\r
36#include <Library/UefiBootServicesTableLib.h>\r
37#include <Library/BaseLib.h>\r
38#include <Library/DevicePathLib.h>\r
39#include <Library/MemoryAllocationLib.h>\r
c27eb358 40#include <Library/UefiLib.h>\r
e94358a3 41#include <Library/PcdLib.h>\r
8db9d51d 42#include <Library/UefiRuntimeServicesTableLib.h>\r
63d55bb9 43#include <Library/PrintLib.h>\r
8db9d51d 44\r
ac644614 45\r
46#define HII_DATABASE_NOTIFY_GUID \\r
47 { \\r
48 0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \\r
49 }\r
50\r
51#define MAX_STRING_LENGTH 1024\r
52#define MAX_FONT_NAME_LEN 256\r
53#define NARROW_BASELINE 15\r
54#define WIDE_BASELINE 14\r
55#define SYS_FONT_INFO_MASK 0x37\r
56#define REPLACE_UNKNOWN_GLYPH 0xFFFD\r
57#define PROPORTIONAL_GLYPH 0x80\r
58#define NARROW_GLYPH 0x40\r
59\r
60#define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))\r
61#define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))\r
62#define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))\r
63#define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)\r
64\r
65//\r
66// Storage types\r
67//\r
68#define EFI_HII_VARSTORE_BUFFER 0\r
69#define EFI_HII_VARSTORE_NAME_VALUE 1\r
70#define EFI_HII_VARSTORE_EFI_VARIABLE 2\r
71\r
f3f2e05d 72#define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G')\r
ac644614 73typedef struct {\r
74 UINTN Signature;\r
75 LIST_ENTRY Entry;\r
76\r
77 EFI_HII_HANDLE HiiHandle;\r
78 EFI_HANDLE DriverHandle;\r
79\r
80 UINT8 Type; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE\r
81 EFI_GUID Guid;\r
82 CHAR16 *Name;\r
83 UINT16 Size;\r
84} HII_FORMSET_STORAGE;\r
85\r
86#define HII_FORMSET_STORAGE_FROM_LINK(a) CR (a, HII_FORMSET_STORAGE, Link, HII_FORMSET_STORAGE_SIGNATURE)\r
87\r
88\r
89//\r
90// String Package definitions\r
91//\r
f3f2e05d 92#define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p')\r
ac644614 93typedef struct _HII_STRING_PACKAGE_INSTANCE {\r
94 UINTN Signature;\r
95 EFI_HII_STRING_PACKAGE_HDR *StringPkgHdr;\r
96 UINT8 *StringBlock;\r
97 LIST_ENTRY StringEntry;\r
98 LIST_ENTRY FontInfoList; // local font info list\r
99 UINT8 FontId;\r
100} HII_STRING_PACKAGE_INSTANCE;\r
101\r
102//\r
103// Form Package definitions\r
104//\r
f3f2e05d 105#define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p')\r
ac644614 106typedef struct _HII_IFR_PACKAGE_INSTANCE {\r
107 UINTN Signature;\r
108 EFI_HII_PACKAGE_HEADER FormPkgHdr;\r
109 UINT8 *IfrData;\r
110 LIST_ENTRY IfrEntry;\r
111} HII_IFR_PACKAGE_INSTANCE;\r
112\r
113//\r
114// Simple Font Package definitions\r
115//\r
f3f2e05d 116#define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p')\r
ac644614 117typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE {\r
118 UINTN Signature;\r
119 EFI_HII_SIMPLE_FONT_PACKAGE_HDR *SimpleFontPkgHdr;\r
120 LIST_ENTRY SimpleFontEntry;\r
121} HII_SIMPLE_FONT_PACKAGE_INSTANCE;\r
122\r
123//\r
124// Font Package definitions\r
125//\r
f3f2e05d 126#define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p')\r
ac644614 127typedef struct _HII_FONT_PACKAGE_INSTANCE {\r
128 UINTN Signature;\r
129 EFI_HII_FONT_PACKAGE_HDR *FontPkgHdr;\r
130 UINT8 *GlyphBlock;\r
131 LIST_ENTRY FontEntry;\r
132 LIST_ENTRY GlyphInfoList;\r
133} HII_FONT_PACKAGE_INSTANCE;\r
134\r
f3f2e05d 135#define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s')\r
ac644614 136typedef struct _HII_GLYPH_INFO {\r
137 UINTN Signature;\r
138 LIST_ENTRY Entry;\r
139 CHAR16 CharId;\r
140 EFI_HII_GLYPH_INFO Cell;\r
141} HII_GLYPH_INFO;\r
142\r
f3f2e05d 143#define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i')\r
ac644614 144typedef struct _HII_FONT_INFO {\r
145 UINTN Signature;\r
146 LIST_ENTRY Entry;\r
147 LIST_ENTRY *GlobalEntry;\r
148 UINT8 FontId;\r
149} HII_FONT_INFO;\r
150\r
f3f2e05d 151#define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i')\r
ac644614 152typedef struct _HII_GLOBAL_FONT_INFO {\r
153 UINTN Signature;\r
154 LIST_ENTRY Entry;\r
155 HII_FONT_PACKAGE_INSTANCE *FontPackage;\r
156 UINTN FontInfoSize;\r
157 EFI_FONT_INFO *FontInfo;\r
158} HII_GLOBAL_FONT_INFO;\r
159\r
160//\r
161// Image Package definitions\r
162//\r
163\r
164#define HII_PIXEL_MASK 0x80\r
165\r
166typedef struct _HII_IMAGE_PACKAGE_INSTANCE {\r
167 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr;\r
168 UINT32 ImageBlockSize;\r
169 UINT32 PaletteInfoSize;\r
170 UINT8 *ImageBlock;\r
171 UINT8 *PaletteBlock;\r
172} HII_IMAGE_PACKAGE_INSTANCE;\r
173\r
174//\r
175// Keyboard Layout Pacakge definitions\r
176//\r
f3f2e05d 177#define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')\r
ac644614 178typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE {\r
179 UINTN Signature;\r
180 UINT8 *KeyboardPkg;\r
181 LIST_ENTRY KeyboardEntry;\r
182} HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE;\r
183\r
184//\r
185// Guid Package definitions\r
186//\r
f3f2e05d 187#define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p')\r
ac644614 188typedef struct _HII_GUID_PACKAGE_INSTANCE {\r
189 UINTN Signature;\r
190 UINT8 *GuidPkg;\r
191 LIST_ENTRY GuidEntry;\r
192} HII_GUID_PACKAGE_INSTANCE;\r
193\r
194//\r
195// A package list can contain only one or less than one device path package.\r
196// This rule also applies to image package since ImageId can not be duplicate.\r
197//\r
198typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE {\r
199 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr;\r
200 LIST_ENTRY GuidPkgHdr;\r
201 LIST_ENTRY FormPkgHdr;\r
202 LIST_ENTRY KeyboardLayoutHdr;\r
203 LIST_ENTRY StringPkgHdr;\r
204 LIST_ENTRY FontPkgHdr;\r
205 HII_IMAGE_PACKAGE_INSTANCE *ImagePkg;\r
206 LIST_ENTRY SimpleFontPkgHdr;\r
207 UINT8 *DevicePathPkg;\r
208} HII_DATABASE_PACKAGE_LIST_INSTANCE;\r
209\r
f3f2e05d 210#define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l')\r
ac644614 211\r
212typedef struct {\r
213 UINTN Signature;\r
214 LIST_ENTRY Handle;\r
215 UINTN Key;\r
216} HII_HANDLE;\r
217\r
f3f2e05d 218#define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r')\r
ac644614 219\r
220typedef struct _HII_DATABASE_RECORD {\r
221 UINTN Signature;\r
222 HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList;\r
223 EFI_HANDLE DriverHandle;\r
224 EFI_HII_HANDLE Handle;\r
225 LIST_ENTRY DatabaseEntry;\r
226} HII_DATABASE_RECORD;\r
227\r
f3f2e05d 228#define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n')\r
ac644614 229\r
230typedef struct _HII_DATABASE_NOTIFY {\r
231 UINTN Signature;\r
232 EFI_HANDLE NotifyHandle;\r
233 UINT8 PackageType;\r
234 EFI_GUID *PackageGuid;\r
235 EFI_HII_DATABASE_NOTIFY PackageNotifyFn;\r
236 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType;\r
237 LIST_ENTRY DatabaseNotifyEntry;\r
238} HII_DATABASE_NOTIFY;\r
239\r
f3f2e05d 240#define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')\r
ac644614 241\r
242typedef struct _HII_DATABASE_PRIVATE_DATA {\r
243 UINTN Signature;\r
244 LIST_ENTRY DatabaseList;\r
245 LIST_ENTRY DatabaseNotifyList;\r
246 EFI_HII_FONT_PROTOCOL HiiFont;\r
ac644614 247 EFI_HII_IMAGE_PROTOCOL HiiImage;\r
ac644614 248 EFI_HII_STRING_PROTOCOL HiiString;\r
249 EFI_HII_DATABASE_PROTOCOL HiiDatabase;\r
250 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting;\r
251 LIST_ENTRY HiiHandleList;\r
252 INTN HiiHandleCount;\r
253 LIST_ENTRY FontInfoList; // global font info list\r
254 UINTN Attribute; // default system color\r
255 EFI_GUID CurrentLayoutGuid;\r
256 EFI_HII_KEYBOARD_LAYOUT *CurrentLayout;\r
257} HII_DATABASE_PRIVATE_DATA;\r
258\r
259#define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
260 CR (a, \\r
261 HII_DATABASE_PRIVATE_DATA, \\r
262 HiiFont, \\r
263 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
264 )\r
265\r
266#define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
267 CR (a, \\r
268 HII_DATABASE_PRIVATE_DATA, \\r
269 HiiImage, \\r
270 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
271 )\r
272\r
273#define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
274 CR (a, \\r
275 HII_DATABASE_PRIVATE_DATA, \\r
276 HiiString, \\r
277 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
278 )\r
279\r
280#define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
281 CR (a, \\r
282 HII_DATABASE_PRIVATE_DATA, \\r
283 HiiDatabase, \\r
284 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
285 )\r
286\r
287#define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
288 CR (a, \\r
289 HII_DATABASE_PRIVATE_DATA, \\r
290 ConfigRouting, \\r
291 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
292 )\r
293\r
294//\r
295// Internal function prototypes.\r
296//\r
297\r
298/**\r
e90b081a 299 This function checks whether a handle is a valid EFI_HII_HANDLE.\r
ac644614 300\r
301 @param Handle Pointer to a EFI_HII_HANDLE\r
302\r
303 @retval TRUE Valid\r
304 @retval FALSE Invalid\r
305\r
306**/\r
307BOOLEAN\r
308IsHiiHandleValid (\r
309 EFI_HII_HANDLE Handle\r
ed66e1bc 310 );\r
ac644614 311\r
312\r
313/**\r
314 This function checks whether EFI_FONT_INFO exists in current database. If\r
315 FontInfoMask is specified, check what options can be used to make a match.\r
316 Note that the masks relate to where the system default should be supplied\r
317 are ignored by this function.\r
318\r
319 @param Private Hii database private structure.\r
320 @param FontInfo Points to EFI_FONT_INFO structure.\r
321 @param FontInfoMask If not NULL, describes what options can be used\r
322 to make a match between the font requested and\r
323 the font available. The caller must guarantee\r
324 this mask is valid.\r
325 @param FontHandle On entry, Points to the font handle returned by a\r
326 previous call to GetFontInfo() or NULL to start\r
327 with the first font.\r
328 @param GlobalFontInfo If not NULL, output the corresponding globa font\r
329 info.\r
330\r
331 @retval TRUE Existed\r
332 @retval FALSE Not existed\r
333\r
334**/\r
335BOOLEAN\r
336IsFontInfoExisted (\r
337 IN HII_DATABASE_PRIVATE_DATA *Private,\r
338 IN EFI_FONT_INFO *FontInfo,\r
339 IN EFI_FONT_INFO_MASK *FontInfoMask, OPTIONAL\r
340 IN EFI_FONT_HANDLE FontHandle, OPTIONAL\r
341 OUT HII_GLOBAL_FONT_INFO **GlobalFontInfo OPTIONAL\r
ed66e1bc 342 );\r
ac644614 343\r
8d00a0f1 344/**\r
345\r
346 This function invokes the matching registered function.\r
347 \r
348 @param Private HII Database driver private structure.\r
349 @param NotifyType The type of change concerning the database.\r
350 @param PackageInstance Points to the package referred to by the notification.\r
351 @param PackageType Package type\r
352 @param Handle The handle of the package list which contains the specified package.\r
353 \r
354 @retval EFI_SUCCESS Already checked all registered function and invoked \r
355 if matched.\r
356 @retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
357 \r
358**/\r
359EFI_STATUS\r
360InvokeRegisteredFunction (\r
361 IN HII_DATABASE_PRIVATE_DATA *Private, \r
362 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r
363 IN VOID *PackageInstance,\r
364 IN UINT8 PackageType,\r
365 IN EFI_HII_HANDLE Handle\r
366 )\r
367;\r
ac644614 368\r
369/**\r
370 Retrieve system default font and color.\r
371\r
372 @param Private HII database driver private data.\r
373 @param FontInfo Points to system default font output-related\r
374 information. It's caller's responsibility to free\r
375 this buffer.\r
376 @param FontInfoSize If not NULL, output the size of buffer FontInfo.\r
377\r
378 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.\r
379 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
380 task.\r
381 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
382\r
383**/\r
384EFI_STATUS\r
385GetSystemFont (\r
386 IN HII_DATABASE_PRIVATE_DATA *Private,\r
387 OUT EFI_FONT_DISPLAY_INFO **FontInfo,\r
388 OUT UINTN *FontInfoSize OPTIONAL\r
ed66e1bc 389 );\r
ac644614 390\r
391\r
392/**\r
393 Parse all string blocks to find a String block specified by StringId.\r
394 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks\r
395 within this string package and backup its information.\r
396 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END).\r
397\r
398 @param Private Hii database private structure.\r
399 @param StringPackage Hii string package instance.\r
400 @param StringId The string's id, which is unique within\r
401 PackageList.\r
402 @param BlockType Output the block type of found string block.\r
403 @param StringBlockAddr Output the block address of found string block.\r
404 @param StringTextOffset Offset, relative to the found block address, of\r
405 the string text information.\r
406 @param LastStringId Output the last string id when StringId = 0.\r
407\r
408 @retval EFI_SUCCESS The string text and font is retrieved\r
409 successfully.\r
410 @retval EFI_NOT_FOUND The specified text or font info can not be found\r
411 out.\r
412 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
413 task.\r
414\r
415**/\r
416EFI_STATUS\r
417FindStringBlock (\r
418 IN HII_DATABASE_PRIVATE_DATA *Private,\r
419 IN HII_STRING_PACKAGE_INSTANCE *StringPackage,\r
420 IN EFI_STRING_ID StringId,\r
421 OUT UINT8 *BlockType, OPTIONAL\r
422 OUT UINT8 **StringBlockAddr, OPTIONAL\r
423 OUT UINTN *StringTextOffset, OPTIONAL\r
424 OUT EFI_STRING_ID *LastStringId OPTIONAL\r
ed66e1bc 425 );\r
ac644614 426\r
427\r
428/**\r
429 Parse all glyph blocks to find a glyph block specified by CharValue.\r
430 If CharValue = (CHAR16) (-1), collect all default character cell information\r
431 within this font package and backup its information.\r
432\r
433 @param FontPackage Hii string package instance.\r
434 @param CharValue Unicode character value, which identifies a glyph\r
435 block.\r
436 @param GlyphBuffer Output the corresponding bitmap data of the found\r
437 block. It is the caller's responsiblity to free\r
438 this buffer.\r
439 @param Cell Output cell information of the encoded bitmap.\r
440 @param GlyphBufferLen If not NULL, output the length of GlyphBuffer.\r
441\r
442 @retval EFI_SUCCESS The bitmap data is retrieved successfully.\r
443 @retval EFI_NOT_FOUND The specified CharValue does not exist in current\r
444 database.\r
445 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
446 task.\r
447\r
448**/\r
449EFI_STATUS\r
450FindGlyphBlock (\r
451 IN HII_FONT_PACKAGE_INSTANCE *FontPackage,\r
452 IN CHAR16 CharValue,\r
453 OUT UINT8 **GlyphBuffer, OPTIONAL\r
454 OUT EFI_HII_GLYPH_INFO *Cell, OPTIONAL\r
455 OUT UINTN *GlyphBufferLen OPTIONAL\r
ed66e1bc 456 );\r
ac644614 457\r
458//\r
459// EFI_HII_FONT_PROTOCOL protocol interfaces\r
460//\r
461\r
462\r
463/**\r
464 Renders a string to a bitmap or to the display.\r
465\r
466 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
467 @param Flags Describes how the string is to be drawn.\r
468 @param String Points to the null-terminated string to be\r
469 displayed.\r
470 @param StringInfo Points to the string output information,\r
471 including the color and font. If NULL, then the\r
472 string will be output in the default system font\r
473 and color.\r
474 @param Blt If this points to a non-NULL on entry, this\r
475 points to the image, which is Width pixels wide\r
476 and Height pixels high. The string will be drawn\r
477 onto this image and\r
478 EFI_HII_OUT_FLAG_CLIP is implied. If this points\r
479 to a NULL on entry, then a buffer\r
480 will be allocated to hold the generated image and\r
481 the pointer updated on exit. It is the caller's\r
482 responsibility to free this buffer.\r
e90b081a 483 @param BltX Together with BltX, Specifies the offset from the left and top edge\r
484 of the image of the first character cell in the\r
485 image.\r
486 @param BltY Together with BltY, Specifies the offset from the left and top edge\r
ac644614 487 of the image of the first character cell in the\r
488 image.\r
489 @param RowInfoArray If this is non-NULL on entry, then on exit, this\r
490 will point to an allocated buffer containing\r
491 row information and RowInfoArraySize will be\r
492 updated to contain the number of elements.\r
493 This array describes the characters which were at\r
494 least partially drawn and the heights of the\r
495 rows. It is the caller's responsibility to free\r
496 this buffer.\r
497 @param RowInfoArraySize If this is non-NULL on entry, then on exit it\r
498 contains the number of elements in RowInfoArray.\r
499 @param ColumnInfoArray If this is non-NULL, then on return it will be\r
500 filled with the horizontal offset for each\r
501 character in the string on the row where it is\r
502 displayed. Non-printing characters will have\r
503 the offset ~0. The caller is responsible to\r
504 allocate a buffer large enough so that there\r
505 is one entry for each character in the string,\r
506 not including the null-terminator. It is possible\r
507 when character display is normalized that some\r
508 character cells overlap.\r
509\r
510 @retval EFI_SUCCESS The string was successfully rendered.\r
511 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for\r
512 RowInfoArray or Blt.\r
813acf3a 513 @retval EFI_INVALID_PARAMETER The String or Blt.\r
514 @retval EFI_INVALID_PARAMETER Flags were invalid combination..\r
ac644614 515\r
516**/\r
517EFI_STATUS\r
518EFIAPI\r
519HiiStringToImage (\r
520 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
521 IN EFI_HII_OUT_FLAGS Flags,\r
522 IN CONST EFI_STRING String,\r
523 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,\r
524 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
525 IN UINTN BltX,\r
526 IN UINTN BltY,\r
527 OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,\r
528 OUT UINTN *RowInfoArraySize OPTIONAL,\r
529 OUT UINTN *ColumnInfoArray OPTIONAL\r
ed66e1bc 530 );\r
ac644614 531\r
532\r
533/**\r
534 Render a string to a bitmap or the screen containing the contents of the specified string.\r
535\r
536 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
537 @param Flags Describes how the string is to be drawn.\r
538 @param PackageList The package list in the HII database to search\r
539 for the specified string.\r
540 @param StringId The string's id, which is unique within\r
541 PackageList.\r
542 @param Language Points to the language for the retrieved string.\r
543 If NULL, then the current system language is\r
544 used.\r
545 @param StringInfo Points to the string output information,\r
546 including the color and font. If NULL, then the\r
547 string will be output in the default system font\r
548 and color.\r
549 @param Blt If this points to a non-NULL on entry, this\r
550 points to the image, which is Width pixels wide\r
551 and Height pixels high. The string will be drawn\r
552 onto this image and\r
553 EFI_HII_OUT_FLAG_CLIP is implied. If this points\r
554 to a NULL on entry, then a buffer\r
555 will be allocated to hold the generated image and\r
556 the pointer updated on exit. It is the caller's\r
557 responsibility to free this buffer.\r
e90b081a 558 @param BltX Together with BltX, Specifies the offset from the left and top edge\r
559 of the image of the first character cell in the\r
560 image.\r
561 @param BltY Together with BltY, Specifies the offset from the left and top edge\r
ac644614 562 of the image of the first character cell in the\r
563 image.\r
564 @param RowInfoArray If this is non-NULL on entry, then on exit, this\r
565 will point to an allocated buffer containing\r
566 row information and RowInfoArraySize will be\r
567 updated to contain the number of elements.\r
568 This array describes the characters which were at\r
569 least partially drawn and the heights of the\r
570 rows. It is the caller's responsibility to free\r
571 this buffer.\r
572 @param RowInfoArraySize If this is non-NULL on entry, then on exit it\r
573 contains the number of elements in RowInfoArray.\r
574 @param ColumnInfoArray If this is non-NULL, then on return it will be\r
575 filled with the horizontal offset for each\r
576 character in the string on the row where it is\r
577 displayed. Non-printing characters will have\r
578 the offset ~0. The caller is responsible to\r
579 allocate a buffer large enough so that there\r
580 is one entry for each character in the string,\r
581 not including the null-terminator. It is possible\r
582 when character display is normalized that some\r
583 character cells overlap.\r
584\r
585 @retval EFI_SUCCESS The string was successfully rendered.\r
586 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for\r
587 RowInfoArray or Blt.\r
813acf3a 588 @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.\r
589 @retval EFI_INVALID_PARAMETER Flags were invalid combination.\r
590 @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not \r
591 in the specified PackageList. \r
ac644614 592\r
593**/\r
594EFI_STATUS\r
595EFIAPI\r
596HiiStringIdToImage (\r
597 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
598 IN EFI_HII_OUT_FLAGS Flags,\r
599 IN EFI_HII_HANDLE PackageList,\r
600 IN EFI_STRING_ID StringId,\r
601 IN CONST CHAR8* Language,\r
602 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,\r
603 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
604 IN UINTN BltX,\r
605 IN UINTN BltY,\r
606 OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,\r
607 OUT UINTN *RowInfoArraySize OPTIONAL,\r
608 OUT UINTN *ColumnInfoArray OPTIONAL\r
ed66e1bc 609 );\r
ac644614 610\r
611\r
612/**\r
613 Convert the glyph for a single character into a bitmap.\r
614\r
615 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
616 @param Char Character to retrieve.\r
617 @param StringInfo Points to the string font and color information\r
618 or NULL if the string should use the default\r
619 system font and color.\r
620 @param Blt Thus must point to a NULL on entry. A buffer will\r
621 be allocated to hold the output and the pointer\r
622 updated on exit. It is the caller's\r
623 responsibility to free this buffer.\r
624 @param Baseline Number of pixels from the bottom of the bitmap to\r
625 the baseline.\r
626\r
627 @retval EFI_SUCCESS Glyph bitmap created.\r
628 @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.\r
629 @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was replaced with the\r
630 glyph for Unicode character 0xFFFD.\r
631 @retval EFI_INVALID_PARAMETER Blt is NULL or *Blt is not NULL.\r
632\r
633**/\r
634EFI_STATUS\r
635EFIAPI\r
636HiiGetGlyph (\r
637 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
638 IN CHAR16 Char,\r
e90b081a 639 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,\r
ac644614 640 OUT EFI_IMAGE_OUTPUT **Blt,\r
641 OUT UINTN *Baseline OPTIONAL\r
ed66e1bc 642 );\r
ac644614 643\r
644\r
645/**\r
646 This function iterates through fonts which match the specified font, using\r
647 the specified criteria. If String is non-NULL, then all of the characters in\r
648 the string must exist in order for a candidate font to be returned.\r
649\r
650 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
651 @param FontHandle On entry, points to the font handle returned by a\r
652 previous call to GetFontInfo() or NULL to start\r
653 with the first font. On return, points to the\r
654 returned font handle or points to NULL if there\r
655 are no more matching fonts.\r
656 @param StringInfoIn Upon entry, points to the font to return\r
813acf3a 657 information about. If NULL, then the information about the system default \r
658 font will be returned.\r
ac644614 659 @param StringInfoOut Upon return, contains the matching font's\r
660 information. If NULL, then no information is\r
661 returned. It's caller's responsibility to free\r
662 this buffer.\r
663 @param String Points to the string which will be tested to\r
664 determine if all characters are available. If\r
665 NULL, then any font is acceptable.\r
666\r
667 @retval EFI_SUCCESS Matching font returned successfully.\r
668 @retval EFI_NOT_FOUND No matching font was found.\r
669 @retval EFI_INVALID_PARAMETER StringInfoIn is NULL.\r
813acf3a 670 @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.\r
ac644614 671 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the\r
672 request.\r
ac644614 673**/\r
674EFI_STATUS\r
675EFIAPI\r
676HiiGetFontInfo (\r
677 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
678 IN OUT EFI_FONT_HANDLE *FontHandle,\r
e90b081a 679 IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL\r
ac644614 680 OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,\r
681 IN CONST EFI_STRING String OPTIONAL\r
ed66e1bc 682 );\r
ac644614 683\r
684//\r
685// EFI_HII_IMAGE_PROTOCOL interfaces\r
686//\r
687\r
688\r
689/**\r
690 This function adds the image Image to the group of images owned by PackageList, and returns\r
691 a new image identifier (ImageId).\r
692\r
693 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
694 @param PackageList Handle of the package list where this image will\r
695 be added.\r
696 @param ImageId On return, contains the new image id, which is\r
697 unique within PackageList.\r
698 @param Image Points to the image.\r
699\r
700 @retval EFI_SUCCESS The new image was added successfully.\r
701 @retval EFI_NOT_FOUND The specified PackageList could not be found in\r
702 database.\r
703 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.\r
704 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.\r
705\r
706**/\r
707EFI_STATUS\r
708EFIAPI\r
709HiiNewImage (\r
710 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
711 IN EFI_HII_HANDLE PackageList,\r
712 OUT EFI_IMAGE_ID *ImageId,\r
713 IN CONST EFI_IMAGE_INPUT *Image\r
ed66e1bc 714 );\r
ac644614 715\r
716\r
717/**\r
718 This function retrieves the image specified by ImageId which is associated with\r
719 the specified PackageList and copies it into the buffer specified by Image.\r
720\r
721 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
722 @param PackageList Handle of the package list where this image will\r
723 be searched.\r
724 @param ImageId The image's id,, which is unique within\r
725 PackageList.\r
726 @param Image Points to the image.\r
ac644614 727\r
728 @retval EFI_SUCCESS The new image was returned successfully.\r
729 @retval EFI_NOT_FOUND The image specified by ImageId is not available.\r
813acf3a 730 The specified PackageList is not in the database.\r
ac644614 731 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to\r
732 hold the image.\r
733 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.\r
813acf3a 734 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not\r
735 enough memory.\r
ac644614 736\r
737**/\r
738EFI_STATUS\r
739EFIAPI\r
740HiiGetImage (\r
741 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
742 IN EFI_HII_HANDLE PackageList,\r
743 IN EFI_IMAGE_ID ImageId,\r
813acf3a 744 OUT EFI_IMAGE_INPUT *Image\r
ed66e1bc 745 );\r
ac644614 746\r
747\r
748/**\r
749 This function updates the image specified by ImageId in the specified PackageListHandle to\r
750 the image specified by Image.\r
751\r
752 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
753 @param PackageList The package list containing the images.\r
754 @param ImageId The image's id,, which is unique within\r
755 PackageList.\r
756 @param Image Points to the image.\r
757\r
758 @retval EFI_SUCCESS The new image was updated successfully.\r
759 @retval EFI_NOT_FOUND The image specified by ImageId is not in the\r
813acf3a 760 database. The specified PackageList is not in the database.\r
ac644614 761 @retval EFI_INVALID_PARAMETER The Image was NULL.\r
762\r
763**/\r
764EFI_STATUS\r
765EFIAPI\r
766HiiSetImage (\r
767 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
768 IN EFI_HII_HANDLE PackageList,\r
769 IN EFI_IMAGE_ID ImageId,\r
770 IN CONST EFI_IMAGE_INPUT *Image\r
ed66e1bc 771 );\r
ac644614 772\r
773\r
774/**\r
775 This function renders an image to a bitmap or the screen using the specified\r
776 color and options. It draws the image on an existing bitmap, allocates a new\r
777 bitmap or uses the screen. The images can be clipped.\r
778\r
779 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
780 @param Flags Describes how the image is to be drawn.\r
781 @param Image Points to the image to be displayed.\r
782 @param Blt If this points to a non-NULL on entry, this\r
783 points to the image, which is Width pixels wide\r
784 and Height pixels high. The image will be drawn\r
785 onto this image and EFI_HII_DRAW_FLAG_CLIP is\r
786 implied. If this points to a NULL on entry, then\r
787 a buffer will be allocated to hold the generated\r
788 image and the pointer updated on exit. It is the\r
789 caller's responsibility to free this buffer.\r
e90b081a 790 @param BltX Specifies the offset from the left and top edge\r
791 of the output image of the first pixel in the\r
792 image.\r
ac644614 793 @param BltY Specifies the offset from the left and top edge\r
794 of the output image of the first pixel in the\r
795 image.\r
796\r
797 @retval EFI_SUCCESS The image was successfully drawn.\r
798 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r
799 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.\r
800 @retval EFI_INVALID_PARAMETER Any combination of Flags is invalid.\r
801\r
802**/\r
803EFI_STATUS\r
804EFIAPI\r
805HiiDrawImage (\r
806 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
807 IN EFI_HII_DRAW_FLAGS Flags,\r
808 IN CONST EFI_IMAGE_INPUT *Image,\r
809 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
810 IN UINTN BltX,\r
811 IN UINTN BltY\r
ed66e1bc 812 );\r
ac644614 813\r
814\r
815/**\r
816 This function renders an image to a bitmap or the screen using the specified\r
817 color and options. It draws the image on an existing bitmap, allocates a new\r
818 bitmap or uses the screen. The images can be clipped.\r
819\r
820 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
821 @param Flags Describes how the image is to be drawn.\r
822 @param PackageList The package list in the HII database to search\r
823 for the specified image.\r
824 @param ImageId The image's id, which is unique within\r
825 PackageList.\r
826 @param Blt If this points to a non-NULL on entry, this\r
827 points to the image, which is Width pixels wide\r
828 and Height pixels high. The image will be drawn\r
829 onto this image and\r
830 EFI_HII_DRAW_FLAG_CLIP is implied. If this points\r
831 to a NULL on entry, then a buffer will be\r
832 allocated to hold the generated image and the\r
833 pointer updated on exit. It is the caller's\r
834 responsibility to free this buffer.\r
e90b081a 835 @param BltX Specifies the offset from the left and top edge\r
836 of the output image of the first pixel in the\r
837 image.\r
ac644614 838 @param BltY Specifies the offset from the left and top edge\r
839 of the output image of the first pixel in the\r
840 image.\r
841\r
842 @retval EFI_SUCCESS The image was successfully drawn.\r
843 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r
813acf3a 844 @retval EFI_INVALID_PARAMETER The Blt was NULL.\r
845 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database. \r
846 The specified PackageList is not in the database.\r
ac644614 847\r
848**/\r
849EFI_STATUS\r
850EFIAPI\r
851HiiDrawImageId (\r
852 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
853 IN EFI_HII_DRAW_FLAGS Flags,\r
854 IN EFI_HII_HANDLE PackageList,\r
855 IN EFI_IMAGE_ID ImageId,\r
856 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
857 IN UINTN BltX,\r
858 IN UINTN BltY\r
859 )\r
860\r
861;\r
862\r
863//\r
864// EFI_HII_STRING_PROTOCOL\r
865//\r
866\r
867\r
868/**\r
869 This function adds the string String to the group of strings owned by PackageList, with the\r
870 specified font information StringFontInfo and returns a new string id.\r
871\r
872 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
873 instance.\r
874 @param PackageList Handle of the package list where this string will\r
875 be added.\r
876 @param StringId On return, contains the new strings id, which is\r
877 unique within PackageList.\r
878 @param Language Points to the language for the new string.\r
879 @param LanguageName Points to the printable language name to\r
880 associate with the passed in Language field.If\r
881 LanguageName is not NULL and the string package\r
882 header's LanguageName associated with a given\r
883 Language is not zero, the LanguageName being\r
884 passed in will be ignored.\r
885 @param String Points to the new null-terminated string.\r
886 @param StringFontInfo Points to the new string's font information or\r
887 NULL if the string should have the default system\r
888 font, size and style.\r
889\r
890 @retval EFI_SUCCESS The new string was added successfully.\r
891 @retval EFI_NOT_FOUND The specified PackageList could not be found in\r
892 database.\r
893 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of\r
894 resources.\r
895 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL or Language is\r
896 NULL.\r
897\r
898**/\r
899EFI_STATUS\r
900EFIAPI\r
901HiiNewString (\r
902 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
903 IN EFI_HII_HANDLE PackageList,\r
904 OUT EFI_STRING_ID *StringId,\r
905 IN CONST CHAR8 *Language,\r
906 IN CONST CHAR16 *LanguageName, OPTIONAL\r
907 IN CONST EFI_STRING String,\r
908 IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL\r
ed66e1bc 909 );\r
ac644614 910\r
911\r
912/**\r
913 This function retrieves the string specified by StringId which is associated\r
914 with the specified PackageList in the language Language and copies it into\r
915 the buffer specified by String.\r
916\r
917 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
918 instance.\r
919 @param Language Points to the language for the retrieved string.\r
920 @param PackageList The package list in the HII database to search\r
921 for the specified string.\r
922 @param StringId The string's id, which is unique within\r
923 PackageList.\r
924 @param String Points to the new null-terminated string.\r
925 @param StringSize On entry, points to the size of the buffer\r
926 pointed to by String, in bytes. On return,\r
927 points to the length of the string, in bytes.\r
928 @param StringFontInfo If not NULL, points to the string's font\r
929 information. It's caller's responsibility to\r
930 free this buffer.\r
931\r
932 @retval EFI_SUCCESS The string was returned successfully.\r
933 @retval EFI_NOT_FOUND The string specified by StringId is not\r
934 available.\r
935 @retval EFI_NOT_FOUND The string specified by StringId is available but\r
813acf3a 936 not in the specified language.\r
937 The specified PackageList is not in the database.\r
938 @retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but\r
ac644614 939 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small\r
940 to hold the string.\r
941 @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL.\r
942 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the\r
943 request.\r
944\r
945**/\r
946EFI_STATUS\r
947EFIAPI\r
948HiiGetString (\r
949 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
950 IN CONST CHAR8 *Language,\r
951 IN EFI_HII_HANDLE PackageList,\r
952 IN EFI_STRING_ID StringId,\r
953 OUT EFI_STRING String,\r
954 IN OUT UINTN *StringSize,\r
955 OUT EFI_FONT_INFO **StringFontInfo OPTIONAL\r
ed66e1bc 956 );\r
ac644614 957\r
958\r
959/**\r
960 This function updates the string specified by StringId in the specified PackageList to the text\r
961 specified by String and, optionally, the font information specified by StringFontInfo.\r
962\r
963 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
964 instance.\r
965 @param PackageList The package list containing the strings.\r
966 @param StringId The string's id, which is unique within\r
967 PackageList.\r
968 @param Language Points to the language for the updated string.\r
969 @param String Points to the new null-terminated string.\r
970 @param StringFontInfo Points to the string's font information or NULL\r
971 if the string font information is not changed.\r
972\r
973 @retval EFI_SUCCESS The string was updated successfully.\r
974 @retval EFI_NOT_FOUND The string specified by StringId is not in the\r
975 database.\r
976 @retval EFI_INVALID_PARAMETER The String or Language was NULL.\r
977 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
978 task.\r
979\r
980**/\r
981EFI_STATUS\r
982EFIAPI\r
983HiiSetString (\r
984 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
985 IN EFI_HII_HANDLE PackageList,\r
986 IN EFI_STRING_ID StringId,\r
987 IN CONST CHAR8 *Language,\r
988 IN CONST EFI_STRING String,\r
989 IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL\r
ed66e1bc 990 );\r
ac644614 991\r
992\r
993/**\r
994 This function returns the list of supported languages, in the format specified\r
995 in Appendix M of UEFI 2.1 spec.\r
996\r
997 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
998 instance.\r
999 @param PackageList The package list to examine.\r
1000 @param Languages Points to the buffer to hold the returned string.\r
1001 @param LanguagesSize On entry, points to the size of the buffer\r
1002 pointed to by Languages, in bytes. On return,\r
1003 points to the length of Languages, in bytes.\r
1004\r
1005 @retval EFI_SUCCESS The languages were returned successfully.\r
1006 @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.\r
1007 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list\r
1008 of supported languages. LanguageSize is updated\r
1009 to contain the required size.\r
1010 @retval EFI_NOT_FOUND Could not find string package in specified\r
1011 packagelist.\r
1012\r
1013**/\r
1014EFI_STATUS\r
1015EFIAPI\r
1016HiiGetLanguages (\r
1017 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
1018 IN EFI_HII_HANDLE PackageList,\r
1019 IN OUT CHAR8 *Languages,\r
1020 IN OUT UINTN *LanguagesSize\r
ed66e1bc 1021 );\r
ac644614 1022\r
1023\r
1024/**\r
1025 Each string package has associated with it a single primary language and zero\r
1026 or more secondary languages. This routine returns the secondary languages\r
1027 associated with a package list.\r
1028\r
1029 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
1030 instance.\r
1031 @param PackageList The package list to examine.\r
1032 @param FirstLanguage Points to the primary language.\r
1033 @param SecondaryLanguages Points to the buffer to hold the returned list of\r
1034 secondary languages for the specified\r
1035 FirstLanguage. If there are no secondary\r
1036 languages, the function returns successfully,\r
1037 but this is set to NULL.\r
e90b081a 1038 @param SecondaryLanguagesSize On entry, points to the size of the buffer\r
ac644614 1039 pointed to by SecondLanguages, in bytes. On\r
1040 return, points to the length of SecondLanguages\r
1041 in bytes.\r
1042\r
1043 @retval EFI_SUCCESS Secondary languages were correctly returned.\r
1044 @retval EFI_INVALID_PARAMETER FirstLanguage or SecondLanguages or\r
1045 SecondLanguagesSize was NULL.\r
1046 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondLanguagesSize is\r
1047 too small to hold the returned information.\r
1048 SecondLanguageSize is updated to hold the size of\r
1049 the buffer required.\r
813acf3a 1050 @retval EFI_INVALID_LANGUAGE The language specified by FirstLanguage is not\r
ac644614 1051 present in the specified package list.\r
813acf3a 1052 @retval EFI_NOT_FOUND The specified PackageList is not in the Database. \r
ac644614 1053\r
1054**/\r
1055EFI_STATUS\r
1056EFIAPI\r
1057HiiGetSecondaryLanguages (\r
1058 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
1059 IN EFI_HII_HANDLE PackageList,\r
1060 IN CONST CHAR8 *FirstLanguage,\r
e90b081a 1061 IN OUT CHAR8 *SecondaryLanguages,\r
1062 IN OUT UINTN *SecondaryLanguagesSize\r
ed66e1bc 1063 );\r
ac644614 1064\r
1065//\r
1066// EFI_HII_DATABASE_PROTOCOL protocol interfaces\r
1067//\r
1068\r
1069\r
1070/**\r
1071 This function adds the packages in the package list to the database and returns a handle. If there is a\r
1072 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will\r
1073 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.\r
1074\r
1075 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1076 instance.\r
1077 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
1078 structure.\r
1079 @param DriverHandle Associate the package list with this EFI handle.\r
1080 @param Handle A pointer to the EFI_HII_HANDLE instance.\r
1081\r
1082 @retval EFI_SUCCESS The package list associated with the Handle was\r
1083 added to the HII database.\r
1084 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the\r
1085 new database contents.\r
1086 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.\r
1087\r
1088**/\r
1089EFI_STATUS\r
1090EFIAPI\r
1091HiiNewPackageList (\r
1092 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1093 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList,\r
1094 IN CONST EFI_HANDLE DriverHandle,\r
1095 OUT EFI_HII_HANDLE *Handle\r
ed66e1bc 1096 );\r
ac644614 1097\r
1098\r
1099/**\r
1100 This function removes the package list that is associated with a handle Handle\r
1101 from the HII database. Before removing the package, any registered functions\r
1102 with the notification type REMOVE_PACK and the same package type will be called.\r
1103\r
1104 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1105 instance.\r
1106 @param Handle The handle that was registered to the data that\r
1107 is requested for removal.\r
1108\r
1109 @retval EFI_SUCCESS The data associated with the Handle was removed\r
1110 from the HII database.\r
813acf3a 1111 @retval EFI_NOT_FOUND The specified Handle is not in database.\r
ac644614 1112\r
1113**/\r
1114EFI_STATUS\r
1115EFIAPI\r
1116HiiRemovePackageList (\r
1117 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1118 IN EFI_HII_HANDLE Handle\r
ed66e1bc 1119 );\r
ac644614 1120\r
1121\r
1122/**\r
1123 This function updates the existing package list (which has the specified Handle)\r
1124 in the HII databases, using the new package list specified by PackageList.\r
1125\r
1126 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1127 instance.\r
1128 @param Handle The handle that was registered to the data that\r
1129 is requested to be updated.\r
1130 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
1131 package.\r
1132\r
1133 @retval EFI_SUCCESS The HII database was successfully updated.\r
1134 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated\r
1135 database.\r
813acf3a 1136 @retval EFI_INVALID_PARAMETER PackageList was NULL.\r
1137 @retval EFI_NOT_FOUND The specified Handle is not in database.\r
ac644614 1138\r
1139**/\r
1140EFI_STATUS\r
1141EFIAPI\r
1142HiiUpdatePackageList (\r
1143 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1144 IN EFI_HII_HANDLE Handle,\r
1145 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList\r
ed66e1bc 1146 );\r
ac644614 1147\r
1148\r
1149/**\r
1150 This function returns a list of the package handles of the specified type\r
1151 that are currently active in the database. The pseudo-type\r
1152 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.\r
1153\r
1154 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1155 instance.\r
1156 @param PackageType Specifies the package type of the packages to\r
1157 list or EFI_HII_PACKAGE_TYPE_ALL for all packages\r
1158 to be listed.\r
1159 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then\r
1160 this is the pointer to the GUID which must match\r
1161 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.\r
1162 Otherwise, it must be NULL.\r
1163 @param HandleBufferLength On input, a pointer to the length of the handle\r
1164 buffer. On output, the length of the handle\r
1165 buffer that is required for the handles found.\r
1166 @param Handle An array of EFI_HII_HANDLE instances returned.\r
1167\r
1168 @retval EFI_SUCCESS The matching handles are outputed successfully.\r
813acf3a 1169 HandleBufferLength is updated with the actual length.\r
ac644614 1170 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r
1171 Handle is too small to support the number of\r
1172 handles. HandleBufferLength is updated with a\r
1173 value that will enable the data to fit.\r
1174 @retval EFI_NOT_FOUND No matching handle could not be found in\r
1175 database.\r
1176 @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.\r
813acf3a 1177 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
1178 PackageGuid is not NULL, PackageType is a EFI_HII_\r
1179 PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
1180 \r
ac644614 1181\r
1182**/\r
1183EFI_STATUS\r
1184EFIAPI\r
1185HiiListPackageLists (\r
1186 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1187 IN UINT8 PackageType,\r
1188 IN CONST EFI_GUID *PackageGuid,\r
1189 IN OUT UINTN *HandleBufferLength,\r
1190 OUT EFI_HII_HANDLE *Handle\r
ed66e1bc 1191 );\r
ac644614 1192\r
1193\r
1194/**\r
1195 This function will export one or all package lists in the database to a buffer.\r
1196 For each package list exported, this function will call functions registered\r
1197 with EXPORT_PACK and then copy the package list to the buffer.\r
1198\r
1199 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1200 instance.\r
1201 @param Handle An EFI_HII_HANDLE that corresponds to the desired\r
1202 package list in the HII database to export or\r
1203 NULL to indicate all package lists should be\r
1204 exported.\r
1205 @param BufferSize On input, a pointer to the length of the buffer.\r
1206 On output, the length of the buffer that is\r
1207 required for the exported data.\r
1208 @param Buffer A pointer to a buffer that will contain the\r
1209 results of the export function.\r
1210\r
1211 @retval EFI_SUCCESS Package exported.\r
1212 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r
1213 Handle is too small to support the number of\r
1214 handles. HandleBufferLength is updated with\r
1215 a value that will enable the data to fit.\r
1216 @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the\r
1217 current database.\r
1218 @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.\r
1219\r
1220**/\r
1221EFI_STATUS\r
1222EFIAPI\r
1223HiiExportPackageLists (\r
1224 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1225 IN EFI_HII_HANDLE Handle,\r
1226 IN OUT UINTN *BufferSize,\r
1227 OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer\r
ed66e1bc 1228 );\r
ac644614 1229\r
1230\r
1231/**\r
1232 This function registers a function which will be called when specified actions related to packages of\r
1233 the specified type occur in the HII database. By registering a function, other HII-related drivers are\r
1234 notified when specific package types are added, removed or updated in the HII database.\r
1235 Each driver or application which registers a notification should use\r
1236 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.\r
1237\r
1238 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1239 instance.\r
1240 @param PackageType Specifies the package type of the packages to\r
1241 list or EFI_HII_PACKAGE_TYPE_ALL for all packages\r
1242 to be listed.\r
1243 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then\r
1244 this is the pointer to the GUID which must match\r
1245 the Guid field of\r
1246 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must\r
1247 be NULL.\r
1248 @param PackageNotifyFn Points to the function to be called when the\r
1249 event specified by\r
1250 NotificationType occurs.\r
1251 @param NotifyType Describes the types of notification which this\r
1252 function will be receiving.\r
1253 @param NotifyHandle Points to the unique handle assigned to the\r
1254 registered notification. Can be used in\r
1255 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()\r
1256 to stop notifications.\r
1257\r
1258 @retval EFI_SUCCESS Notification registered successfully.\r
1259 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures\r
1260 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.\r
1261 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not\r
1262 EFI_HII_PACKAGE_TYPE_GUID.\r
1263 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is\r
1264 EFI_HII_PACKAGE_TYPE_GUID.\r
1265\r
1266**/\r
1267EFI_STATUS\r
1268EFIAPI\r
1269HiiRegisterPackageNotify (\r
1270 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1271 IN UINT8 PackageType,\r
1272 IN CONST EFI_GUID *PackageGuid,\r
1273 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn,\r
1274 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r
1275 OUT EFI_HANDLE *NotifyHandle\r
ed66e1bc 1276 );\r
ac644614 1277\r
1278\r
1279/**\r
1280 Removes the specified HII database package-related notification.\r
1281\r
1282 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1283 instance.\r
e90b081a 1284 @param NotificationHandle The handle of the notification function being\r
ac644614 1285 unregistered.\r
1286\r
1287 @retval EFI_SUCCESS Notification is unregistered successfully.\r
813acf3a 1288 @retval EFI_NOT_FOUND The incoming notification handle does not exist \r
1289 in current hii database.\r
ac644614 1290\r
1291**/\r
1292EFI_STATUS\r
1293EFIAPI\r
1294HiiUnregisterPackageNotify (\r
1295 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1296 IN EFI_HANDLE NotificationHandle\r
ed66e1bc 1297 );\r
ac644614 1298\r
1299\r
1300/**\r
1301 This routine retrieves an array of GUID values for each keyboard layout that\r
1302 was previously registered in the system.\r
1303\r
1304 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1305 instance.\r
1306 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard\r
1307 GUID buffer. On output, the length of the handle\r
1308 buffer that is required for the handles found.\r
1309 @param KeyGuidBuffer An array of keyboard layout GUID instances\r
1310 returned.\r
1311\r
1312 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.\r
1313 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates\r
1314 that KeyGuidBuffer is too small to support the\r
1315 number of GUIDs. KeyGuidBufferLength is\r
1316 updated with a value that will enable the data to\r
1317 fit.\r
1318 @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was\r
1319 NULL.\r
1320 @retval EFI_NOT_FOUND There was no keyboard layout.\r
1321\r
1322**/\r
1323EFI_STATUS\r
1324EFIAPI\r
1325HiiFindKeyboardLayouts (\r
1326 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1327 IN OUT UINT16 *KeyGuidBufferLength,\r
1328 OUT EFI_GUID *KeyGuidBuffer\r
ed66e1bc 1329 );\r
ac644614 1330\r
1331\r
1332/**\r
1333 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys\r
1334 on a keyboard and the character(s) that are associated with a particular set of key strokes.\r
1335\r
1336 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1337 instance.\r
1338 @param KeyGuid A pointer to the unique ID associated with a\r
1339 given keyboard layout. If KeyGuid is NULL then\r
1340 the current layout will be retrieved.\r
1341 @param KeyboardLayoutLength On input, a pointer to the length of the\r
1342 KeyboardLayout buffer. On output, the length of\r
1343 the data placed into KeyboardLayout.\r
1344 @param KeyboardLayout A pointer to a buffer containing the retrieved\r
1345 keyboard layout.\r
1346\r
1347 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.\r
1348 @retval EFI_NOT_FOUND The requested keyboard layout was not found.\r
1349 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was\r
1350 NULL.\r
1351\r
1352**/\r
1353EFI_STATUS\r
1354EFIAPI\r
1355HiiGetKeyboardLayout (\r
1356 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1357 IN CONST EFI_GUID *KeyGuid,\r
1358 IN OUT UINT16 *KeyboardLayoutLength,\r
1359 OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout\r
ed66e1bc 1360 );\r
ac644614 1361\r
1362\r
1363/**\r
1364 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine\r
1365 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID\r
1366 group type. This is so that agents which are sensitive to the current keyboard layout being changed\r
1367 can be notified of this change.\r
1368\r
1369 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1370 instance.\r
1371 @param KeyGuid A pointer to the unique ID associated with a\r
1372 given keyboard layout.\r
1373\r
1374 @retval EFI_SUCCESS The current keyboard layout was successfully set.\r
1375 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so\r
1376 action was taken.\r
1377 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.\r
1378\r
1379**/\r
1380EFI_STATUS\r
1381EFIAPI\r
1382HiiSetKeyboardLayout (\r
1383 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1384 IN CONST EFI_GUID *KeyGuid\r
ed66e1bc 1385 );\r
ac644614 1386\r
1387\r
1388/**\r
1389 Return the EFI handle associated with a package list.\r
1390\r
1391 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1392 instance.\r
1393 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired\r
1394 package list in the HIIdatabase.\r
1395 @param DriverHandle On return, contains the EFI_HANDLE which was\r
1396 registered with the package list in\r
1397 NewPackageList().\r
1398\r
1399 @retval EFI_SUCCESS The DriverHandle was returned successfully.\r
1400 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or\r
1401 DriverHandle was NULL.\r
1402\r
1403**/\r
1404EFI_STATUS\r
1405EFIAPI\r
1406HiiGetPackageListHandle (\r
1407 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1408 IN EFI_HII_HANDLE PackageListHandle,\r
1409 OUT EFI_HANDLE *DriverHandle\r
ed66e1bc 1410 );\r
ac644614 1411\r
1412//\r
1413// EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces\r
1414//\r
1415\r
1416\r
1417/**\r
1418 This function allows a caller to extract the current configuration\r
1419 for one or more named elements from one or more drivers.\r
1420\r
1421 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1422 instance.\r
1423 @param Request A null-terminated Unicode string in\r
1424 <MultiConfigRequest> format.\r
1425 @param Progress On return, points to a character in the Request\r
1426 string. Points to the string's null terminator if\r
1427 request was successful. Points to the most recent\r
1428 & before the first failing name / value pair (or\r
1429 the beginning of the string if the failure is in\r
1430 the first name / value pair) if the request was\r
1431 not successful.\r
1432 @param Results Null-terminated Unicode string in\r
1433 <MultiConfigAltResp> format which has all values\r
1434 filled in for the names in the Request string.\r
1435 String to be allocated by the called function.\r
1436\r
1437 @retval EFI_SUCCESS The Results string is filled with the values\r
1438 corresponding to all requested names.\r
1439 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r
1440 results that must be stored awaiting possible\r
1441 future protocols.\r
1442 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.\r
1443 Progress set to the "G" in "GUID" of the\r
1444 routing header that doesn't match. Note: There\r
1445 is no requirement that all routing data\r
1446 be validated before any configuration extraction.\r
1447 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request\r
1448 parameter would result in this type of error. The\r
1449 Progress parameter is set to NULL.\r
1450 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &\r
1451 before the error or the beginning of the string.\r
1452 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the\r
1453 name in question.\r
1454\r
1455**/\r
1456EFI_STATUS\r
1457EFIAPI\r
1458HiiConfigRoutingExtractConfig (\r
1459 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1460 IN CONST EFI_STRING Request,\r
1461 OUT EFI_STRING *Progress,\r
1462 OUT EFI_STRING *Results\r
ed66e1bc 1463 );\r
ac644614 1464\r
1465\r
1466/**\r
1467 This function allows the caller to request the current configuration for the\r
1468 entirety of the current HII database and returns the data in a null-terminated Unicode string.\r
1469\r
1470 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1471 instance.\r
1472 @param Results Null-terminated Unicode string in\r
1473 <MultiConfigAltResp> format which has all values\r
1474 filled in for the names in the Request string.\r
1475 String to be allocated by the called function.\r
1476 De-allocation is up to the caller.\r
1477\r
1478 @retval EFI_SUCCESS The Results string is filled with the values\r
1479 corresponding to all requested names.\r
1480 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r
1481 results that must be stored awaiting possible\r
1482 future protocols.\r
1483 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results\r
1484 parameter would result in this type of error.\r
1485\r
1486**/\r
1487EFI_STATUS\r
1488EFIAPI\r
1489HiiConfigRoutingExportConfig (\r
1490 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1491 OUT EFI_STRING *Results\r
ed66e1bc 1492 );\r
ac644614 1493\r
1494\r
1495/**\r
1496 This function processes the results of processing forms and routes it to the\r
1497 appropriate handlers or storage.\r
1498\r
1499 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1500 instance.\r
1501 @param Configuration A null-terminated Unicode string in\r
1502 <MulltiConfigResp> format.\r
1503 @param Progress A pointer to a string filled in with the offset\r
1504 of the most recent & before the first failing\r
1505 name / value pair (or the beginning of the string\r
1506 if the failure is in the first name / value pair)\r
1507 or the terminating NULL if all was successful.\r
1508\r
1509 @retval EFI_SUCCESS The results have been distributed or are awaiting\r
1510 distribution.\r
1511 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r
1512 results that must be stored awaiting possible\r
1513 future protocols.\r
1514 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter\r
1515 would result in this type of error.\r
1516 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1517 found.\r
1518\r
1519**/\r
1520EFI_STATUS\r
1521EFIAPI\r
813acf3a 1522HiiConfigRoutingRouteConfig (\r
ac644614 1523 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1524 IN CONST EFI_STRING Configuration,\r
1525 OUT EFI_STRING *Progress\r
ed66e1bc 1526 );\r
ac644614 1527\r
1528\r
1529\r
1530/**\r
1531 This helper function is to be called by drivers to map configuration data stored\r
1532 in byte array ("block") formats such as UEFI Variables into current configuration strings.\r
1533\r
1534 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1535 instance.\r
1536 @param ConfigRequest A null-terminated Unicode string in\r
1537 <ConfigRequest> format.\r
1538 @param Block Array of bytes defining the block's\r
1539 configuration.\r
1540 @param BlockSize Length in bytes of Block.\r
1541 @param Config Filled-in configuration string. String allocated\r
1542 by the function. Returned only if call is\r
1543 successful.\r
1544 @param Progress A pointer to a string filled in with the offset\r
1545 of the most recent & before the first failing\r
1546 name/value pair (or the beginning of the string\r
1547 if the failure is in the first name / value pair)\r
1548 or the terminating NULL if all was successful.\r
1549\r
1550 @retval EFI_SUCCESS The request succeeded. Progress points to the\r
1551 null terminator at the end of the ConfigRequest\r
1552 string.\r
1553 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.\r
1554 Progress points to the first character of\r
1555 ConfigRequest.\r
1556 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or\r
1557 Block parameter would result in this type of\r
1558 error. Progress points to the first character of\r
1559 ConfigRequest.\r
1560 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1561 found. Progress points to the "G" in "GUID" of\r
1562 the errant routing data.\r
1563 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.\r
1564 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.\r
1565 Block is left updated and Progress points at\r
1566 the '&' preceding the first non-<BlockName>.\r
1567\r
1568**/\r
1569EFI_STATUS\r
1570EFIAPI\r
1571HiiBlockToConfig (\r
1572 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1573 IN CONST EFI_STRING ConfigRequest,\r
1574 IN CONST UINT8 *Block,\r
1575 IN CONST UINTN BlockSize,\r
1576 OUT EFI_STRING *Config,\r
1577 OUT EFI_STRING *Progress\r
ed66e1bc 1578 );\r
ac644614 1579\r
1580\r
1581/**\r
1582 This helper function is to be called by drivers to map configuration strings\r
1583 to configurations stored in byte array ("block") formats such as UEFI Variables.\r
1584\r
1585 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1586 instance.\r
1587 @param ConfigResp A null-terminated Unicode string in <ConfigResp>\r
1588 format.\r
1589 @param Block A possibly null array of bytes representing the\r
1590 current block. Only bytes referenced in the\r
1591 ConfigResp string in the block are modified. If\r
1592 this parameter is null or if the *BlockSize\r
1593 parameter is (on input) shorter than required by\r
1594 the Configuration string, only the BlockSize\r
1595 parameter is updated and an appropriate status\r
1596 (see below) is returned.\r
1597 @param BlockSize The length of the Block in units of UINT8. On\r
1598 input, this is the size of the Block. On output,\r
1599 if successful, contains the index of the last\r
1600 modified byte in the Block.\r
1601 @param Progress On return, points to an element of the ConfigResp\r
1602 string filled in with the offset of the most\r
1603 recent '&' before the first failing name / value\r
1604 pair (or the beginning of the string if the\r
1605 failure is in the first name / value pair) or\r
1606 the terminating NULL if all was successful.\r
1607\r
1608 @retval EFI_SUCCESS The request succeeded. Progress points to the\r
1609 null terminator at the end of the ConfigResp\r
1610 string.\r
1611 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.\r
1612 Progress points to the first character of\r
1613 ConfigResp.\r
1614 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or\r
1615 Block parameter would result in this type of\r
1616 error. Progress points to the first character of\r
1617 ConfigResp.\r
1618 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1619 found. Progress points to the "G" in "GUID" of\r
1620 the errant routing data.\r
1621 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /\r
1622 value pair. Block is left updated and\r
1623 Progress points at the '&' preceding the first\r
1624 non-<BlockName>.\r
1625\r
1626**/\r
1627EFI_STATUS\r
1628EFIAPI\r
1629HiiConfigToBlock (\r
1630 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1631 IN CONST EFI_STRING ConfigResp,\r
1632 IN OUT UINT8 *Block,\r
1633 IN OUT UINTN *BlockSize,\r
1634 OUT EFI_STRING *Progress\r
ed66e1bc 1635 );\r
ac644614 1636\r
1637\r
1638/**\r
1639 This helper function is to be called by drivers to extract portions of\r
1640 a larger configuration string.\r
1641\r
1642 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1643 instance.\r
1644 @param Configuration A null-terminated Unicode string in\r
1645 <MultiConfigAltResp> format.\r
1646 @param Guid A pointer to the GUID value to search for in the\r
1647 routing portion of the ConfigResp string when\r
1648 retrieving the requested data. If Guid is NULL,\r
1649 then all GUID values will be searched for.\r
1650 @param Name A pointer to the NAME value to search for in the\r
1651 routing portion of the ConfigResp string when\r
1652 retrieving the requested data. If Name is NULL,\r
1653 then all Name values will be searched for.\r
1654 @param DevicePath A pointer to the PATH value to search for in the\r
1655 routing portion of the ConfigResp string when\r
1656 retrieving the requested data. If DevicePath is\r
1657 NULL, then all DevicePath values will be\r
1658 searched for.\r
1659 @param AltCfgId A pointer to the ALTCFG value to search for in\r
1660 the routing portion of the ConfigResp string\r
1661 when retrieving the requested data. If this\r
1662 parameter is NULL, then the current setting will\r
1663 be retrieved.\r
1664 @param AltCfgResp A pointer to a buffer which will be allocated by\r
1665 the function which contains the retrieved string\r
1666 as requested. This buffer is only allocated if\r
1667 the call was successful.\r
1668\r
1669 @retval EFI_SUCCESS The request succeeded. The requested data was\r
1670 extracted and placed in the newly allocated\r
1671 AltCfgResp buffer.\r
1672 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.\r
1673 @retval EFI_INVALID_PARAMETER Any parameter is invalid.\r
1674 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1675 found.\r
1676\r
1677**/\r
1678EFI_STATUS\r
1679EFIAPI\r
1680HiiGetAltCfg (\r
1681 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1682 IN CONST EFI_STRING Configuration,\r
1683 IN CONST EFI_GUID *Guid,\r
1684 IN CONST EFI_STRING Name,\r
1685 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
1686 IN CONST UINT16 *AltCfgId,\r
1687 OUT EFI_STRING *AltCfgResp\r
ed66e1bc 1688 );\r
ac644614 1689\r
ac644614 1690//\r
1691// Global variables\r
1692//\r
1693extern EFI_EVENT gHiiKeyboardLayoutChanged;\r
ac644614 1694#endif\r