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