]>
Commit | Line | Data |
---|---|---|
c7f33ca4 | 1 | /*++\r |
2 | \r | |
3e99020d | 3 | Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r |
4ea9375a | 4 | This program and the accompanying materials\r |
c7f33ca4 | 5 | are licensed and made available under the terms and conditions of the BSD License\r |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | UefiIfrLibrary.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | The file contain all library function for Ifr Operations.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef _IFRLIBRARY_H\r | |
23 | #define _IFRLIBRARY_H\r | |
24 | \r | |
25 | #include "Tiano.h"\r | |
26 | #include "EfiDriverLib.h"\r | |
27 | #include "TianoHii.h"\r | |
28 | \r | |
29 | #include EFI_PROTOCOL_DEFINITION (HiiFont)\r | |
30 | #include EFI_PROTOCOL_DEFINITION (HiiImage)\r | |
31 | #include EFI_PROTOCOL_DEFINITION (HiiString)\r | |
32 | #include EFI_PROTOCOL_DEFINITION (HiiDatabase)\r | |
33 | #include EFI_PROTOCOL_DEFINITION (HiiConfigRouting)\r | |
34 | #include EFI_PROTOCOL_DEFINITION (HiiConfigAccess)\r | |
35 | #include EFI_PROTOCOL_DEFINITION (FormBrowser2)\r | |
36 | #include EFI_PROTOCOL_DEFINITION (SimpleTextOut)\r | |
37 | \r | |
38 | #include EFI_GUID_DEFINITION (GlobalVariable)\r | |
39 | \r | |
40 | #define IFR_LIB_DEFAULT_STRING_SIZE 0x200\r | |
41 | \r | |
42 | //\r | |
43 | // The architectural variable "Lang" and "LangCodes" are deprecated in UEFI\r | |
44 | // specification. While, UEFI specification also states that these deprecated\r | |
45 | // variables may be provided for backwards compatibility.\r | |
46 | // If "LANG_SUPPORT" is defined, "Lang" and "LangCodes" will be produced;\r | |
47 | // If "LANG_SUPPORT" is undefined, "Lang" and "LangCodes" will not be produced.\r | |
48 | //\r | |
49 | #define LANG_SUPPORT\r | |
50 | \r | |
51 | #define EFI_LANGUAGE_VARIABLE L"Lang"\r | |
52 | #define EFI_LANGUAGE_CODES_VARIABLE L"LangCodes"\r | |
53 | \r | |
54 | #define UEFI_LANGUAGE_VARIABLE L"PlatformLang"\r | |
55 | #define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes"\r | |
56 | \r | |
57 | //\r | |
58 | // Limited buffer size recommended by RFC4646 (4.3. Length Considerations)\r | |
59 | // (42 characters plus a NULL terminator)\r | |
60 | //\r | |
61 | #define RFC_3066_ENTRY_SIZE (42 + 1)\r | |
62 | #define ISO_639_2_ENTRY_SIZE 3\r | |
63 | \r | |
64 | #define INVALID_VARSTORE_ID 0\r | |
65 | \r | |
66 | #define QUESTION_FLAGS (EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY)\r | |
67 | #define QUESTION_FLAGS_MASK (~QUESTION_FLAGS)\r | |
68 | \r | |
69 | extern EFI_GUID mIfrVendorGuid;\r | |
70 | extern EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;\r | |
71 | extern EFI_HII_STRING_PROTOCOL *gIfrLibHiiString;\r | |
72 | \r | |
73 | #pragma pack(1)\r | |
74 | typedef struct {\r | |
75 | EFI_STRING_ID StringToken;\r | |
76 | EFI_IFR_TYPE_VALUE Value;\r | |
77 | UINT8 Flags;\r | |
78 | } IFR_OPTION;\r | |
79 | #pragma pack()\r | |
80 | \r | |
3e99020d | 81 | #pragma pack(1)\r |
c7f33ca4 | 82 | typedef struct {\r |
83 | VENDOR_DEVICE_PATH VendorDevicePath;\r | |
3e99020d LG |
84 | UINT32 Reserved;\r |
85 | UINT64 UniqueId;\r | |
c7f33ca4 | 86 | } HII_VENDOR_DEVICE_PATH_NODE;\r |
3e99020d | 87 | #pragma pack()\r |
c7f33ca4 | 88 | \r |
89 | typedef struct {\r | |
90 | HII_VENDOR_DEVICE_PATH_NODE Node;\r | |
91 | EFI_DEVICE_PATH_PROTOCOL End;\r | |
92 | } HII_VENDOR_DEVICE_PATH;\r | |
93 | \r | |
94 | typedef struct {\r | |
95 | //\r | |
96 | // Buffer size allocated for Data.\r | |
97 | //\r | |
98 | UINT32 BufferSize;\r | |
99 | \r | |
100 | //\r | |
101 | // Offset in Data to append the newly created opcode binary.\r | |
102 | // It will be adjusted automatically in Create***OpCode(), and should be\r | |
103 | // initialized to 0 before invocation of a serial of Create***OpCode()\r | |
104 | //\r | |
105 | UINT32 Offset;\r | |
106 | \r | |
107 | //\r | |
108 | // The destination buffer for created op-codes\r | |
109 | //\r | |
110 | UINT8 *Data;\r | |
111 | } EFI_HII_UPDATE_DATA;\r | |
112 | \r | |
113 | VOID\r | |
114 | LocateHiiProtocols (\r | |
115 | VOID\r | |
116 | )\r | |
117 | /*++\r | |
118 | \r | |
119 | Routine Description:\r | |
120 | This function locate Hii relative protocols for later usage.\r | |
121 | \r | |
122 | Arguments:\r | |
123 | None.\r | |
124 | \r | |
125 | Returns:\r | |
126 | None.\r | |
127 | \r | |
128 | --*/\r | |
129 | ;\r | |
130 | \r | |
131 | //\r | |
132 | // Exported Library functions\r | |
133 | //\r | |
134 | EFI_STATUS\r | |
135 | CreateEndOpCode (\r | |
136 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
137 | )\r | |
138 | /*++\r | |
139 | \r | |
140 | Routine Description:\r | |
141 | Create EFI_IFR_END_OP opcode.\r | |
142 | \r | |
143 | Arguments:\r | |
144 | Data - Destination for the created opcode binary\r | |
145 | \r | |
146 | Returns:\r | |
147 | EFI_SUCCESS - Opcode create success\r | |
148 | \r | |
149 | --*/\r | |
150 | ;\r | |
151 | \r | |
152 | EFI_STATUS\r | |
153 | CreateDefaultOpCode (\r | |
154 | IN EFI_IFR_TYPE_VALUE *Value,\r | |
155 | IN UINT8 Type,\r | |
156 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
157 | )\r | |
158 | /*++\r | |
159 | \r | |
160 | Routine Description:\r | |
161 | Create EFI_IFR_DEFAULT_OP opcode.\r | |
162 | \r | |
163 | Arguments:\r | |
164 | Value - Value for the default\r | |
165 | Type - Type for the default\r | |
166 | Data - Destination for the created opcode binary\r | |
167 | \r | |
168 | Returns:\r | |
169 | EFI_SUCCESS - Opcode create success\r | |
170 | \r | |
171 | --*/\r | |
172 | ;\r | |
173 | \r | |
174 | EFI_STATUS\r | |
175 | CreateActionOpCode (\r | |
176 | IN EFI_QUESTION_ID QuestionId,\r | |
177 | IN EFI_STRING_ID Prompt,\r | |
178 | IN EFI_STRING_ID Help,\r | |
179 | IN UINT8 QuestionFlags,\r | |
180 | IN EFI_STRING_ID QuestionConfig,\r | |
181 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
182 | )\r | |
183 | /*++\r | |
184 | \r | |
185 | Routine Description:\r | |
186 | Create EFI_IFR_ACTION_OP opcode.\r | |
187 | \r | |
188 | Arguments:\r | |
189 | QuestionId - Question ID\r | |
190 | Prompt - String ID for Prompt\r | |
191 | Help - String ID for Help\r | |
192 | QuestionFlags - Flags in Question Header\r | |
193 | QuestionConfig - String ID for configuration\r | |
194 | Data - Destination for the created opcode binary\r | |
195 | \r | |
196 | Returns:\r | |
197 | EFI_SUCCESS - Opcode create success\r | |
198 | \r | |
199 | --*/\r | |
200 | ;\r | |
201 | \r | |
202 | EFI_STATUS\r | |
203 | CreateSubTitleOpCode (\r | |
204 | IN EFI_STRING_ID Prompt,\r | |
205 | IN EFI_STRING_ID Help,\r | |
206 | IN UINT8 Flags,\r | |
207 | IN UINT8 Scope,\r | |
208 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
209 | )\r | |
210 | /*++\r | |
211 | \r | |
212 | Routine Description:\r | |
213 | Create EFI_IFR_SUBTITLE_OP opcode.\r | |
214 | \r | |
215 | Arguments:\r | |
216 | Prompt - String ID for Prompt\r | |
217 | Help - String ID for Help\r | |
218 | Flags - Subtitle opcode flags\r | |
219 | Scope - Subtitle Scope bit\r | |
220 | Data - Destination for the created opcode binary\r | |
221 | \r | |
222 | Returns:\r | |
223 | EFI_SUCCESS - Opcode create success\r | |
224 | \r | |
225 | --*/\r | |
226 | ;\r | |
227 | \r | |
228 | EFI_STATUS\r | |
229 | CreateTextOpCode (\r | |
230 | IN EFI_STRING_ID Prompt,\r | |
231 | IN EFI_STRING_ID Help,\r | |
232 | IN EFI_STRING_ID TextTwo,\r | |
233 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
234 | )\r | |
235 | /*++\r | |
236 | \r | |
237 | Routine Description:\r | |
238 | Create EFI_IFR_TEXT_OP opcode.\r | |
239 | \r | |
240 | Arguments:\r | |
241 | Prompt - String ID for Prompt\r | |
242 | Help - String ID for Help\r | |
243 | TextTwo - String ID for text two\r | |
244 | Data - Destination for the created opcode binary\r | |
245 | \r | |
246 | Returns:\r | |
247 | EFI_SUCCESS - Opcode create success\r | |
248 | \r | |
249 | --*/\r | |
250 | ;\r | |
251 | \r | |
252 | EFI_STATUS\r | |
253 | CreateGotoOpCode (\r | |
254 | IN EFI_FORM_ID FormId,\r | |
255 | IN EFI_STRING_ID Prompt,\r | |
256 | IN EFI_STRING_ID Help,\r | |
257 | IN UINT8 QuestionFlags,\r | |
258 | IN EFI_QUESTION_ID QuestionId,\r | |
259 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
260 | )\r | |
261 | /*++\r | |
262 | \r | |
263 | Routine Description:\r | |
264 | Create EFI_IFR_REF_OP opcode.\r | |
265 | \r | |
266 | Arguments:\r | |
267 | FormId - Destination Form ID\r | |
268 | Prompt - String ID for Prompt\r | |
269 | Help - String ID for Help\r | |
270 | QuestionFlags - Flags in Question Header\r | |
271 | QuestionId - Question ID\r | |
272 | Data - Destination for the created opcode binary\r | |
273 | \r | |
274 | Returns:\r | |
275 | EFI_SUCCESS - Opcode create success\r | |
276 | \r | |
277 | --*/\r | |
278 | ;\r | |
279 | \r | |
280 | EFI_STATUS\r | |
281 | CreateOneOfOptionOpCode (\r | |
282 | IN UINTN OptionCount,\r | |
283 | IN IFR_OPTION *OptionsList,\r | |
284 | IN UINT8 Type,\r | |
285 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
3e99020d LG |
286 | )\r |
287 | ;\r | |
c7f33ca4 | 288 | \r |
289 | EFI_STATUS\r | |
290 | CreateOneOfOpCode (\r | |
291 | IN EFI_QUESTION_ID QuestionId,\r | |
292 | IN EFI_VARSTORE_ID VarStoreId,\r | |
293 | IN UINT16 VarOffset,\r | |
294 | IN EFI_STRING_ID Prompt,\r | |
295 | IN EFI_STRING_ID Help,\r | |
296 | IN UINT8 QuestionFlags,\r | |
297 | IN UINT8 OneOfFlags,\r | |
298 | IN IFR_OPTION *OptionsList,\r | |
299 | IN UINTN OptionCount,\r | |
300 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
301 | )\r | |
302 | /*++\r | |
303 | \r | |
304 | Routine Description:\r | |
305 | Create EFI_IFR_ONE_OF_OP opcode.\r | |
306 | \r | |
307 | Arguments:\r | |
308 | QuestionId - Question ID\r | |
309 | VarStoreId - Storage ID\r | |
310 | VarOffset - Offset in Storage\r | |
311 | Prompt - String ID for Prompt\r | |
312 | Help - String ID for Help\r | |
313 | QuestionFlags - Flags in Question Header\r | |
314 | OneOfFlags - Flags for oneof opcode\r | |
315 | OptionsList - List of options\r | |
316 | OptionCount - Number of options in option list\r | |
317 | Data - Destination for the created opcode binary\r | |
318 | \r | |
319 | Returns:\r | |
320 | EFI_SUCCESS - Opcode create success\r | |
321 | \r | |
322 | --*/\r | |
323 | ;\r | |
324 | \r | |
325 | EFI_STATUS\r | |
326 | CreateOrderedListOpCode (\r | |
327 | IN EFI_QUESTION_ID QuestionId,\r | |
328 | IN EFI_VARSTORE_ID VarStoreId,\r | |
329 | IN UINT16 VarOffset,\r | |
330 | IN EFI_STRING_ID Prompt,\r | |
331 | IN EFI_STRING_ID Help,\r | |
332 | IN UINT8 QuestionFlags,\r | |
333 | IN UINT8 Flags,\r | |
334 | IN UINT8 DataType,\r | |
335 | IN UINT8 MaxContainers,\r | |
336 | IN IFR_OPTION *OptionsList,\r | |
337 | IN UINTN OptionCount,\r | |
338 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
339 | )\r | |
340 | /*++\r | |
341 | \r | |
342 | Routine Description:\r | |
343 | Create EFI_IFR_ORDERED_LIST_OP opcode.\r | |
344 | \r | |
345 | Arguments:\r | |
346 | QuestionId - Question ID\r | |
347 | VarStoreId - Storage ID\r | |
348 | VarOffset - Offset in Storage\r | |
349 | Prompt - String ID for Prompt\r | |
350 | Help - String ID for Help\r | |
351 | QuestionFlags - Flags in Question Header\r | |
352 | Flags - Flags for ordered list opcode\r | |
353 | DataType - Type for option value\r | |
354 | MaxContainers - Maximum count for options in this ordered list\r | |
355 | OptionsList - List of options\r | |
356 | OptionCount - Number of options in option list\r | |
357 | Data - Destination for the created opcode binary\r | |
358 | \r | |
359 | Returns:\r | |
360 | EFI_SUCCESS - Opcode create success\r | |
361 | \r | |
362 | --*/\r | |
363 | ;\r | |
364 | \r | |
365 | EFI_STATUS\r | |
366 | CreateCheckBoxOpCode (\r | |
367 | IN EFI_QUESTION_ID QuestionId,\r | |
368 | IN EFI_VARSTORE_ID VarStoreId,\r | |
369 | IN UINT16 VarOffset,\r | |
370 | IN EFI_STRING_ID Prompt,\r | |
371 | IN EFI_STRING_ID Help,\r | |
372 | IN UINT8 QuestionFlags,\r | |
373 | IN UINT8 CheckBoxFlags,\r | |
374 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
375 | )\r | |
376 | /*++\r | |
377 | \r | |
378 | Routine Description:\r | |
379 | Create EFI_IFR_CHECKBOX_OP opcode.\r | |
380 | \r | |
381 | Arguments:\r | |
382 | QuestionId - Question ID\r | |
383 | VarStoreId - Storage ID\r | |
384 | VarOffset - Offset in Storage\r | |
385 | Prompt - String ID for Prompt\r | |
386 | Help - String ID for Help\r | |
387 | QuestionFlags - Flags in Question Header\r | |
388 | CheckBoxFlags - Flags for checkbox opcode\r | |
389 | Data - Destination for the created opcode binary\r | |
390 | \r | |
391 | Returns:\r | |
392 | EFI_SUCCESS - Opcode create success\r | |
393 | \r | |
394 | --*/\r | |
395 | ;\r | |
396 | \r | |
397 | EFI_STATUS\r | |
398 | CreateNumericOpCode (\r | |
399 | IN EFI_QUESTION_ID QuestionId,\r | |
400 | IN EFI_VARSTORE_ID VarStoreId,\r | |
401 | IN UINT16 VarOffset,\r | |
402 | IN EFI_STRING_ID Prompt,\r | |
403 | IN EFI_STRING_ID Help,\r | |
404 | IN UINT8 QuestionFlags,\r | |
405 | IN UINT8 NumericFlags,\r | |
406 | IN UINT64 Minimum,\r | |
407 | IN UINT64 Maximum,\r | |
408 | IN UINT64 Step,\r | |
409 | IN UINT64 Default,\r | |
410 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
411 | )\r | |
412 | /*++\r | |
413 | \r | |
414 | Routine Description:\r | |
415 | Create EFI_IFR_NUMERIC_OP opcode.\r | |
416 | \r | |
417 | Arguments:\r | |
418 | QuestionId - Question ID\r | |
419 | VarStoreId - Storage ID\r | |
420 | VarOffset - Offset in Storage\r | |
421 | Prompt - String ID for Prompt\r | |
422 | Help - String ID for Help\r | |
423 | QuestionFlags - Flags in Question Header\r | |
424 | NumericFlags - Flags for numeric opcode\r | |
425 | Minimum - Numeric minimum value\r | |
426 | Maximum - Numeric maximum value\r | |
427 | Step - Numeric step for edit\r | |
428 | Default - Numeric default value\r | |
429 | Data - Destination for the created opcode binary\r | |
430 | \r | |
431 | Returns:\r | |
432 | EFI_SUCCESS - Opcode create success\r | |
433 | \r | |
434 | --*/\r | |
435 | ;\r | |
436 | \r | |
437 | EFI_STATUS\r | |
438 | CreateStringOpCode (\r | |
439 | IN EFI_QUESTION_ID QuestionId,\r | |
440 | IN EFI_VARSTORE_ID VarStoreId,\r | |
441 | IN UINT16 VarOffset,\r | |
442 | IN EFI_STRING_ID Prompt,\r | |
443 | IN EFI_STRING_ID Help,\r | |
444 | IN UINT8 QuestionFlags,\r | |
445 | IN UINT8 StringFlags,\r | |
446 | IN UINT8 MinSize,\r | |
447 | IN UINT8 MaxSize,\r | |
448 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
449 | )\r | |
450 | /*++\r | |
451 | \r | |
452 | Routine Description:\r | |
453 | Create EFI_IFR_STRING_OP opcode.\r | |
454 | \r | |
455 | Arguments:\r | |
456 | QuestionId - Question ID\r | |
457 | VarStoreId - Storage ID\r | |
458 | VarOffset - Offset in Storage\r | |
459 | Prompt - String ID for Prompt\r | |
460 | Help - String ID for Help\r | |
461 | QuestionFlags - Flags in Question Header\r | |
462 | StringFlags - Flags for string opcode\r | |
463 | MinSize - String minimum length\r | |
464 | MaxSize - String maximum length\r | |
465 | Data - Destination for the created opcode binary\r | |
466 | \r | |
467 | Returns:\r | |
468 | EFI_SUCCESS - Opcode create success\r | |
469 | \r | |
470 | --*/\r | |
471 | ;\r | |
472 | \r | |
473 | EFI_STATUS\r | |
474 | CreateBannerOpCode (\r | |
475 | IN EFI_STRING_ID Title,\r | |
476 | IN UINT16 LineNumber,\r | |
477 | IN UINT8 Alignment,\r | |
478 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
479 | )\r | |
480 | /*++\r | |
481 | \r | |
482 | Routine Description:\r | |
483 | Create GUIDed opcode for banner.\r | |
484 | \r | |
485 | Arguments:\r | |
486 | Title - String ID for title\r | |
487 | LineNumber - Line number for this banner\r | |
488 | Alignment - Alignment for this banner, left, center or right\r | |
489 | Data - Destination for the created opcode binary\r | |
490 | \r | |
491 | Returns:\r | |
492 | EFI_SUCCESS - Opcode create success\r | |
493 | \r | |
494 | --*/\r | |
495 | ;\r | |
496 | \r | |
497 | EFI_HII_PACKAGE_LIST_HEADER *\r | |
498 | PreparePackageList (\r | |
499 | IN UINTN NumberOfPackages,\r | |
500 | IN EFI_GUID *GuidId,\r | |
501 | ...\r | |
502 | )\r | |
503 | /*++\r | |
504 | \r | |
505 | Routine Description:\r | |
506 | Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.\r | |
507 | \r | |
508 | Arguments:\r | |
509 | NumberOfPackages - Number of packages.\r | |
510 | GuidId - Package GUID.\r | |
511 | \r | |
512 | Returns:\r | |
513 | Pointer of EFI_HII_PACKAGE_LIST_HEADER.\r | |
514 | \r | |
515 | --*/\r | |
516 | ;\r | |
517 | \r | |
518 | EFI_STATUS\r | |
519 | CreateHiiDriverHandle (\r | |
520 | OUT EFI_HANDLE *DriverHandle\r | |
521 | )\r | |
522 | /*++\r | |
523 | \r | |
524 | Routine Description:\r | |
525 | The HII driver handle passed in for HiiDatabase.NewPackageList() requires\r | |
526 | that there should be DevicePath Protocol installed on it.\r | |
527 | This routine create a virtual Driver Handle by installing a vendor device\r | |
528 | path on it, so as to use it to invoke HiiDatabase.NewPackageList().\r | |
529 | \r | |
530 | Arguments:\r | |
531 | DriverHandle - Handle to be returned\r | |
532 | \r | |
533 | Returns:\r | |
534 | EFI_SUCCESS - Handle destroy success.\r | |
535 | EFI_OUT_OF_RESOURCES - Not enough memory.\r | |
536 | \r | |
537 | --*/\r | |
538 | ;\r | |
539 | \r | |
540 | EFI_STATUS\r | |
541 | DestroyHiiDriverHandle (\r | |
542 | IN EFI_HANDLE DriverHandle\r | |
543 | )\r | |
544 | /*++\r | |
545 | \r | |
546 | Routine Description:\r | |
547 | Destroy the Driver Handle created by CreateHiiDriverHandle().\r | |
548 | \r | |
549 | Arguments:\r | |
550 | DriverHandle - Handle returned by CreateHiiDriverHandle()\r | |
551 | \r | |
552 | Returns:\r | |
553 | EFI_SUCCESS - Handle destroy success.\r | |
554 | other - Handle destroy fail.\r | |
555 | \r | |
556 | --*/\r | |
557 | ;\r | |
558 | \r | |
559 | EFI_HII_HANDLE\r | |
560 | DevicePathToHiiHandle (\r | |
561 | IN EFI_HII_DATABASE_PROTOCOL *HiiDatabase,\r | |
562 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
563 | )\r | |
564 | /*++\r | |
565 | \r | |
566 | Routine Description:\r | |
567 | Find HII Handle associated with given Device Path.\r | |
568 | \r | |
569 | Arguments:\r | |
570 | HiiDatabase - Point to EFI_HII_DATABASE_PROTOCOL instance.\r | |
571 | DevicePath - Device Path associated with the HII package list handle.\r | |
572 | \r | |
573 | Returns:\r | |
574 | Handle - HII package list Handle associated with the Device Path.\r | |
575 | NULL - Hii Package list handle is not found.\r | |
576 | \r | |
577 | --*/\r | |
578 | ;\r | |
579 | \r | |
580 | EFI_STATUS\r | |
581 | ExtractDefault(\r | |
582 | IN VOID *Buffer,\r | |
583 | IN UINTN *BufferSize,\r | |
584 | UINTN Number,\r | |
585 | ...\r | |
586 | )\r | |
587 | /*++\r | |
588 | \r | |
589 | Routine Description:\r | |
590 | Configure the buffer accrording to ConfigBody strings.\r | |
591 | \r | |
592 | Arguments:\r | |
593 | DefaultId - the ID of default.\r | |
594 | Buffer - the start address of buffer.\r | |
595 | BufferSize - the size of buffer.\r | |
596 | Number - the number of the strings.\r | |
597 | \r | |
598 | Returns:\r | |
599 | EFI_BUFFER_TOO_SMALL - the BufferSize is too small to operate.\r | |
600 | EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0.\r | |
601 | EFI_SUCCESS - Operation successful.\r | |
602 | \r | |
603 | --*/\r | |
604 | ;\r | |
605 | \r | |
3e99020d LG |
606 | EFI_STATUS\r |
607 | ConstructConfigAltResp (\r | |
608 | IN EFI_STRING ConfigRequest, OPTIONAL\r | |
609 | OUT EFI_STRING *Progress,\r | |
610 | OUT EFI_STRING *ConfigAltResp,\r | |
611 | IN EFI_GUID *Guid,\r | |
612 | IN CHAR16 *Name,\r | |
613 | IN EFI_HANDLE *DriverHandle,\r | |
614 | IN VOID *BufferStorage,\r | |
615 | IN UINTN BufferStorageSize,\r | |
616 | IN VOID *BlockNameArray, OPTIONAL\r | |
617 | IN UINTN NumberAltCfg,\r | |
618 | ...\r | |
619 | //IN UINT16 AltCfgId,\r | |
620 | //IN VOID *DefaultValueArray,\r | |
621 | )\r | |
622 | /*++\r | |
623 | \r | |
624 | Routine Description:\r | |
625 | \r | |
626 | Construct <ConfigAltResp> for a buffer storage.\r | |
627 | \r | |
628 | Arguments:\r | |
629 | ConfigRequest - The Config request string. If set to NULL, all the\r | |
630 | configurable elements will be extracted from BlockNameArray.\r | |
631 | ConfigAltResp - The returned <ConfigAltResp>.\r | |
632 | Progress - On return, points to a character in the Request.\r | |
633 | Guid - GUID of the buffer storage.\r | |
634 | Name - Name of the buffer storage.\r | |
635 | DriverHandle - The DriverHandle which is used to invoke HiiDatabase\r | |
636 | protocol interface NewPackageList().\r | |
637 | BufferStorage - Content of the buffer storage.\r | |
638 | BufferStorageSize - Length in bytes of the buffer storage.\r | |
639 | BlockNameArray - Array generated by VFR compiler.\r | |
640 | NumberAltCfg - Number of Default value array generated by VFR compiler.\r | |
641 | The sequential input parameters will be number of\r | |
642 | AltCfgId and DefaultValueArray pairs. When set to 0,\r | |
643 | there will be no <AltResp>.\r | |
644 | \r | |
645 | Returns:\r | |
646 | EFI_OUT_OF_RESOURCES - Run out of memory resource.\r | |
647 | EFI_INVALID_PARAMETER - ConfigAltResp is NULL.\r | |
648 | EFI_SUCCESS - Operation successful.\r | |
649 | \r | |
650 | --*/\r | |
651 | ;\r | |
652 | \r | |
c7f33ca4 | 653 | EFI_STATUS\r |
654 | ExtractGuidFromHiiHandle (\r | |
655 | IN EFI_HII_HANDLE Handle,\r | |
656 | OUT EFI_GUID *Guid\r | |
657 | )\r | |
658 | /*++\r | |
659 | \r | |
660 | Routine Description:\r | |
661 | Extract Hii package list GUID for given HII handle.\r | |
662 | \r | |
663 | Arguments:\r | |
664 | HiiHandle - Hii handle\r | |
665 | Guid - Package list GUID\r | |
666 | \r | |
667 | Returns:\r | |
668 | EFI_SUCCESS - Successfully extract GUID from Hii database.\r | |
669 | \r | |
670 | --*/\r | |
671 | ;\r | |
672 | \r | |
673 | EFI_STATUS\r | |
674 | ExtractClassFromHiiHandle (\r | |
675 | IN EFI_HII_HANDLE Handle,\r | |
676 | OUT UINT16 *Class,\r | |
677 | OUT EFI_STRING_ID *FormSetTitle,\r | |
678 | OUT EFI_STRING_ID *FormSetHelp\r | |
679 | )\r | |
680 | /*++\r | |
681 | \r | |
682 | Routine Description:\r | |
683 | Extract formset class for given HII handle.\r | |
684 | \r | |
685 | Arguments:\r | |
686 | HiiHandle - Hii handle\r | |
687 | Class - Class of the formset\r | |
688 | FormSetTitle - Formset title string\r | |
689 | FormSetHelp - Formset help string\r | |
690 | \r | |
691 | Returns:\r | |
692 | EFI_SUCCESS - Successfully extract Class for specified Hii handle.\r | |
693 | \r | |
694 | --*/\r | |
695 | ;\r | |
696 | \r | |
3e99020d LG |
697 | EFI_STATUS\r |
698 | ExtractClassGuidFromHiiHandle (\r | |
699 | IN EFI_HII_HANDLE Handle,\r | |
700 | OUT UINT8 *NumberOfClassGuid,\r | |
701 | OUT EFI_GUID **ClassGuid,\r | |
702 | OUT EFI_STRING_ID *FormSetTitle,\r | |
703 | OUT EFI_STRING_ID *FormSetHelp\r | |
704 | )\r | |
705 | /*++\r | |
706 | \r | |
707 | Routine Description:\r | |
708 | Extract formset ClassGuid for given HII handle.\r | |
709 | \r | |
710 | Arguments:\r | |
711 | HiiHandle - Hii handle\r | |
712 | NumberOfClassGuid - Number of ClassGuid\r | |
713 | ClassGuid - Pointer to callee allocated buffer, an array of ClassGuid\r | |
714 | FormSetTitle - Formset title string\r | |
715 | FormSetHelp - Formset help string\r | |
716 | \r | |
717 | Returns:\r | |
718 | EFI_SUCCESS - Successfully extract Class for specified Hii handle.\r | |
719 | \r | |
720 | --*/\r | |
721 | ;\r | |
722 | \r | |
723 | VOID\r | |
724 | ToLower (\r | |
725 | IN OUT CHAR16 *Str\r | |
726 | )\r | |
727 | /*++\r | |
728 | \r | |
729 | Routine Description:\r | |
730 | Converts the unicode character from uppercase to lowercase.\r | |
731 | \r | |
732 | Arguments:\r | |
733 | Str - String to be converted\r | |
734 | \r | |
735 | Returns:\r | |
736 | \r | |
737 | --*/\r | |
738 | ;\r | |
739 | \r | |
c7f33ca4 | 740 | EFI_STATUS\r |
741 | BufferToHexString (\r | |
742 | IN OUT CHAR16 *Str,\r | |
743 | IN UINT8 *Buffer,\r | |
744 | IN UINTN BufferSize\r | |
745 | )\r | |
746 | /*++\r | |
747 | \r | |
748 | Routine Description:\r | |
749 | Converts binary buffer to Unicode string in reversed byte order to BufToHexString().\r | |
750 | \r | |
751 | Arguments:\r | |
752 | Str - String for output\r | |
753 | Buffer - Binary buffer.\r | |
754 | BufferSize - Size of the buffer in bytes.\r | |
755 | \r | |
756 | Returns:\r | |
757 | EFI_SUCCESS - The function completed successfully.\r | |
758 | \r | |
759 | --*/\r | |
760 | ;\r | |
761 | \r | |
762 | EFI_STATUS\r | |
763 | HexStringToBuffer (\r | |
764 | IN OUT UINT8 *Buffer,\r | |
765 | IN OUT UINTN *BufferSize,\r | |
766 | IN CHAR16 *Str\r | |
767 | )\r | |
768 | /*++\r | |
769 | \r | |
770 | Routine Description:\r | |
771 | Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().\r | |
772 | \r | |
773 | Arguments:\r | |
774 | Buffer - Pointer to buffer that receives the data.\r | |
775 | BufferSize - Length in bytes of the buffer to hold converted data.\r | |
776 | If routine return with EFI_SUCCESS, containing length of converted data.\r | |
777 | If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.\r | |
778 | Str - String to be converted from.\r | |
779 | \r | |
780 | Returns:\r | |
781 | EFI_SUCCESS - The function completed successfully.\r | |
782 | \r | |
783 | --*/\r | |
784 | ;\r | |
785 | \r | |
3e99020d LG |
786 | EFI_STATUS\r |
787 | ConfigStringToUnicode (\r | |
788 | IN OUT CHAR16 *UnicodeString,\r | |
789 | IN OUT UINTN *StrBufferLen,\r | |
790 | IN CHAR16 *ConfigString\r | |
791 | )\r | |
792 | /*++\r | |
793 | \r | |
794 | Routine Description:\r | |
795 | Convert binary representation Config string (e.g. "0041004200430044") to the\r | |
796 | original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.\r | |
797 | "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r | |
798 | \r | |
799 | Arguments:\r | |
800 | UnicodeString - Original Unicode string.\r | |
801 | StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.\r | |
802 | Includes tailing '\0' character.\r | |
803 | On output:\r | |
804 | If return EFI_SUCCESS, containing length of Unicode string buffer.\r | |
805 | If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r | |
806 | ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+\r | |
807 | \r | |
808 | Returns:\r | |
809 | EFI_SUCCESS - Routine success.\r | |
810 | EFI_BUFFER_TOO_SMALL - The string buffer is too small.\r | |
811 | \r | |
812 | --*/\r | |
813 | ;\r | |
814 | \r | |
815 | EFI_STATUS\r | |
816 | UnicodeToConfigString (\r | |
817 | IN OUT CHAR16 *ConfigString,\r | |
818 | IN OUT UINTN *StrBufferLen,\r | |
819 | IN CHAR16 *UnicodeString\r | |
820 | )\r | |
821 | /*++\r | |
822 | \r | |
823 | Routine Description:\r | |
824 | Convert Unicode string to binary representation Config string, e.g.\r | |
825 | "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.\r | |
826 | "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r | |
827 | \r | |
828 | Arguments:\r | |
829 | ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+\r | |
830 | StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.\r | |
831 | Includes tailing '\0' character.\r | |
832 | On output:\r | |
833 | If return EFI_SUCCESS, containing length of Unicode string buffer.\r | |
834 | If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r | |
835 | UnicodeString - Original Unicode string.\r | |
836 | \r | |
837 | Returns:\r | |
838 | EFI_SUCCESS - Routine success.\r | |
839 | EFI_BUFFER_TOO_SMALL - The string buffer is too small.\r | |
840 | \r | |
841 | --*/\r | |
842 | ;\r | |
843 | \r | |
c7f33ca4 | 844 | EFI_STATUS\r |
845 | ConstructConfigHdr (\r | |
846 | IN OUT CHAR16 *ConfigHdr,\r | |
847 | IN OUT UINTN *StrBufferLen,\r | |
848 | IN EFI_GUID *Guid,\r | |
849 | IN CHAR16 *Name, OPTIONAL\r | |
850 | IN EFI_HANDLE *DriverHandle\r | |
851 | )\r | |
852 | /*++\r | |
853 | \r | |
854 | Routine Description:\r | |
855 | Construct <ConfigHdr> using routing information GUID/NAME/PATH.\r | |
856 | \r | |
857 | Arguments:\r | |
858 | ConfigHdr - Pointer to the ConfigHdr string.\r | |
859 | StrBufferLen - On input: Length in bytes of buffer to hold the ConfigHdr string. Includes tailing '\0' character.\r | |
860 | On output:\r | |
861 | If return EFI_SUCCESS, containing length of ConfigHdr string buffer.\r | |
862 | If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r | |
863 | Guid - Routing information: GUID.\r | |
864 | Name - Routing information: NAME.\r | |
865 | DriverHandle - Driver handle which contains the routing information: PATH.\r | |
866 | \r | |
867 | Returns:\r | |
868 | EFI_SUCCESS - Routine success.\r | |
869 | EFI_BUFFER_TOO_SMALL - The ConfigHdr string buffer is too small.\r | |
870 | \r | |
871 | --*/\r | |
872 | ;\r | |
873 | \r | |
3e99020d LG |
874 | BOOLEAN\r |
875 | IsConfigHdrMatch (\r | |
876 | IN EFI_STRING ConfigString,\r | |
877 | IN EFI_GUID *StorageGuid, OPTIONAL\r | |
878 | IN CHAR16 *StorageName OPTIONAL\r | |
879 | )\r | |
880 | /*++\r | |
881 | \r | |
882 | Routine Description:\r | |
883 | Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.\r | |
884 | \r | |
885 | Arguments:\r | |
886 | ConfigString - Either <ConfigRequest> or <ConfigResp>.\r | |
887 | StorageGuid - GUID of the storage.\r | |
888 | StorageName - Name of the stoarge.\r | |
889 | \r | |
890 | Returns:\r | |
891 | TRUE - Routing information is correct in ConfigString.\r | |
892 | FALSE - Routing information is incorrect in ConfigString.\r | |
893 | \r | |
894 | --*/\r | |
895 | ;\r | |
896 | \r | |
c7f33ca4 | 897 | BOOLEAN\r |
898 | FindBlockName (\r | |
899 | IN OUT CHAR16 *String,\r | |
900 | UINTN Offset,\r | |
901 | UINTN Width\r | |
902 | )\r | |
903 | /*++\r | |
904 | \r | |
905 | Routine Description:\r | |
906 | Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.\r | |
907 | \r | |
908 | Arguments:\r | |
909 | String - The string to be searched in.\r | |
910 | Offset - Offset in BlockName.\r | |
911 | Width - Width in BlockName.\r | |
912 | \r | |
913 | Returns:\r | |
914 | TRUE - Block name found.\r | |
915 | FALSE - Block name not found.\r | |
916 | \r | |
917 | --*/\r | |
918 | ;\r | |
919 | \r | |
920 | EFI_STATUS\r | |
921 | GetBrowserData (\r | |
922 | EFI_GUID *VariableGuid, OPTIONAL\r | |
923 | CHAR16 *VariableName, OPTIONAL\r | |
924 | UINTN *BufferSize,\r | |
925 | UINT8 *Buffer\r | |
926 | )\r | |
927 | /*++\r | |
928 | \r | |
929 | Routine Description:\r | |
930 | This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.\r | |
931 | \r | |
932 | Arguments:\r | |
933 | VariableGuid - An optional field to indicate the target variable GUID name to use.\r | |
934 | VariableName - An optional field to indicate the target human-readable variable name.\r | |
935 | BufferSize - On input: Length in bytes of buffer to hold retrived data.\r | |
936 | On output:\r | |
937 | If return EFI_BUFFER_TOO_SMALL, containg length of buffer desired.\r | |
938 | Buffer - Buffer to hold retrived data.\r | |
939 | \r | |
940 | Returns:\r | |
941 | EFI_SUCCESS - Routine success.\r | |
942 | EFI_BUFFER_TOO_SMALL - The intput buffer is too small.\r | |
943 | \r | |
944 | --*/\r | |
945 | ;\r | |
946 | \r | |
947 | EFI_STATUS\r | |
948 | GetHiiHandles (\r | |
949 | IN OUT UINTN *HandleBufferLength,\r | |
950 | OUT EFI_HII_HANDLE **HiiHandleBuffer\r | |
951 | )\r | |
952 | /*++\r | |
953 | \r | |
954 | Routine Description:\r | |
955 | Determines the handles that are currently active in the database.\r | |
956 | It's the caller's responsibility to free handle buffer.\r | |
957 | \r | |
958 | Arguments:\r | |
959 | HiiDatabase - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r | |
960 | HandleBufferLength - On input, a pointer to the length of the handle buffer. On output,\r | |
961 | the length of the handle buffer that is required for the handles found.\r | |
962 | HiiHandleBuffer - Pointer to an array of Hii Handles returned.\r | |
963 | \r | |
964 | Returns:\r | |
965 | EFI_SUCCESS - Get an array of Hii Handles successfully.\r | |
966 | EFI_INVALID_PARAMETER - Hii is NULL.\r | |
967 | EFI_NOT_FOUND - Database not found.\r | |
968 | \r | |
969 | --*/\r | |
970 | ;\r | |
971 | \r | |
972 | EFI_STATUS\r | |
973 | SetBrowserData (\r | |
974 | EFI_GUID *VariableGuid, OPTIONAL\r | |
975 | CHAR16 *VariableName, OPTIONAL\r | |
976 | UINTN BufferSize,\r | |
977 | UINT8 *Buffer,\r | |
978 | CHAR16 *RequestElement OPTIONAL\r | |
979 | )\r | |
980 | /*++\r | |
981 | \r | |
982 | Routine Description:\r | |
983 | This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.\r | |
984 | \r | |
985 | Arguments:\r | |
986 | VariableGuid - An optional field to indicate the target variable GUID name to use.\r | |
987 | VariableName - An optional field to indicate the target human-readable variable name.\r | |
988 | BufferSize - Length in bytes of buffer to hold retrived data.\r | |
989 | Buffer - Buffer to hold retrived data.\r | |
990 | RequestElement - An optional field to specify which part of the buffer data\r | |
991 | will be send back to Browser. If NULL, the whole buffer of\r | |
992 | data will be committed to Browser.\r | |
993 | <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*\r | |
994 | \r | |
995 | Returns:\r | |
996 | EFI_SUCCESS - Routine success.\r | |
997 | Other - Updating Browser uncommitted data failed.\r | |
998 | \r | |
999 | --*/\r | |
1000 | ;\r | |
1001 | \r | |
1002 | EFI_STATUS\r | |
1003 | ConvertRfc3066LanguageToIso639Language (\r | |
1004 | CHAR8 *LanguageRfc3066,\r | |
1005 | CHAR8 *LanguageIso639\r | |
1006 | )\r | |
1007 | /*++\r | |
1008 | \r | |
1009 | Routine Description:\r | |
1010 | Convert language code from RFC3066 to ISO639-2.\r | |
1011 | \r | |
1012 | Arguments:\r | |
1013 | LanguageRfc3066 - RFC3066 language code.\r | |
1014 | LanguageIso639 - ISO639-2 language code.\r | |
1015 | \r | |
1016 | Returns:\r | |
1017 | EFI_SUCCESS - Language code converted.\r | |
1018 | EFI_NOT_FOUND - Language code not found.\r | |
1019 | \r | |
1020 | --*/\r | |
1021 | ;\r | |
1022 | \r | |
1023 | CHAR8 *\r | |
1024 | Rfc3066ToIso639 (\r | |
1025 | CHAR8 *SupportedLanguages\r | |
1026 | )\r | |
1027 | /*++\r | |
1028 | \r | |
1029 | Routine Description:\r | |
1030 | Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will\r | |
1031 | be converted to "engfra".\r | |
1032 | \r | |
1033 | Arguments:\r | |
1034 | SupportedLanguages - The RFC3066 language list.\r | |
1035 | \r | |
1036 | Returns:\r | |
1037 | The ISO639-2 language list.\r | |
1038 | \r | |
1039 | --*/\r | |
1040 | ;\r | |
1041 | \r | |
1042 | EFI_STATUS\r | |
1043 | GetCurrentLanguage (\r | |
1044 | OUT CHAR8 *Lang\r | |
1045 | )\r | |
1046 | /*++\r | |
1047 | \r | |
1048 | Routine Description:\r | |
1049 | Determine what is the current language setting\r | |
1050 | \r | |
1051 | Arguments:\r | |
1052 | Lang - Pointer of system language\r | |
1053 | \r | |
1054 | Returns:\r | |
1055 | Status code\r | |
1056 | \r | |
1057 | --*/\r | |
1058 | ;\r | |
1059 | \r | |
1060 | VOID\r | |
1061 | GetNextLanguage (\r | |
1062 | IN OUT CHAR8 **LangCode,\r | |
1063 | OUT CHAR8 *Lang\r | |
1064 | )\r | |
1065 | /*++\r | |
1066 | \r | |
1067 | Routine Description:\r | |
1068 | Get next language from language code list.\r | |
1069 | \r | |
1070 | Arguments:\r | |
1071 | LangCode - The language code.\r | |
1072 | Lang - Returned language.\r | |
1073 | \r | |
1074 | Returns:\r | |
1075 | None.\r | |
1076 | \r | |
1077 | --*/\r | |
1078 | ;\r | |
1079 | \r | |
1080 | CHAR8 *\r | |
1081 | GetSupportedLanguages (\r | |
1082 | IN EFI_HII_HANDLE HiiHandle\r | |
1083 | )\r | |
1084 | /*++\r | |
1085 | \r | |
1086 | Routine Description:\r | |
1087 | This function returns the list of supported languages, in the format specified\r | |
45212527 | 1088 | in UEFI specification Appendix M.\r |
c7f33ca4 | 1089 | \r |
1090 | Arguments:\r | |
1091 | HiiHandle - The HII package list handle.\r | |
1092 | \r | |
1093 | Returns:\r | |
1094 | The supported languages.\r | |
1095 | \r | |
1096 | --*/\r | |
1097 | ;\r | |
1098 | \r | |
1099 | UINT16\r | |
1100 | GetSupportedLanguageNumber (\r | |
1101 | IN EFI_HII_HANDLE HiiHandle\r | |
1102 | )\r | |
1103 | /*++\r | |
1104 | \r | |
1105 | Routine Description:\r | |
1106 | This function returns the number of supported languages\r | |
1107 | \r | |
1108 | Arguments:\r | |
1109 | HiiHandle - The HII package list handle.\r | |
1110 | \r | |
1111 | Returns:\r | |
1112 | The number of supported languages.\r | |
1113 | \r | |
1114 | --*/\r | |
1115 | ;\r | |
1116 | \r | |
1117 | EFI_STATUS\r | |
1118 | GetStringFromHandle (\r | |
1119 | IN EFI_HII_HANDLE HiiHandle,\r | |
1120 | IN EFI_STRING_ID StringId,\r | |
1121 | OUT EFI_STRING *String\r | |
1122 | )\r | |
1123 | /*++\r | |
1124 | \r | |
1125 | Routine Description:\r | |
1126 | Get string specified by StringId form the HiiHandle.\r | |
1127 | \r | |
1128 | Arguments:\r | |
1129 | HiiHandle - The HII handle of package list.\r | |
1130 | StringId - The String ID.\r | |
1131 | String - The output string.\r | |
1132 | \r | |
1133 | Returns:\r | |
1134 | EFI_NOT_FOUND - String is not found.\r | |
1135 | EFI_SUCCESS - Operation is successful.\r | |
1136 | EFI_OUT_OF_RESOURCES - There is not enought memory in the system.\r | |
1137 | EFI_INVALID_PARAMETER - The String is NULL.\r | |
1138 | \r | |
1139 | --*/\r | |
1140 | ;\r | |
1141 | \r | |
1142 | EFI_STATUS\r | |
1143 | GetStringFromToken (\r | |
1144 | IN EFI_GUID *ProducerGuid,\r | |
1145 | IN EFI_STRING_ID StringId,\r | |
1146 | OUT EFI_STRING *String\r | |
1147 | )\r | |
1148 | /*++\r | |
1149 | \r | |
1150 | Routine Description:\r | |
1151 | Get the string given the StringId and String package Producer's Guid.\r | |
1152 | \r | |
1153 | Arguments:\r | |
1154 | ProducerGuid - The Guid of String package list.\r | |
1155 | StringId - The String ID.\r | |
1156 | String - The output string.\r | |
1157 | \r | |
1158 | Returns:\r | |
1159 | EFI_NOT_FOUND - String is not found.\r | |
1160 | EFI_SUCCESS - Operation is successful.\r | |
1161 | EFI_OUT_OF_RESOURCES - There is not enought memory in the system.\r | |
1162 | \r | |
1163 | --*/\r | |
1164 | ;\r | |
1165 | \r | |
1166 | EFI_STATUS\r | |
1167 | IfrLibNewString (\r | |
1168 | IN EFI_HII_HANDLE PackageList,\r | |
1169 | OUT EFI_STRING_ID *StringId,\r | |
1170 | IN CONST EFI_STRING String\r | |
1171 | )\r | |
1172 | /*++\r | |
1173 | \r | |
1174 | Routine Description:\r | |
1175 | This function adds the string into String Package of each language.\r | |
1176 | \r | |
1177 | Arguments:\r | |
1178 | PackageList - Handle of the package list where this string will be added.\r | |
1179 | StringId - On return, contains the new strings id, which is unique within PackageList.\r | |
1180 | String - Points to the new null-terminated string.\r | |
1181 | \r | |
1182 | Returns:\r | |
1183 | EFI_SUCCESS - The new string was added successfully.\r | |
1184 | EFI_NOT_FOUND - The specified PackageList could not be found in database.\r | |
1185 | EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources.\r | |
1186 | EFI_INVALID_PARAMETER - String is NULL or StringId is NULL is NULL.\r | |
1187 | \r | |
1188 | --*/\r | |
1189 | ;\r | |
1190 | \r | |
1191 | EFI_STATUS\r | |
1192 | IfrLibGetString (\r | |
1193 | IN EFI_HII_HANDLE PackageList,\r | |
1194 | IN EFI_STRING_ID StringId,\r | |
1195 | OUT EFI_STRING String,\r | |
1196 | IN OUT UINTN *StringSize\r | |
1197 | )\r | |
1198 | /*++\r | |
1199 | \r | |
1200 | Routine Description:\r | |
1201 | This function try to retrieve string from String package of current language.\r | |
1202 | If fail, it try to retrieve string from String package of first language it support.\r | |
1203 | \r | |
1204 | Arguments:\r | |
1205 | PackageList - The package list in the HII database to search for the specified string.\r | |
1206 | StringId - The string's id, which is unique within PackageList.\r | |
1207 | String - Points to the new null-terminated string.\r | |
1208 | StringSize - On entry, points to the size of the buffer pointed to by String, in bytes. On return,\r | |
1209 | points to the length of the string, in bytes.\r | |
1210 | \r | |
1211 | Returns:\r | |
1212 | EFI_SUCCESS - The string was returned successfully.\r | |
1213 | EFI_NOT_FOUND - The string specified by StringId is not available.\r | |
1214 | EFI_BUFFER_TOO_SMALL - The buffer specified by StringLength is too small to hold the string.\r | |
1215 | EFI_INVALID_PARAMETER - The String or StringSize was NULL.\r | |
1216 | \r | |
1217 | --*/\r | |
1218 | ;\r | |
1219 | \r | |
1220 | EFI_STATUS\r | |
1221 | IfrLibSetString (\r | |
1222 | IN EFI_HII_HANDLE PackageList,\r | |
1223 | IN EFI_STRING_ID StringId,\r | |
1224 | IN CONST EFI_STRING String\r | |
1225 | )\r | |
1226 | /*++\r | |
1227 | \r | |
1228 | Routine Description:\r | |
1229 | This function updates the string in String package of current language.\r | |
1230 | \r | |
1231 | Arguments:\r | |
1232 | PackageList - The package list containing the strings.\r | |
1233 | StringId - The string's id, which is unique within PackageList.\r | |
1234 | String - Points to the new null-terminated string.\r | |
1235 | \r | |
1236 | Returns:\r | |
1237 | EFI_SUCCESS - The string was updated successfully.\r | |
1238 | EFI_NOT_FOUND - The string specified by StringId is not in the database.\r | |
1239 | EFI_INVALID_PARAMETER - The String was NULL.\r | |
1240 | EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.\r | |
1241 | \r | |
1242 | --*/\r | |
1243 | ;\r | |
1244 | \r | |
1245 | EFI_STATUS\r | |
1246 | IfrLibCreatePopUp (\r | |
1247 | IN UINTN NumberOfLines,\r | |
1248 | OUT EFI_INPUT_KEY *KeyValue,\r | |
1249 | IN CHAR16 *String,\r | |
1250 | ...\r | |
1251 | )\r | |
1252 | /*++\r | |
1253 | \r | |
1254 | Routine Description:\r | |
1255 | Draw a dialog and return the selected key.\r | |
1256 | \r | |
1257 | Arguments:\r | |
1258 | NumberOfLines - The number of lines for the dialog box\r | |
1259 | KeyValue - The EFI_KEY value returned if HotKey is TRUE..\r | |
1260 | String - Pointer to the first string in the list\r | |
1261 | ... - A series of (quantity == NumberOfLines) text strings which\r | |
1262 | will be used to construct the dialog box\r | |
1263 | \r | |
1264 | Returns:\r | |
1265 | EFI_SUCCESS - Displayed dialog and received user interaction\r | |
1266 | EFI_INVALID_PARAMETER - One of the parameters was invalid.\r | |
1267 | \r | |
1268 | --*/\r | |
1269 | ;\r | |
1270 | \r | |
3e99020d LG |
1271 | EFI_STATUS\r |
1272 | IfrLibInitUpdateData (\r | |
1273 | IN OUT EFI_HII_UPDATE_DATA *UpdateData,\r | |
1274 | IN UINT32 BufferSize\r | |
1275 | )\r | |
1276 | /*++\r | |
1277 | \r | |
1278 | Routine Description:\r | |
1279 | This function initialize the data structure for dynamic opcode.\r | |
1280 | \r | |
1281 | Arguments:\r | |
1282 | UpdateData - The adding data;\r | |
1283 | BufferSize - Length of the buffer to fill dynamic opcodes.\r | |
1284 | \r | |
1285 | Returns:\r | |
1286 | EFI_SUCCESS - Update data is initialized.\r | |
1287 | EFI_INVALID_PARAMETER - UpdateData is NULL.\r | |
1288 | EFI_OUT_OF_RESOURCES - No enough memory to allocate.\r | |
1289 | \r | |
1290 | --*/\r | |
1291 | ;\r | |
1292 | \r | |
1293 | EFI_STATUS\r | |
1294 | IfrLibFreeUpdateData (\r | |
1295 | IN EFI_HII_UPDATE_DATA *UpdateData\r | |
1296 | )\r | |
1297 | /*++\r | |
1298 | \r | |
1299 | Routine Description:\r | |
1300 | This function free the resource of update data.\r | |
1301 | \r | |
1302 | Arguments:\r | |
1303 | UpdateData - The adding data;\r | |
1304 | \r | |
1305 | Returns:\r | |
1306 | EFI_SUCCESS - Resource in UpdateData is released.\r | |
1307 | EFI_INVALID_PARAMETER - UpdateData is NULL.\r | |
1308 | \r | |
1309 | --*/\r | |
1310 | ;\r | |
1311 | \r | |
c7f33ca4 | 1312 | EFI_STATUS\r |
1313 | IfrLibUpdateForm (\r | |
1314 | IN EFI_HII_HANDLE Handle,\r | |
1315 | IN EFI_GUID *FormSetGuid, OPTIONAL\r | |
1316 | IN EFI_FORM_ID FormId,\r | |
1317 | IN UINT16 Label,\r | |
1318 | IN BOOLEAN Insert,\r | |
1319 | IN EFI_HII_UPDATE_DATA *Data\r | |
1320 | )\r | |
1321 | /*++\r | |
1322 | \r | |
1323 | Routine Description:\r | |
1324 | This function allows the caller to update a form that has\r | |
1325 | previously been registered with the EFI HII database.\r | |
1326 | \r | |
1327 | Arguments:\r | |
1328 | Handle - Hii Handle\r | |
1329 | FormSetGuid - The formset should be updated.\r | |
1330 | FormId - The form should be updated.\r | |
1331 | Label - Update information starting immediately after this label in the IFR\r | |
1332 | Insert - If TRUE and Data is not NULL, insert data after Label.\r | |
1333 | If FALSE, replace opcodes between two labels with Data.\r | |
1334 | Data - The adding data; If NULL, remove opcodes between two Label.\r | |
1335 | \r | |
1336 | Returns:\r | |
1337 | EFI_SUCCESS - Update success.\r | |
1338 | Other - Update fail.\r | |
1339 | \r | |
1340 | --*/\r | |
1341 | ;\r | |
1342 | #endif\r |