]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/IfrSupportLib.h
Correct typo in comments, clean IfrSupportLib.h
[mirror_edk2.git] / MdeModulePkg / Include / Library / IfrSupportLib.h
1 /** @file
2 This library contains functions to do IFR opcode creation and utility functions
3 to help module to interact with a UEFI Form Browser.
4
5 Copyright (c) 2007 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _IFR_SUPPORT_LIBRARY_H_
17 #define _IFR_SUPPORT_LIBRARY_H_
18
19 #pragma pack(1)
20 typedef struct {
21 EFI_STRING_ID StringToken;
22 EFI_IFR_TYPE_VALUE Value;
23 UINT8 Flags;
24 } IFR_OPTION;
25 #pragma pack()
26
27 typedef struct {
28 ///
29 /// Buffer size allocated for Data.
30 ///
31 UINT32 BufferSize;
32
33 ///
34 /// Offset in Data to append the newly created opcode binary.
35 /// It will be adjusted automatically in Create***OpCode(), and should be
36 /// initialized to 0 before invocation of a serial of Create***OpCode()
37 ///
38 UINT32 Offset;
39
40 ///
41 /// The destination buffer for created op-codes
42 ///
43 UINT8 *Data;
44 } EFI_HII_UPDATE_DATA;
45
46
47 /**
48 Create EFI_IFR_END_OP opcode.
49
50 If Data is NULL or Data->Data is NULL, then ASSERT.
51
52 @param Data Destination for the created opcode binary
53
54 @retval EFI_SUCCESS Opcode is created successfully.
55 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
56
57 **/
58 EFI_STATUS
59 EFIAPI
60 CreateEndOpCode (
61 IN OUT EFI_HII_UPDATE_DATA *Data
62 )
63 ;
64
65 /**
66 Create EFI_IFR_DEFAULT_OP opcode.
67
68 If Data is NULL or Data->Data is NULL, then ASSERT.
69
70 @param Value Value for the default
71 @param Type Type for the default
72 @param Data Destination for the created opcode binary
73
74 @retval EFI_SUCCESS Opcode is created successfully.
75 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
76 @retval EFI_INVALID_PARAMETER The type is not valid.
77
78 **/
79 EFI_STATUS
80 EFIAPI
81 CreateDefaultOpCode (
82 IN EFI_IFR_TYPE_VALUE *Value,
83 IN UINT8 Type,
84 IN OUT EFI_HII_UPDATE_DATA *Data
85 )
86 ;
87
88 /**
89 Create EFI_IFR_ACTION_OP opcode.
90
91 If Data is NULL or Data->Data is NULL, then ASSERT.
92
93 @param QuestionId Question ID
94 @param Prompt String ID for Prompt
95 @param Help String ID for Help
96 @param QuestionFlags Flags in Question Header
97 @param QuestionConfig String ID for configuration
98 @param Data Destination for the created opcode binary
99
100 @retval EFI_SUCCESS Opcode is created successfully.
101 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
102 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
103
104 **/
105 EFI_STATUS
106 EFIAPI
107 CreateActionOpCode (
108 IN EFI_QUESTION_ID QuestionId,
109 IN EFI_STRING_ID Prompt,
110 IN EFI_STRING_ID Help,
111 IN UINT8 QuestionFlags,
112 IN EFI_STRING_ID QuestionConfig,
113 IN OUT EFI_HII_UPDATE_DATA *Data
114 )
115 ;
116
117 /**
118 Create EFI_IFR_SUBTITLE_OP opcode.
119
120 If Data is NULL or Data->Data is NULL, then ASSERT.
121
122 @param Prompt String ID for Prompt
123 @param Help String ID for Help
124 @param Flags Subtitle opcode flags
125 @param Scope Subtitle Scope bit
126 @param Data Destination for the created opcode binary
127
128 @retval EFI_SUCCESS Opcode is created successfully.
129 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
130
131 **/
132 EFI_STATUS
133 EFIAPI
134 CreateSubTitleOpCode (
135 IN EFI_STRING_ID Prompt,
136 IN EFI_STRING_ID Help,
137 IN UINT8 Flags,
138 IN UINT8 Scope,
139 IN OUT EFI_HII_UPDATE_DATA *Data
140 )
141 ;
142
143 /**
144 Create EFI_IFR_TEXT_OP opcode.
145
146 If Data is NULL or Data->Data is NULL, then ASSERT.
147
148 @param Prompt String ID for Prompt
149 @param Help String ID for Help
150 @param TextTwo String ID for text two
151 @param Data Destination for the created opcode binary
152
153 @retval EFI_SUCCESS Opcode is created successfully.
154 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
155
156 **/
157 EFI_STATUS
158 EFIAPI
159 CreateTextOpCode (
160 IN EFI_STRING_ID Prompt,
161 IN EFI_STRING_ID Help,
162 IN EFI_STRING_ID TextTwo,
163 IN OUT EFI_HII_UPDATE_DATA *Data
164 )
165 ;
166
167 /**
168 Create EFI_IFR_REF_OP opcode.
169
170 If Data is NULL or Data->Data is NULL, then ASSERT.
171
172 @param FormId Destination Form ID
173 @param Prompt String ID for Prompt
174 @param Help String ID for Help
175 @param QuestionFlags Flags in Question Header
176 @param QuestionId Question ID
177 @param Data Destination for the created opcode binary
178
179 @retval EFI_SUCCESS Opcode is created successfully.
180 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
181 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
182
183 **/
184 EFI_STATUS
185 EFIAPI
186 CreateGotoOpCode (
187 IN EFI_FORM_ID FormId,
188 IN EFI_STRING_ID Prompt,
189 IN EFI_STRING_ID Help,
190 IN UINT8 QuestionFlags,
191 IN EFI_QUESTION_ID QuestionId,
192 IN OUT EFI_HII_UPDATE_DATA *Data
193 )
194 ;
195
196 /**
197 Create EFI_IFR_ONE_OF_OPTION_OP opcode.
198
199 If Data is NULL or Data->Data is NULL, then ASSERT.
200
201 @param OptionCount The number of options.
202 @param OptionsList The list of Options.
203 @param Type The data type.
204 @param Data Destination for the created opcode binary
205
206 @retval EFI_SUCCESS Opcode is created successfully.
207 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
208 @retval EFI_INVALID_PARAMETER If OptionCount is not zero but OptionsList is NULL.
209
210 **/
211 EFI_STATUS
212 EFIAPI
213 CreateOneOfOptionOpCode (
214 IN UINTN OptionCount,
215 IN IFR_OPTION *OptionsList,
216 IN UINT8 Type,
217 IN OUT EFI_HII_UPDATE_DATA *Data
218 )
219 ;
220
221 /**
222 Create EFI_IFR_ONE_OF_OP opcode.
223
224 If Data is NULL or Data->Data is NULL, then ASSERT.
225
226 @param QuestionId Question ID
227 @param VarStoreId Storage ID
228 @param VarOffset Offset in Storage
229 @param Prompt String ID for Prompt
230 @param Help String ID for Help
231 @param QuestionFlags Flags in Question Header
232 @param OneOfFlags Flags for oneof opcode
233 @param OptionsList List of options
234 @param OptionCount Number of options in option list
235 @param Data Destination for the created opcode binary
236
237 @retval EFI_SUCCESS Opcode is created successfully.
238 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
239 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
240
241 **/
242 EFI_STATUS
243 EFIAPI
244 CreateOneOfOpCode (
245 IN EFI_QUESTION_ID QuestionId,
246 IN EFI_VARSTORE_ID VarStoreId,
247 IN UINT16 VarOffset,
248 IN EFI_STRING_ID Prompt,
249 IN EFI_STRING_ID Help,
250 IN UINT8 QuestionFlags,
251 IN UINT8 OneOfFlags,
252 IN IFR_OPTION *OptionsList,
253 IN UINTN OptionCount,
254 IN OUT EFI_HII_UPDATE_DATA *Data
255 )
256 ;
257
258 /**
259 Create EFI_IFR_ORDERED_LIST_OP opcode.
260
261 If Data is NULL or Data->Data is NULL, then ASSERT.
262
263 @param QuestionId Question ID
264 @param VarStoreId Storage ID
265 @param VarOffset Offset in Storage
266 @param Prompt String ID for Prompt
267 @param Help String ID for Help
268 @param QuestionFlags Flags in Question Header
269 @param OrderedListFlags Flags for ordered list opcode
270 @param DataType Type for option value
271 @param MaxContainers Maximum count for options in this ordered list
272 @param OptionsList List of options
273 @param OptionCount Number of options in option list
274 @param Data Destination for the created opcode binary
275
276 @retval EFI_SUCCESS Opcode is created successfully.
277 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
278 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
279
280 **/
281 EFI_STATUS
282 EFIAPI
283 CreateOrderedListOpCode (
284 IN EFI_QUESTION_ID QuestionId,
285 IN EFI_VARSTORE_ID VarStoreId,
286 IN UINT16 VarOffset,
287 IN EFI_STRING_ID Prompt,
288 IN EFI_STRING_ID Help,
289 IN UINT8 QuestionFlags,
290 IN UINT8 OrderedListFlags,
291 IN UINT8 DataType,
292 IN UINT8 MaxContainers,
293 IN IFR_OPTION *OptionsList,
294 IN UINTN OptionCount,
295 IN OUT EFI_HII_UPDATE_DATA *Data
296 )
297 ;
298
299 /**
300 Create EFI_IFR_CHECKBOX_OP opcode.
301
302 If Data is NULL or Data->Data is NULL, then ASSERT.
303
304 @param QuestionId Question ID
305 @param VarStoreId Storage ID
306 @param VarOffset Offset in Storage
307 @param Prompt String ID for Prompt
308 @param Help String ID for Help
309 @param QuestionFlags Flags in Question Header
310 @param CheckBoxFlags Flags for checkbox opcode
311 @param Data Destination for the created opcode binary
312
313 @retval EFI_SUCCESS Opcode is created successfully.
314 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
315 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
316
317 **/
318 EFI_STATUS
319 EFIAPI
320 CreateCheckBoxOpCode (
321 IN EFI_QUESTION_ID QuestionId,
322 IN EFI_VARSTORE_ID VarStoreId,
323 IN UINT16 VarOffset,
324 IN EFI_STRING_ID Prompt,
325 IN EFI_STRING_ID Help,
326 IN UINT8 QuestionFlags,
327 IN UINT8 CheckBoxFlags,
328 IN OUT EFI_HII_UPDATE_DATA *Data
329 )
330 ;
331
332 /**
333 Create EFI_IFR_NUMERIC_OP opcode.
334
335 If Data is NULL or Data->Data is NULL, then ASSERT.
336
337 @param QuestionId Question ID
338 @param VarStoreId Storage ID
339 @param VarOffset Offset in Storage
340 @param Prompt String ID for Prompt
341 @param Help String ID for Help
342 @param QuestionFlags Flags in Question Header
343 @param NumericFlags Flags for numeric opcode
344 @param Minimum Numeric minimum value
345 @param Maximum Numeric maximum value
346 @param Step Numeric step for edit
347 @param Default Numeric default value
348 @param Data Destination for the created opcode binary
349
350 @retval EFI_SUCCESS Opcode is created successfully.
351 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
352 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
353
354 **/
355 EFI_STATUS
356 EFIAPI
357 CreateNumericOpCode (
358 IN EFI_QUESTION_ID QuestionId,
359 IN EFI_VARSTORE_ID VarStoreId,
360 IN UINT16 VarOffset,
361 IN EFI_STRING_ID Prompt,
362 IN EFI_STRING_ID Help,
363 IN UINT8 QuestionFlags,
364 IN UINT8 NumericFlags,
365 IN UINT64 Minimum,
366 IN UINT64 Maximum,
367 IN UINT64 Step,
368 IN UINT64 Default,
369 IN OUT EFI_HII_UPDATE_DATA *Data
370 )
371 ;
372
373 /**
374 Create EFI_IFR_STRING_OP opcode.
375
376 If Data is NULL or Data->Data is NULL, then ASSERT.
377
378 @param QuestionId Question ID
379 @param VarStoreId Storage ID
380 @param VarOffset Offset in Storage
381 @param Prompt String ID for Prompt
382 @param Help String ID for Help
383 @param QuestionFlags Flags in Question Header
384 @param StringFlags Flags for string opcode
385 @param MinSize String minimum length
386 @param MaxSize String maximum length
387 @param Data Destination for the created opcode binary
388
389 @retval EFI_SUCCESS Opcode is created successfully.
390 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
391 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
392
393 **/
394 EFI_STATUS
395 EFIAPI
396 CreateStringOpCode (
397 IN EFI_QUESTION_ID QuestionId,
398 IN EFI_VARSTORE_ID VarStoreId,
399 IN UINT16 VarOffset,
400 IN EFI_STRING_ID Prompt,
401 IN EFI_STRING_ID Help,
402 IN UINT8 QuestionFlags,
403 IN UINT8 StringFlags,
404 IN UINT8 MinSize,
405 IN UINT8 MaxSize,
406 IN OUT EFI_HII_UPDATE_DATA *Data
407 )
408 ;
409 /**
410 Construct <ConfigAltResp> for a buffer storage.
411
412 @param ConfigRequest The Config request string. If set to NULL, all the
413 configurable elements will be extracted from BlockNameArray.
414 @param Progress On return, points to a character in the Request.
415 @param ConfigAltResp The returned <ConfigAltResp>.
416 @param Guid GUID of the buffer storage.
417 @param Name Name of the buffer storage.
418 @param DriverHandle The DriverHandle which is used to invoke HiiDatabase
419 protocol interface NewPackageList().
420 @param BufferStorage Content of the buffer storage.
421 @param BufferStorageSize Length in bytes of the buffer storage.
422 @param BlockNameArray Array generated by VFR compiler.
423 @param NumberAltCfg Number of Default value array generated by VFR compiler.
424 The sequential input parameters will be number of
425 AltCfgId and DefaultValueArray pairs. When set to 0,
426 there will be no <AltResp>.
427 @param ... Variable argument list.
428
429 retval EFI_OUT_OF_RESOURCES Run out of memory resource.
430 retval EFI_INVALID_PARAMETER ConfigAltResp is NULL.
431 retval EFI_SUCCESS Operation successful.
432
433 **/
434 EFI_STATUS
435 ConstructConfigAltResp (
436 IN EFI_STRING ConfigRequest, OPTIONAL
437 OUT EFI_STRING *Progress,
438 OUT EFI_STRING *ConfigAltResp,
439 IN EFI_GUID *Guid,
440 IN CHAR16 *Name,
441 IN EFI_HANDLE *DriverHandle,
442 IN VOID *BufferStorage,
443 IN UINTN BufferStorageSize,
444 IN VOID *BlockNameArray, OPTIONAL
445 IN UINTN NumberAltCfg,
446 ...
447 //IN UINT16 AltCfgId,
448 //IN VOID *DefaultValueArray,
449 )
450 ;
451
452 /**
453 Converts the unicode character of the string from uppercase to lowercase.
454
455 @param Str String to be converted
456
457
458 **/
459 VOID
460 EFIAPI
461 ToLower (
462 IN OUT CHAR16 *Str
463 )
464 ;
465
466 /**
467 Converts binary buffer to a Unicode string. The byte buffer is in a reversed byte order
468 compared with the byte order defined in BufToHexString().
469
470 @param Str String for output
471 @param Buffer Binary buffer.
472 @param BufferSize Size of the buffer in bytes.
473
474 @retval EFI_SUCCESS The function completed successfully.
475 @retval EFI_OUT_OF_RESOURCES There is no enough available memory space.
476
477 **/
478 EFI_STATUS
479 EFIAPI
480 BufInReverseOrderToHexString (
481 IN OUT CHAR16 *Str,
482 IN UINT8 *Buffer,
483 IN UINTN BufferSize
484 )
485 ;
486
487 /**
488 Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().
489
490 @param Buffer Pointer to buffer that receives the data.
491 @param BufferSize Length in bytes of the buffer to hold converted
492 data. If routine return with EFI_SUCCESS,
493 containing length of converted data. If routine
494 return with EFI_BUFFER_TOO_SMALL, containg length
495 of buffer desired.
496 @param Str String to be converted from.
497
498 @retval EFI_SUCCESS The function completed successfully.
499 @retval RETURN_BUFFER_TOO_SMALL The input BufferSize is too small to hold the output. BufferSize
500 will be updated to the size required for the converstion.
501
502 **/
503 EFI_STATUS
504 EFIAPI
505 HexStringToBufInReverseOrder (
506 IN OUT UINT8 *Buffer,
507 IN OUT UINTN *BufferSize,
508 IN CHAR16 *Str
509 )
510 ;
511
512 /**
513 Convert binary representation Config string (e.g. "0041004200430044") to the
514 original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.
515 "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
516
517 @param UnicodeString Original Unicode string.
518 @param StrBufferLen On input: Length in bytes of buffer to hold the Unicode string.
519 Includes tailing '\0' character.
520 On output:
521 containing length of Unicode string buffer when returning EFI_SUCCESS;
522 containg length of string buffer desired when returning EFI_BUFFER_TOO_SMALL.
523 @param ConfigString Binary representation of Unicode String, <string> := (<HexCh>4)+
524
525 @retval EFI_SUCCESS Operation completes successfully.
526 @retval EFI_BUFFER_TOO_SMALL The string buffer is too small.
527
528 **/
529 EFI_STATUS
530 EFIAPI
531 ConfigStringToUnicode (
532 IN OUT CHAR16 *UnicodeString,
533 IN OUT UINTN *StrBufferLen,
534 IN CHAR16 *ConfigString
535 )
536 ;
537
538 /**
539 Convert Unicode string to binary representation Config string, e.g.
540 "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.
541 "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
542
543 @param ConfigString Binary representation of Unicode String, <string> := (<HexCh>4)+
544 @param StrBufferLen On input: Length in bytes of buffer to hold the Unicode string.
545 Includes tailing '\0' character.
546 On output:
547 If return EFI_SUCCESS, containing length of Unicode string buffer.
548 If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
549 @param UnicodeString Original Unicode string.
550
551 @retval EFI_SUCCESS Operation completes successfully.
552 @retval EFI_BUFFER_TOO_SMALL The string buffer is too small.
553
554 **/
555 EFI_STATUS
556 EFIAPI
557 UnicodeToConfigString (
558 IN OUT CHAR16 *ConfigString,
559 IN OUT UINTN *StrBufferLen,
560 IN CHAR16 *UnicodeString
561 )
562 ;
563
564 /**
565 Construct <ConfigHdr> using routing information GUID/NAME/PATH.
566
567 @param ConfigHdr Pointer to the ConfigHdr string.
568 @param StrBufferLen On input: Length in bytes of buffer to hold the
569 ConfigHdr string. Includes tailing '\0' character.
570 On output: If return EFI_SUCCESS, containing
571 length of ConfigHdr string buffer. If return
572 EFI_BUFFER_TOO_SMALL, containg length of string
573 buffer desired.
574 @param Guid Routing information: GUID.
575 @param Name Routing information: NAME.
576 @param DriverHandle Driver handle which contains the routing
577 information: PATH.
578
579 @retval EFI_SUCCESS Operation completes successfully.
580 @retval EFI_BUFFER_TOO_SMALL The ConfigHdr string buffer is too small.
581
582 **/
583 EFI_STATUS
584 EFIAPI
585 ConstructConfigHdr (
586 IN OUT CHAR16 *ConfigHdr,
587 IN OUT UINTN *StrBufferLen,
588 IN CONST EFI_GUID *Guid,
589 IN CHAR16 *Name, OPTIONAL
590 IN EFI_HANDLE *DriverHandle
591 )
592
593 ;
594
595 /**
596 Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.
597
598 @param ConfigString Either <ConfigRequest> or <ConfigResp>.
599 @param StorageGuid GUID of the storage.
600 @param StorageName Name of the stoarge.
601
602 @retval TRUE Routing information is correct in ConfigString.
603 @retval FALSE Routing information is incorrect in ConfigString.
604
605 **/
606 BOOLEAN
607 EFIAPI
608 IsConfigHdrMatch (
609 IN EFI_STRING ConfigString,
610 IN EFI_GUID *StorageGuid, OPTIONAL
611 IN CHAR16 *StorageName OPTIONAL
612 )
613 ;
614
615 /**
616 Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.
617
618 @param String The string to be searched in.
619 @param Offset Offset in BlockName.
620 @param Width Width in BlockName.
621
622 @retval TRUE Block name found.
623 @retval FALSE Block name not found.
624
625 **/
626 BOOLEAN
627 EFIAPI
628 FindBlockName (
629 IN OUT CHAR16 *String,
630 IN UINTN Offset,
631 IN UINTN Width
632 )
633 ;
634
635 /**
636 This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.
637
638 @param VariableGuid An optional field to indicate the target variable
639 GUID name to use.
640 @param VariableName An optional field to indicate the target
641 human-readable variable name.
642 @param BufferSize On input: Length in bytes of buffer to hold
643 retrived data. On output: If return
644 EFI_BUFFER_TOO_SMALL, containg length of buffer
645 desired.
646 @param Buffer Buffer to hold retrived data.
647
648 @retval EFI_SUCCESS Operation completes successfully.
649 @retval EFI_BUFFER_TOO_SMALL The intput buffer is too small.
650
651 **/
652 EFI_STATUS
653 EFIAPI
654 GetBrowserData (
655 IN CONST EFI_GUID *VariableGuid, OPTIONAL
656 IN CONST CHAR16 *VariableName, OPTIONAL
657 IN OUT UINTN *BufferSize,
658 IN OUT UINT8 *Buffer
659 )
660 ;
661
662 /**
663 This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.
664
665 @param VariableGuid An optional field to indicate the target variable
666 GUID name to use.
667 @param VariableName An optional field to indicate the target
668 human-readable variable name.
669 @param BufferSize Length in bytes of buffer to hold retrived data.
670 @param Buffer Buffer to hold retrived data.
671 @param RequestElement An optional field to specify which part of the
672 buffer data will be send back to Browser. If NULL,
673 the whole buffer of data will be committed to
674 Browser. <RequestElement> ::=
675 &OFFSET=<Number>&WIDTH=<Number>*
676
677 @retval EFI_SUCCESS Operation completes successfully.
678 @retval Other Updating Browser uncommitted data failed.
679
680 **/
681 EFI_STATUS
682 EFIAPI
683 SetBrowserData (
684 IN CONST EFI_GUID *VariableGuid, OPTIONAL
685 IN CONST CHAR16 *VariableName, OPTIONAL
686 IN UINTN BufferSize,
687 IN CONST UINT8 *Buffer,
688 IN CONST CHAR16 *RequestElement OPTIONAL
689 )
690 ;
691
692 /**
693 Draw a dialog and return the selected key.
694
695 @param NumberOfLines The number of lines for the dialog box
696 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
697 @param String Pointer to the first string in the list
698 @param ... A series of (quantity == NumberOfLines - 1) text
699 strings which will be used to construct the dialog
700 box
701
702 @retval EFI_SUCCESS Displayed dialog and received user interaction
703 @retval EFI_INVALID_PARAMETER One of the parameters was invalid.
704
705 **/
706 EFI_STATUS
707 EFIAPI
708 IfrLibCreatePopUp (
709 IN UINTN NumberOfLines,
710 OUT EFI_INPUT_KEY *KeyValue,
711 IN CHAR16 *String,
712 ...
713 )
714 ;
715
716 /**
717 Draw a dialog and return the selected key using Variable Argument List.
718
719 @param NumberOfLines The number of lines for the dialog box
720 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
721 @param String The first String to be displayed in the Pop-Up.
722 @param Args VA_LIST marker for the variable argument list.
723 A series of (quantity == NumberOfLines - 1) text
724 strings which will be used to construct the dialog
725 box
726
727 @retval EFI_SUCCESS Displayed dialog and received user interaction
728 @retval EFI_INVALID_PARAMETER One of the parameters was invalid.
729
730 **/
731 EFI_STATUS
732 EFIAPI
733 IfrLibCreatePopUp2 (
734 IN UINTN NumberOfLines,
735 OUT EFI_INPUT_KEY *KeyValue,
736 IN CHAR16 *String,
737 IN VA_LIST Args
738 )
739 ;
740
741 /**
742 Test if a Unicode character is a hexadecimal digit. If true, the input
743 Unicode character is converted to a byte.
744
745 This function tests if a Unicode character is a hexadecimal digit. If true, the input
746 Unicode character is converted to a byte. For example, Unicode character
747 L'A' will be converted to 0x0A.
748
749 If Digit is NULL, then ASSERT.
750
751 @param Digit The output hexadecimal digit.
752
753 @param Char The input Unicode character.
754
755 @retval TRUE Char is in the range of Hexadecimal number. Digit is updated
756 to the byte value of the number.
757 @retval FALSE Char is not in the range of Hexadecimal number. Digit is keep
758 intact.
759
760 **/
761 BOOLEAN
762 EFIAPI
763 IsHexDigit (
764 OUT UINT8 *Digit,
765 IN CHAR16 Char
766 )
767 ;
768
769
770 /**
771 Convert binary buffer to a Unicode String in a specified sequence.
772
773 This function converts bytes in the memory block pointed by Buffer to a Unicode String Str.
774 Each byte will be represented by two Unicode characters. For example, byte 0xA1 will
775 be converted into two Unicode character L'A' and L'1'. In the output String, the Unicode Character
776 for the Most Significant Nibble will be put before the Unicode Character for the Least Significant
777 Nibble. The output string for the buffer containing a single byte 0xA1 will be L"A1".
778 For a buffer with multiple bytes, the Unicode character produced by the first byte will be put into the
779 the last character in the output string. The one next to first byte will be put into the
780 character before the last character. This rules applies to the rest of the bytes. The Unicode
781 character by the last byte will be put into the first character in the output string. For example,
782 the input buffer for a 64-bits unsigned integer 0x12345678abcdef1234 will be converted to
783 a Unicode string equal to L"12345678abcdef1234".
784
785 @param String On input, String is pointed to the buffer allocated for the convertion.
786 @param StringLen The Length of String buffer to hold the output String. The length must include the tailing '\0' character.
787 The StringLen required to convert a N bytes Buffer will be a least equal to or greater
788 than 2*N + 1.
789 @param Buffer The pointer to a input buffer.
790 @param BufferSizeInBytes Length in bytes of the input buffer.
791
792
793 @retval EFI_SUCCESS The convertion is successful. All bytes in Buffer has been convert to the corresponding
794 Unicode character and placed into the right place in String.
795 @retval EFI_BUFFER_TOO_SMALL StringSizeInBytes is smaller than 2 * N + 1the number of bytes required to
796 complete the convertion.
797 **/
798 RETURN_STATUS
799 EFIAPI
800 BufToHexString (
801 IN OUT CHAR16 *String,
802 IN OUT UINTN *StringLen,
803 IN CONST UINT8 *Buffer,
804 IN UINTN BufferSizeInBytes
805 )
806 ;
807
808
809 /**
810 Convert a Unicode string consisting of hexadecimal characters to a output byte buffer.
811
812 This function converts a Unicode string consisting of characters in the range of Hexadecimal
813 character (L'0' to L'9', L'A' to L'F' and L'a' to L'f') to a output byte buffer. The function will stop
814 at the first non-hexadecimal character or the NULL character. The convertion process can be
815 simply viewed as the reverse operations defined by BufToHexString. Two Unicode characters will be
816 converted into one byte. The first Unicode character represents the Most Significant Nibble and the
817 second Unicode character represents the Least Significant Nibble in the output byte.
818 The first pair of Unicode characters represents the last byte in the output buffer. The second pair of Unicode
819 characters represent the the byte preceding the last byte. This rule applies to the rest pairs of bytes.
820 The last pair represent the first byte in the output buffer.
821
822 For example, a Unciode String L"12345678" will be converted into a buffer wil the following bytes
823 (first byte is the byte in the lowest memory address): "0x78, 0x56, 0x34, 0x12".
824
825 If String has N valid hexadecimal characters for conversion, the caller must make sure Buffer is at least
826 N/2 (if N is even) or (N+1)/2 (if N if odd) bytes.
827
828 If either Buffer, BufferSizeInBytes or String is NULL, then ASSERT ().
829
830 @param Buffer The output buffer allocated by the caller.
831 @param BufferSizeInBytes On input, the size in bytes of Buffer. On output, it is updated to
832 contain the size of the Buffer which is actually used for the converstion.
833 For Unicode string with 2*N hexadecimal characters (not including the
834 tailing NULL character), N bytes of Buffer will be used for the output.
835 @param String The input hexadecimal string.
836 @param ConvertedStrLen The number of hexadecimal characters used to produce content in output
837 buffer Buffer.
838
839 @retval RETURN_BUFFER_TOO_SMALL The input BufferSizeInBytes is too small to hold the output. BufferSizeInBytes
840 will be updated to the size required for the converstion.
841 @retval RETURN_SUCCESS The convertion is successful or the first Unicode character from String
842 is hexadecimal. If ConvertedStrLen is not NULL, it is updated
843 to the number of hexadecimal character used for the converstion.
844 **/
845 RETURN_STATUS
846 EFIAPI
847 HexStringToBuf (
848 OUT UINT8 *Buffer,
849 IN OUT UINTN *BufferSizeInBytes,
850 IN CONST CHAR16 *String,
851 OUT UINTN *ConvertedStrLen OPTIONAL
852 )
853 ;
854
855 #endif