2 Private MACRO, structure and function definitions for Setup Browser module.
4 Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22 #include <Protocol/SimpleTextOut.h>
23 #include <Protocol/SimpleTextIn.h>
24 #include <Protocol/FormBrowser2.h>
25 #include <Protocol/FormBrowserEx2.h>
26 #include <Protocol/DisplayProtocol.h>
27 #include <Protocol/DevicePath.h>
28 #include <Protocol/UnicodeCollation.h>
29 #include <Protocol/HiiConfigAccess.h>
30 #include <Protocol/HiiConfigRouting.h>
31 #include <Protocol/HiiDatabase.h>
32 #include <Protocol/HiiString.h>
33 #include <Protocol/UserManager.h>
34 #include <Protocol/DevicePathFromText.h>
36 #include <Guid/MdeModuleHii.h>
37 #include <Guid/HiiPlatformSetupFormset.h>
38 #include <Guid/HiiFormMapMethodGuid.h>
40 #include <Library/PrintLib.h>
41 #include <Library/DebugLib.h>
42 #include <Library/BaseMemoryLib.h>
43 #include <Library/UefiRuntimeServicesTableLib.h>
44 #include <Library/UefiDriverEntryPoint.h>
45 #include <Library/UefiBootServicesTableLib.h>
46 #include <Library/BaseLib.h>
47 #include <Library/MemoryAllocationLib.h>
48 #include <Library/HiiLib.h>
49 #include <Library/PcdLib.h>
50 #include <Library/DevicePathLib.h>
51 #include <Library/UefiLib.h>
55 // This is the generated header file which includes whatever needs to be exported (strings + IFR)
58 #define UI_ACTION_NONE 0
59 #define UI_ACTION_REFRESH_FORM 1
60 #define UI_ACTION_REFRESH_FORMSET 2
61 #define UI_ACTION_EXIT 3
67 #define ONE_SECOND 10000000
69 // Incremental string lenght of ConfigRequest
71 #define CONFIG_REQUEST_STRING_INCREMENTAL 1024
74 // Incremental size of stack for expression
76 #define EXPRESSION_STACK_SIZE_INCREMENT 0x100
78 #define EFI_IFR_SPECIFICATION_VERSION (UINT16) (((EFI_SYSTEM_TABLE_REVISION >> 16) << 8) | (((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) / 10) << 4) | ((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) % 10))
81 #define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')
90 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2
;
91 EFI_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx
;
93 EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2
;
95 } SETUP_DRIVER_PRIVATE_DATA
;
98 // IFR relative definition
100 #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0
101 #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1
102 #define EFI_HII_EXPRESSION_GRAY_OUT_IF 2
103 #define EFI_HII_EXPRESSION_SUPPRESS_IF 3
104 #define EFI_HII_EXPRESSION_DISABLE_IF 4
105 #define EFI_HII_EXPRESSION_VALUE 5
106 #define EFI_HII_EXPRESSION_RULE 6
107 #define EFI_HII_EXPRESSION_READ 7
108 #define EFI_HII_EXPRESSION_WRITE 8
109 #define EFI_HII_EXPRESSION_WARNING_IF 9
111 #define EFI_HII_VARSTORE_BUFFER 0
112 #define EFI_HII_VARSTORE_NAME_VALUE 1
113 #define EFI_HII_VARSTORE_EFI_VARIABLE 2 // EFI Varstore type follow UEFI spec before 2.3.1.
114 #define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3 // EFI varstore type follow UEFI spec 2.3.1 and later.
116 #define FORM_INCONSISTENT_VALIDATION 0
117 #define FORM_NO_SUBMIT_VALIDATION 1
119 #define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')
129 #define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)
131 #define BROWSER_STORAGE_SIGNATURE SIGNATURE_32 ('B', 'S', 'T', 'G')
137 UINT8 Type
; // Storage type
139 BOOLEAN Initialized
; // Whether this varstore is initialized, efi varstore not used.
141 EFI_HII_HANDLE HiiHandle
; // HiiHandle for this varstore, efi varstore not used.
144 CHAR16
*Name
; // For EFI_IFR_VARSTORE
147 UINT8
*EditBuffer
; // Edit copy for Buffer Storage
149 LIST_ENTRY NameValueListHead
; // List of NAME_VALUE_NODE
151 UINT32 Attributes
; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute
153 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
154 // <RequestElement> includes all fields which is used by current form sets.
155 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
158 #define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link, BROWSER_STORAGE_SIGNATURE)
160 #define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')
166 LIST_ENTRY SaveFailLink
;
170 BROWSER_STORAGE
*BrowserStorage
;
172 CHAR16
*ConfigHdr
; // <ConfigHdr>
174 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
175 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
176 BOOLEAN HasCallAltCfg
; // Flag to show whether browser has call ExtractConfig to get Altcfg string.
177 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
178 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
181 #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
182 #define FORMSET_STORAGE_FROM_SAVE_FAIL_LINK(a) CR (a, FORMSET_STORAGE, SaveFailLink, FORMSET_STORAGE_SIGNATURE)
185 EFI_STRING_ID VarName
;
189 #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')
197 UINT8 Format
; // For EFI_IFR_TO_STRING, EFI_IFR_FIND
198 UINT8 Flags
; // For EFI_IFR_SPAN
199 UINT8 RuleId
; // For EFI_IFR_RULE_REF
201 EFI_HII_VALUE Value
; // For EFI_IFR_EQ_ID_VAL, EFI_IFR_UINT64, EFI_IFR_UINT32, EFI_IFR_UINT16, EFI_IFR_UINT8, EFI_IFR_STRING_REF1
203 EFI_QUESTION_ID QuestionId
; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1
204 EFI_QUESTION_ID QuestionId2
;
206 UINT16 ListLength
; // For EFI_IFR_EQ_ID_VAL_LIST
209 EFI_STRING_ID DevicePath
; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
212 BROWSER_STORAGE
*VarStorage
; // For EFI_IFR_SET, EFI_IFR_GET
213 VAR_STORE_INFO VarStoreInfo
;// For EFI_IFR_SET, EFI_IFR_GET
214 UINT8 ValueType
; // For EFI_IFR_SET, EFI_IFR_GET
215 UINT8 ValueWidth
; // For EFI_IFR_SET, EFI_IFR_GET
216 CHAR16
*ValueName
; // For EFI_IFR_SET, EFI_IFR_GET
217 LIST_ENTRY MapExpressionList
; // nested expressions inside of Map opcode.
220 #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)
222 #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')
228 UINT8 Type
; // Type for this expression
230 UINT8 RuleId
; // For EFI_IFR_RULE only
231 EFI_STRING_ID Error
; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only
233 EFI_HII_VALUE Result
; // Expression evaluation result
235 UINT8 TimeOut
; // For EFI_IFR_WARNING_IF
236 EFI_IFR_OP_HEADER
*OpCode
; // Save the opcode buffer.
238 LIST_ENTRY OpCodeListHead
; // OpCodes consist of this expression (EXPRESSION_OPCODE)
241 #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)
243 #define FORM_EXPRESSION_LIST_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'R')
248 FORM_EXPRESSION
*Expression
[1]; // Array[Count] of expressions
249 } FORM_EXPRESSION_LIST
;
251 #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')
258 EFI_HII_VALUE Value
; // Default value
260 FORM_EXPRESSION
*ValueExpression
; // Not-NULL indicates default value is provided by EFI_IFR_VALUE
263 #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)
265 #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')
271 EFI_IFR_ONE_OF_OPTION
*OpCode
; // OneOfOption Data
276 EFI_IMAGE_ID ImageId
;
278 FORM_EXPRESSION_LIST
*SuppressExpression
; // Non-NULL indicates nested inside of SuppressIf
281 #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
297 typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT
;
299 #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
301 struct _FORM_BROWSER_STATEMENT
{
305 UINT8 Operand
; // The operand (first byte) of this Statement or Question
306 EFI_IFR_OP_HEADER
*OpCode
;
311 EFI_STRING_ID Prompt
;
313 EFI_STRING_ID TextTwo
; // For EFI_IFR_TEXT
316 // Fake Question Id, used for statement not has true QuestionId.
318 EFI_QUESTION_ID FakeQuestionId
;
323 EFI_QUESTION_ID QuestionId
; // The value of zero is reserved
324 EFI_VARSTORE_ID VarStoreId
; // A value of zero indicates no variable storage
325 BROWSER_STORAGE
*Storage
;
326 VAR_STORE_INFO VarStoreInfo
;
329 CHAR16
*VariableName
; // Name/Value or EFI Variable name
330 CHAR16
*BlockName
; // Buffer storage block name: "OFFSET=...WIDTH=..."
332 EFI_HII_VALUE HiiValue
; // Edit copy for checkbox, numberic, oneof
333 UINT8
*BufferValue
; // Edit copy for string, password, orderedlist
334 UINT8 ValueType
; // Data type for orderedlist value array
337 // OpCode specific members
339 UINT8 Flags
; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
340 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
341 UINT8 MaxContainers
; // for EFI_IFR_ORDERED_LIST
343 UINT16 BannerLineNumber
; // for EFI_IFR_BANNER, 1-based line number
344 EFI_STRING_ID QuestionConfig
; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed
346 UINT64 Minimum
; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
347 UINT64 Maximum
; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
350 EFI_DEFAULT_ID DefaultId
; // for EFI_IFR_RESET_BUTTON
351 EFI_GUID RefreshGuid
; // for EFI_IFR_REFRESH_ID
352 BOOLEAN Locked
; // Whether this statement is locked.
353 BOOLEAN ValueChanged
; // Whether this statement's value is changed.
355 // Get from IFR parsing
357 FORM_EXPRESSION
*ValueExpression
; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
358 LIST_ENTRY DefaultListHead
; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
359 LIST_ENTRY OptionListHead
; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
361 EFI_IMAGE_ID ImageId
; // nested EFI_IFR_IMAGE
362 UINT8 RefreshInterval
; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
364 FORM_BROWSER_STATEMENT
*ParentStatement
;
366 LIST_ENTRY InconsistentListHead
;// nested inconsistent expression list (FORM_EXPRESSION)
367 LIST_ENTRY NoSubmitListHead
; // nested nosubmit expression list (FORM_EXPRESSION)
368 LIST_ENTRY WarningListHead
; // nested warning expression list (FORM_EXPRESSION)
369 FORM_EXPRESSION_LIST
*Expression
; // nesting inside of GrayOutIf/DisableIf/SuppressIf
371 FORM_EXPRESSION
*ReadExpression
; // nested EFI_IFR_READ, provide this question value by read expression.
372 FORM_EXPRESSION
*WriteExpression
; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
375 #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
377 #define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')
382 LIST_ENTRY SaveFailLink
;
384 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
385 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
386 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
389 BROWSER_STORAGE
*Storage
;
390 } FORM_BROWSER_CONFIG_REQUEST
;
391 #define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
392 #define FORM_BROWSER_CONFIG_REQUEST_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, SaveFailLink, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
394 #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
395 #define STANDARD_MAP_FORM_TYPE 0x01
401 UINT16 FormId
; // FormId of normal form or formmap form.
402 EFI_STRING_ID FormTitle
; // FormTile of normal form, or FormMapMethod title of formmap form.
403 UINT16 FormType
; // Specific form type for the different form.
405 EFI_IMAGE_ID ImageId
;
407 BOOLEAN ModalForm
; // Whether this is a modal form.
408 BOOLEAN Locked
; // Whether this form is locked.
409 EFI_GUID RefreshGuid
; // Form refresh event guid.
411 LIST_ENTRY FormViewListHead
; // List of type FORMID_INFO is Browser View Form History List.
412 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
413 LIST_ENTRY StatementListHead
; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
414 LIST_ENTRY ConfigRequestHead
; // List of configreques for all storage.
415 FORM_EXPRESSION_LIST
*SuppressExpression
; // nesting inside of SuppressIf
418 #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)
420 #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')
427 EFI_STRING_ID DefaultName
;
428 } FORMSET_DEFAULTSTORE
;
430 #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)
432 #define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S')
437 LIST_ENTRY SaveFailLink
;
439 EFI_HII_HANDLE HiiHandle
; // unique id for formset.
440 EFI_HANDLE DriverHandle
;
441 EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
;
442 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
444 UINTN IfrBinaryLength
;
445 UINT8
*IfrBinaryData
;
447 BOOLEAN QuestionInited
; // Have finished question initilization?
449 EFI_STRING_ID FormSetTitle
;
451 UINT8 NumberOfClassGuid
;
452 EFI_GUID ClassGuid
[3]; // Up to three ClassGuid
453 UINT16 Class
; // Tiano extended Class code
454 UINT16 SubClass
; // Tiano extended Subclass code
455 EFI_IMAGE_ID ImageId
;
457 FORM_BROWSER_STATEMENT
*StatementBuffer
; // Buffer for all Statements and Questions
458 EXPRESSION_OPCODE
*ExpressionBuffer
; // Buffer for all Expression OpCode
459 FORM_BROWSER_FORM
*SaveFailForm
; // The form which failed to save.
460 FORM_BROWSER_STATEMENT
*SaveFailStatement
; // The Statement which failed to save.
462 LIST_ENTRY StatementListOSF
; // Statement list out side of the form.
463 LIST_ENTRY StorageListHead
; // Storage list (FORMSET_STORAGE)
464 LIST_ENTRY SaveFailStorageListHead
; // Storage list for the save fail storage.
465 LIST_ENTRY DefaultStoreListHead
; // DefaultStore list (FORMSET_DEFAULTSTORE)
466 LIST_ENTRY FormListHead
; // Form list (FORM_BROWSER_FORM)
467 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
468 } FORM_BROWSER_FORMSET
;
469 #define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)
471 #define FORM_BROWSER_FORMSET_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_FORMSET, SaveFailLink, FORM_BROWSER_FORMSET_SIGNATURE)
475 EFI_EVENT RefreshEvent
;
476 } FORM_BROWSER_REFRESH_EVENT_NODE
;
478 #define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)
482 EFI_HII_HANDLE Handle
;
485 // Target formset/form/Question information
487 EFI_GUID FormSetGuid
;
490 UINTN Sequence
; // used for time/date only.
499 // Ation for Browser to taken:
500 // UI_ACTION_NONE - navigation inside a form
501 // UI_ACTION_REFRESH_FORM - re-evaluate expressions and repaint form
502 // UI_ACTION_REFRESH_FORMSET - re-parse formset IFR binary
507 // Current selected fomset/form/Question
509 FORM_BROWSER_FORMSET
*FormSet
;
510 FORM_BROWSER_FORM
*Form
;
511 FORM_BROWSER_STATEMENT
*Statement
;
514 // Whether the Form is editable
516 BOOLEAN FormEditable
;
518 FORM_ENTRY_INFO
*CurrentMenu
;
521 #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
528 // Globals defined in Setup.c
530 BOOLEAN ResetRequired
;
531 BOOLEAN ExitRequired
;
532 EFI_HII_HANDLE HiiHandle
;
533 EFI_GUID FormSetGuid
;
535 UI_MENU_SELECTION
*Selection
;
537 LIST_ENTRY FormHistoryList
;
540 #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
543 // Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.
546 GetDefaultForNoStorage
, // Get default value for question which not has storage.
547 GetDefaultForStorage
, // Get default value for question which has storage.
548 GetDefaultForAll
, // Get default value for all questions.
549 GetDefaultForMax
// Invalid value.
550 } BROWSER_GET_DEFAULT_VALUE
;
553 // Get/set question value from/to.
556 GetSetValueWithEditBuffer
= 0, // Get/Set question value from/to editbuffer in the storage.
557 GetSetValueWithBuffer
, // Get/Set question value from/to buffer in the storage.
558 GetSetValueWithHiiDriver
, // Get/Set question value from/to hii driver.
559 GetSetValueWithBothBuffer
, // Compare the editbuffer with buffer for this question, not use the question value.
560 GetSetValueWithMax
// Invalid value.
561 } GET_SET_QUESTION_VALUE_WITH
;
563 extern EFI_HII_DATABASE_PROTOCOL
*mHiiDatabase
;
564 extern EFI_HII_CONFIG_ROUTING_PROTOCOL
*mHiiConfigRouting
;
565 extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL
*mPathFromText
;
566 extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL
*mFormDisplay
;
568 extern BOOLEAN gResetRequired
;
569 extern BOOLEAN gExitRequired
;
570 extern LIST_ENTRY gBrowserFormSetList
;
571 extern LIST_ENTRY gBrowserHotKeyList
;
572 extern BROWSER_SETTING_SCOPE gBrowserSettingScope
;
573 extern EXIT_HANDLER ExitHandlerFunction
;
574 extern EFI_HII_HANDLE mCurrentHiiHandle
;
575 extern SETUP_DRIVER_PRIVATE_DATA mPrivateData
;
577 // Browser Global Strings
579 extern CHAR16
*gEmptyString
;
581 extern EFI_GUID gZeroGuid
;
583 extern UI_MENU_SELECTION
*gCurrentSelection
;
586 // Global Procedure Defines
588 #include "Expression.h"
591 Initialize the HII String Token to the correct values.
595 InitializeBrowserStrings (
600 Parse opcodes in the formset IFR binary.
602 @param FormSet Pointer of the FormSet data structure.
604 @retval EFI_SUCCESS Opcode parse success.
605 @retval Other Opcode parse fail.
610 IN FORM_BROWSER_FORMSET
*FormSet
614 Free resources allocated for a FormSet.
616 @param FormSet Pointer of the FormSet
621 IN OUT FORM_BROWSER_FORMSET
*FormSet
626 Create a new string in HII Package List.
628 @param String The String to be added
629 @param HiiHandle The package list in the HII database to insert the
632 @return The output string.
638 IN EFI_HII_HANDLE HiiHandle
642 Delete a string from HII Package List.
644 @param StringId Id of the string in HII database.
645 @param HiiHandle The HII package list handle.
647 @retval EFI_SUCCESS The string was deleted successfully.
652 IN EFI_STRING_ID StringId
,
653 IN EFI_HII_HANDLE HiiHandle
657 Get the string based on the StringId and HII Package List Handle.
659 @param Token The String's ID.
660 @param HiiHandle The package list in the HII database to search for
661 the specified string.
663 @return The output string.
668 IN EFI_STRING_ID Token
,
669 IN EFI_HII_HANDLE HiiHandle
673 Get Value for given Name from a NameValue Storage.
675 @param Storage The NameValue Storage.
676 @param Name The Name.
677 @param Value The retured Value.
678 @param GetValueFrom Where to get source value, from EditValue or Value.
680 @retval EFI_SUCCESS Value found for given Name.
681 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
686 IN BROWSER_STORAGE
*Storage
,
688 IN OUT CHAR16
**Value
,
689 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
693 Set Value of given Name in a NameValue Storage.
695 @param Storage The NameValue Storage.
696 @param Name The Name.
697 @param Value The Value to set.
698 @param SetValueTo Whether update editValue or Value.
699 @param ReturnNode The node use the input name.
701 @retval EFI_SUCCESS Value found for given Name.
702 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
707 IN BROWSER_STORAGE
*Storage
,
710 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
,
711 OUT NAME_VALUE_NODE
**ReturnNode
715 Validate whether this question's value has changed.
717 @param FormSet FormSet data structure.
718 @param Form Form data structure.
719 @param Question Question to be initialized.
720 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
722 @retval TRUE Question's value has changed.
723 @retval FALSE Question's value has not changed
727 IsQuestionValueChanged (
728 IN FORM_BROWSER_FORMSET
*FormSet
,
729 IN FORM_BROWSER_FORM
*Form
,
730 IN OUT FORM_BROWSER_STATEMENT
*Question
,
731 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
735 Validate the FormSet. If the formset is not validate, remove it from the list.
737 @param FormSet The input FormSet which need to validate.
739 @retval TRUE The handle is validate.
740 @retval FALSE The handle is invalidate.
745 FORM_BROWSER_FORMSET
*FormSet
749 Update the ValueChanged status for questions.
751 @param FormSet FormSet data structure.
752 @param Form Form data structure.
753 @param SettingScope Setting Scope for Default action.
757 UpdateStatementStatus (
758 IN FORM_BROWSER_FORMSET
*FormSet
,
759 IN FORM_BROWSER_FORM
*Form
,
760 IN BROWSER_SETTING_SCOPE SettingScope
764 Get Question's current Value.
766 @param FormSet FormSet data structure.
767 @param Form Form data structure.
768 @param Question Question to be initialized.
769 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
771 @retval EFI_SUCCESS The function completed successfully.
776 IN FORM_BROWSER_FORMSET
*FormSet
,
777 IN FORM_BROWSER_FORM
*Form
,
778 IN OUT FORM_BROWSER_STATEMENT
*Question
,
779 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
783 Save Question Value to edit copy(cached) or Storage(uncached).
785 @param FormSet FormSet data structure.
786 @param Form Form data structure.
787 @param Question Pointer to the Question.
788 @param SetValueTo Update the question value to editbuffer , buffer or hii driver.
790 @retval EFI_SUCCESS The function completed successfully.
795 IN FORM_BROWSER_FORMSET
*FormSet
,
796 IN FORM_BROWSER_FORM
*Form
,
797 IN OUT FORM_BROWSER_STATEMENT
*Question
,
798 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
802 Perform inconsistent check for a Form.
804 @param FormSet FormSet data structure.
805 @param Form Form data structure.
806 @param Question The Question to be validated.
807 @param Type Validation type: InConsistent or NoSubmit
809 @retval EFI_SUCCESS Form validation pass.
810 @retval other Form validation failed.
815 IN FORM_BROWSER_FORMSET
*FormSet
,
816 IN FORM_BROWSER_FORM
*Form
,
817 IN FORM_BROWSER_STATEMENT
*Question
,
823 Discard data based on the input setting scope (Form, FormSet or System).
825 @param FormSet FormSet data structure.
826 @param Form Form data structure.
827 @param SettingScope Setting Scope for Discard action.
829 @retval EFI_SUCCESS The function completed successfully.
830 @retval EFI_UNSUPPORTED Unsupport SettingScope.
835 IN FORM_BROWSER_FORMSET
*FormSet
,
836 IN FORM_BROWSER_FORM
*Form
,
837 IN BROWSER_SETTING_SCOPE SettingScope
841 Submit data based on the input Setting level (Form, FormSet or System).
843 @param FormSet FormSet data structure.
844 @param Form Form data structure.
845 @param SettingScope Setting Scope for Submit action.
847 @retval EFI_SUCCESS The function completed successfully.
848 @retval EFI_UNSUPPORTED Unsupport SettingScope.
853 IN FORM_BROWSER_FORMSET
*FormSet
,
854 IN FORM_BROWSER_FORM
*Form
,
855 IN BROWSER_SETTING_SCOPE SettingScope
859 Reset Question to its default value.
861 @param FormSet The form set.
862 @param Form The form.
863 @param Question The question.
864 @param DefaultId The Class of the default.
866 @retval EFI_SUCCESS Question is reset to default value.
871 IN FORM_BROWSER_FORMSET
*FormSet
,
872 IN FORM_BROWSER_FORM
*Form
,
873 IN FORM_BROWSER_STATEMENT
*Question
,
878 Get current setting of Questions.
880 @param FormSet FormSet data structure.
884 InitializeCurrentSetting (
885 IN OUT FORM_BROWSER_FORMSET
*FormSet
889 Initialize the internal data structure of a FormSet.
891 @param Handle PackageList Handle
892 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
893 GUID), take the first FormSet found in package
895 @param FormSet FormSet data structure.
897 @retval EFI_SUCCESS The function completed successfully.
898 @retval EFI_NOT_FOUND The specified FormSet could not be found.
903 IN EFI_HII_HANDLE Handle
,
904 IN OUT EFI_GUID
*FormSetGuid
,
905 OUT FORM_BROWSER_FORMSET
*FormSet
909 Reset Questions to their initial value or default value in a Form, Formset or System.
911 GetDefaultValueScope parameter decides which questions will reset
912 to its default value.
914 @param FormSet FormSet data structure.
915 @param Form Form data structure.
916 @param DefaultId The Class of the default.
917 @param SettingScope Setting Scope for Default action.
918 @param GetDefaultValueScope Get default value scope.
919 @param Storage Get default value only for this storage.
920 @param RetrieveValueFirst Whether call the retrieve call back to
921 get the initial value before get default
923 @param SkipGetAltCfg Whether skip the get altcfg string process.
925 @retval EFI_SUCCESS The function completed successfully.
926 @retval EFI_UNSUPPORTED Unsupport SettingScope.
931 IN FORM_BROWSER_FORMSET
*FormSet
,
932 IN FORM_BROWSER_FORM
*Form
,
934 IN BROWSER_SETTING_SCOPE SettingScope
,
935 IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope
,
936 IN BROWSER_STORAGE
*Storage
,
937 IN BOOLEAN RetrieveValueFirst
,
938 IN BOOLEAN SkipGetAltCfg
942 Initialize Question's Edit copy from Storage.
944 @param Selection Selection contains the information about
945 the Selection, form and formset to be displayed.
946 Selection action may be updated in retrieve callback.
947 If Selection is NULL, only initialize Question value.
948 @param FormSet FormSet data structure.
949 @param Form Form data structure.
951 @retval EFI_SUCCESS The function completed successfully.
956 IN OUT UI_MENU_SELECTION
*Selection
,
957 IN FORM_BROWSER_FORMSET
*FormSet
,
958 IN FORM_BROWSER_FORM
*Form
962 Initialize Question's Edit copy from Storage for the whole Formset.
964 @param Selection Selection contains the information about
965 the Selection, form and formset to be displayed.
966 Selection action may be updated in retrieve callback.
967 If Selection is NULL, only initialize Question value.
968 @param FormSet FormSet data structure.
970 @retval EFI_SUCCESS The function completed successfully.
975 IN OUT UI_MENU_SELECTION
*Selection
,
976 IN FORM_BROWSER_FORMSET
*FormSet
980 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
982 @param Storage The Storage to be conveted.
983 @param ConfigResp The returned <ConfigResp>.
984 @param ConfigRequest The ConfigRequest string.
985 @param GetEditBuf Get the data from editbuffer or buffer.
987 @retval EFI_SUCCESS Convert success.
988 @retval EFI_INVALID_PARAMETER Incorrect storage type.
992 StorageToConfigResp (
993 IN BROWSER_STORAGE
*Storage
,
994 IN CHAR16
**ConfigResp
,
995 IN CHAR16
*ConfigRequest
,
996 IN BOOLEAN GetEditBuf
1000 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
1002 @param Storage The Storage to receive the settings.
1003 @param ConfigResp The <ConfigResp> to be converted.
1005 @retval EFI_SUCCESS Convert success.
1006 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1010 ConfigRespToStorage (
1011 IN BROWSER_STORAGE
*Storage
,
1012 IN CHAR16
*ConfigResp
1016 Fill storage's edit copy with settings requested from Configuration Driver.
1018 @param FormSet FormSet data structure.
1019 @param Storage Buffer Storage.
1024 IN FORM_BROWSER_FORMSET
*FormSet
,
1025 IN FORMSET_STORAGE
*Storage
1029 Fetch the Ifr binary data of a FormSet.
1031 @param Handle PackageList Handle
1032 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1033 GUID), take the first FormSet found in package
1035 @param BinaryLength The length of the FormSet IFR binary.
1036 @param BinaryData The buffer designed to receive the FormSet.
1038 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
1039 BufferLength was updated.
1040 @retval EFI_INVALID_PARAMETER The handle is unknown.
1041 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
1042 be found with the requested FormId.
1047 IN EFI_HII_HANDLE Handle
,
1048 IN OUT EFI_GUID
*FormSetGuid
,
1049 OUT UINTN
*BinaryLength
,
1050 OUT UINT8
**BinaryData
1054 Save globals used by previous call to SendForm(). SendForm() may be called from
1055 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.
1056 So, save globals of previous call to SendForm() and restore them upon exit.
1060 SaveBrowserContext (
1065 Restore globals used by previous call to SendForm().
1069 RestoreBrowserContext (
1074 This is the routine which an external caller uses to direct the browser
1075 where to obtain it's information.
1078 @param This The Form Browser protocol instanse.
1079 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
1080 display a list of the formsets for the handles specified.
1081 @param HandleCount The number of Handles specified in Handle.
1082 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
1083 field in the EFI_IFR_FORM_SET op-code for the specified
1084 forms-based package. If FormSetGuid is NULL, then this
1085 function will display the first found forms package.
1086 @param FormId This field specifies which EFI_IFR_FORM to render as the first
1087 displayable page. If this field has a value of 0x0000, then
1088 the forms browser will render the specified forms in their encoded order.
1089 ScreenDimenions - This allows the browser to be called so that it occupies a
1090 portion of the physical screen instead of dynamically determining the screen dimensions.
1091 ActionRequest - Points to the action recommended by the form.
1092 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
1094 @param ActionRequest Points to the action recommended by the form.
1096 @retval EFI_SUCCESS The function completed successfully.
1097 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1098 @retval EFI_NOT_FOUND No valid forms could be found to display.
1104 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1105 IN EFI_HII_HANDLE
*Handles
,
1106 IN UINTN HandleCount
,
1107 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1108 IN UINT16 FormId
, OPTIONAL
1109 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions
, OPTIONAL
1110 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1114 This function is called by a callback handler to retrieve uncommitted state
1115 data from the browser.
1117 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1119 @param ResultsDataSize A pointer to the size of the buffer associated
1121 @param ResultsData A string returned from an IFR browser or
1122 equivalent. The results string will have no
1123 routing information in them.
1124 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1125 (if RetrieveData = TRUE) data from the uncommitted
1126 browser state information or set (if RetrieveData
1127 = FALSE) data in the uncommitted browser state
1129 @param VariableGuid An optional field to indicate the target variable
1131 @param VariableName An optional field to indicate the target
1132 human-readable variable name.
1134 @retval EFI_SUCCESS The results have been distributed or are awaiting
1136 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1137 contain the results data.
1143 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1144 IN OUT UINTN
*ResultsDataSize
,
1145 IN OUT EFI_STRING ResultsData
,
1146 IN BOOLEAN RetrieveData
,
1147 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
1148 IN CONST CHAR16
*VariableName OPTIONAL
1152 Find menu which will show next time.
1154 @param Selection On input, Selection tell setup browser the information
1155 about the Selection, form and formset to be displayed.
1156 On output, Selection return the screen item that is selected
1158 @param SettingLevel Input Settting level, if it is FormLevel, just exit current form.
1159 else, we need to exit current formset.
1161 @retval TRUE Exit current form.
1162 @retval FALSE User press ESC and keep in current form.
1166 IN OUT UI_MENU_SELECTION
*Selection
,
1167 IN BROWSER_SETTING_SCOPE SettingLevel
1171 check whether the form need to update the NV.
1173 @param Form Form data structure.
1175 @retval TRUE Need to update the NV.
1176 @retval FALSE No need to update the NV.
1179 IsNvUpdateRequiredForForm (
1180 IN FORM_BROWSER_FORM
*Form
1184 check whether the formset need to update the NV.
1186 @param FormSet FormSet data structure.
1188 @retval TRUE Need to update the NV.
1189 @retval FALSE No need to update the NV.
1192 IsNvUpdateRequiredForFormSet (
1193 IN FORM_BROWSER_FORMSET
*FormSet
1197 Call the call back function for the question and process the return action.
1199 @param Selection On input, Selection tell setup browser the information
1200 about the Selection, form and formset to be displayed.
1201 On output, Selection return the screen item that is selected
1203 @param FormSet The formset this question belong to.
1204 @param Form The form this question belong to.
1205 @param Question The Question which need to call.
1206 @param Action The action request.
1207 @param SkipSaveOrDiscard Whether skip save or discard action.
1209 @retval EFI_SUCCESS The call back function excutes successfully.
1210 @return Other value if the call back function failed to excute.
1213 ProcessCallBackFunction (
1214 IN OUT UI_MENU_SELECTION
*Selection
,
1215 IN FORM_BROWSER_FORMSET
*FormSet
,
1216 IN FORM_BROWSER_FORM
*Form
,
1217 IN FORM_BROWSER_STATEMENT
*Question
,
1218 IN EFI_BROWSER_ACTION Action
,
1219 IN BOOLEAN SkipSaveOrDiscard
1223 Call the retrieve type call back function for one question to get the initialize data.
1225 This function only used when in the initialize stage, because in this stage, the
1226 Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.
1228 @param ConfigAccess The config access protocol produced by the hii driver.
1229 @param Statement The Question which need to call.
1230 @param FormSet The formset this question belong to.
1232 @retval EFI_SUCCESS The call back function excutes successfully.
1233 @return Other value if the call back function failed to excute.
1236 ProcessRetrieveForQuestion (
1237 IN EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
,
1238 IN FORM_BROWSER_STATEMENT
*Statement
,
1239 IN FORM_BROWSER_FORMSET
*FormSet
1243 Find the matched FormSet context in the backup maintain list based on HiiHandle.
1245 @param Handle The Hii Handle.
1247 @return the found FormSet context. If no found, NULL will return.
1250 FORM_BROWSER_FORMSET
*
1251 GetFormSetFromHiiHandle (
1252 EFI_HII_HANDLE Handle
1256 Check whether the input HII handle is the FormSet that is being used.
1258 @param Handle The Hii Handle.
1260 @retval TRUE HII handle is being used.
1261 @retval FALSE HII handle is not being used.
1265 IsHiiHandleInBrowserContext (
1266 EFI_HII_HANDLE Handle
1270 Configure what scope the hot key will impact.
1271 All hot keys have the same scope. The mixed hot keys with the different level are not supported.
1272 If no scope is set, the default scope will be FormSet level.
1273 After all registered hot keys are removed, previous Scope can reset to another level.
1275 @param[in] Scope Scope level to be set.
1277 @retval EFI_SUCCESS Scope is set correctly.
1278 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE.
1279 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.
1285 IN BROWSER_SETTING_SCOPE Scope
1289 Register the hot key with its browser action, or unregistered the hot key.
1290 Only support hot key that is not printable character (control key, function key, etc.).
1291 If the action value is zero, the hot key will be unregistered if it has been registered.
1292 If the same hot key has been registered, the new action and help string will override the previous ones.
1294 @param[in] KeyData A pointer to a buffer that describes the keystroke
1295 information for the hot key. Its type is EFI_INPUT_KEY to
1296 be supported by all ConsoleIn devices.
1297 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed.
1298 @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.
1299 @param[in] HelpString Help string that describes the hot key information.
1300 Its value may be NULL for the unregistered hot key.
1302 @retval EFI_SUCCESS Hot key is registered or unregistered.
1303 @retval EFI_INVALID_PARAMETER KeyData is NULL.
1304 @retval EFI_NOT_FOUND KeyData is not found to be unregistered.
1305 @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.
1310 IN EFI_INPUT_KEY
*KeyData
,
1312 IN UINT16 DefaultId
,
1313 IN EFI_STRING HelpString OPTIONAL
1317 Register Exit handler function.
1318 When more than one handler function is registered, the latter one will override the previous one.
1319 When NULL handler is specified, the previous Exit handler will be unregistered.
1321 @param[in] Handler Pointer to handler function.
1326 RegiserExitHandler (
1327 IN EXIT_HANDLER Handler
1332 Check whether the browser data has been modified.
1334 @retval TRUE Browser data is changed.
1335 @retval FALSE No browser data is changed.
1340 IsBrowserDataModified (
1346 Execute the action requested by the Action parameter.
1348 @param[in] Action Execute the request action.
1349 @param[in] DefaultId The default Id info when need to load default value.
1351 @retval EFI_SUCCESS Execute the request action succss.
1352 @retval EFI_INVALID_PARAMETER The input action value is invalid.
1363 Create reminder to let user to choose save or discard the changed browser data.
1364 Caller can use it to actively check the changed browser data.
1366 @retval BROWSER_NO_CHANGES No browser data is changed.
1367 @retval BROWSER_SAVE_CHANGES The changed browser data is saved.
1368 @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
1369 @retval BROWSER_KEEP_CURRENT Browser keep current changes.
1379 Check whether the Reset Required for the browser
1381 @retval TRUE Browser required to reset after exit.
1382 @retval FALSE Browser not need to reset after exit.
1392 Find the registered HotKey based on KeyData.
1394 @param[in] KeyData A pointer to a buffer that describes the keystroke
1395 information for the hot key.
1397 @return The registered HotKey context. If no found, NULL will return.
1400 GetHotKeyFromRegisterList (
1401 IN EFI_INPUT_KEY
*KeyData
1406 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1408 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1410 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1413 FORM_BROWSER_STATEMENT
*
1414 GetBrowserStatement (
1415 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1419 Password may be stored as encrypted by Configuration Driver. When change a
1420 password, user will be challenged with old password. To validate user input old
1421 password, we will send the clear text to Configuration Driver via Callback().
1422 Configuration driver is responsible to check the passed in password and return
1423 the validation result. If validation pass, state machine in password Callback()
1424 will transit from BROWSER_STATE_VALIDATE_PASSWORD to BROWSER_STATE_SET_PASSWORD.
1425 After user type in new password twice, Callback() will be invoked to send the
1426 new password to Configuration Driver.
1428 @param Selection Pointer to UI_MENU_SELECTION.
1429 @param MenuOption The MenuOption for this password Question.
1430 @param String The clear text of password.
1432 @retval EFI_NOT_AVAILABLE_YET Callback() request to terminate password input.
1433 @return In state of BROWSER_STATE_VALIDATE_PASSWORD:
1434 @retval EFI_SUCCESS Password correct, Browser will prompt for new
1436 @retval EFI_NOT_READY Password incorrect, Browser will show error
1438 @retval Other Browser will do nothing.
1439 @return In state of BROWSER_STATE_SET_PASSWORD:
1440 @retval EFI_SUCCESS Set password success.
1441 @retval Other Set password failed.
1446 IN UI_MENU_SELECTION
*Selection
,
1447 IN FORM_BROWSER_STATEMENT
*Question
,
1452 Display error message for invalid password.
1461 The worker function that send the displays to the screen. On output,
1462 the selection made by user is returned.
1464 @param Selection On input, Selection tell setup browser the information
1465 about the Selection, form and formset to be displayed.
1466 On output, Selection return the screen item that is selected
1469 @retval EFI_SUCCESS The page is displayed successfully.
1470 @return Other value if the page failed to be diplayed.
1475 IN OUT UI_MENU_SELECTION
*Selection
1479 Free up the resource allocated for all strings required
1484 FreeBrowserStrings (
1489 Create a menu with specified formset GUID and form ID, and add it as a child
1490 of the given parent menu.
1492 @param HiiHandle Hii handle related to this formset.
1493 @param FormSetGuid The Formset Guid of menu to be added.
1494 @param FormId The Form ID of menu to be added.
1495 @param QuestionId The question id of this menu to be added.
1497 @return A pointer to the newly added menu or NULL if memory is insufficient.
1502 IN EFI_HII_HANDLE HiiHandle
,
1503 IN EFI_GUID
*FormSetGuid
,
1505 IN UINT16 QuestionId
1509 Search Menu with given FormSetGuid and FormId in all cached menu list.
1511 @param HiiHandle HiiHandle for FormSet.
1512 @param FormSetGuid The Formset GUID of the menu to search.
1513 @param FormId The Form ID of menu to search.
1515 @return A pointer to menu found or NULL if not found.
1520 IN EFI_HII_HANDLE HiiHandle
,
1521 IN EFI_GUID
*FormSetGuid
,
1526 Free Menu list linked list.
1528 @param MenuListHead One Menu list point in the menu list.
1533 LIST_ENTRY
*MenuListHead
1537 Find parent menu for current menu.
1539 @param CurrentMenu Current Menu
1540 @param SettingLevel Whether find parent menu in Form Level or Formset level.
1541 In form level, just find the parent menu;
1542 In formset level, find the parent menu which has different
1545 @retval The parent menu for current menu.
1549 IN FORM_ENTRY_INFO
*CurrentMenu
,
1550 IN BROWSER_SETTING_SCOPE SettingLevel
1554 Validate the HiiHandle.
1556 @param HiiHandle The input HiiHandle which need to validate.
1558 @retval TRUE The handle is validate.
1559 @retval FALSE The handle is invalidate.
1564 EFI_HII_HANDLE HiiHandle
1568 Copy current Menu list to the new menu list.
1570 @param NewMenuListHead New create Menu list.
1571 @param CurrentMenuListHead Current Menu list.
1576 OUT LIST_ENTRY
*NewMenuListHead
,
1577 IN LIST_ENTRY
*CurrentMenuListHead
1581 Search an Option of a Question by its value.
1583 @param Question The Question
1584 @param OptionValue Value for Option to be searched.
1586 @retval Pointer Pointer to the found Option.
1587 @retval NULL Option not found.
1592 IN FORM_BROWSER_STATEMENT
*Question
,
1593 IN EFI_HII_VALUE
*OptionValue
1596 Return data element in an Array by its Index.
1598 @param Array The data array.
1599 @param Type Type of the data in this array.
1600 @param Index Zero based index for data in this array.
1602 @retval Value The data to be returned
1613 Set value of a data element in an Array by its Index.
1615 @param Array The data array.
1616 @param Type Type of the data in this array.
1617 @param Index Zero based index for data in this array.
1618 @param Value The value to be set.
1630 Compare two Hii value.
1632 @param Value1 Expression value to compare on left-hand.
1633 @param Value2 Expression value to compare on right-hand.
1634 @param Result Return value after compare.
1635 retval 0 Two operators equal.
1636 return Positive value if Value1 is greater than Value2.
1637 retval Negative value if Value1 is less than Value2.
1638 @param HiiHandle Only required for string compare.
1640 @retval other Could not perform compare on two values.
1641 @retval EFI_SUCCESS Compare the value success.
1646 IN EFI_HII_VALUE
*Value1
,
1647 IN EFI_HII_VALUE
*Value2
,
1649 IN EFI_HII_HANDLE HiiHandle OPTIONAL
1653 Perform Password check.
1654 Passwork may be encrypted by driver that requires the specific check.
1656 @param Form Form where Password Statement is in.
1657 @param Statement Password statement
1658 @param PasswordString Password string to be checked. It may be NULL.
1659 NULL means to restore password.
1660 "" string can be used to checked whether old password does exist.
1662 @return Status Status of Password check.
1667 IN FORM_DISPLAY_ENGINE_FORM
*Form
,
1668 IN FORM_DISPLAY_ENGINE_STATEMENT
*Statement
,
1669 IN EFI_STRING PasswordString OPTIONAL
1674 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1676 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1678 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1681 FORM_BROWSER_STATEMENT
*
1682 GetBrowserStatement (
1683 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1688 Initialize the Display form structure data.
1692 InitializeDisplayFormData (
1698 Base on the current formset info, clean the ConfigRequest string in browser storage.
1700 @param FormSet Pointer of the FormSet
1704 CleanBrowserStorage (
1705 IN OUT FORM_BROWSER_FORMSET
*FormSet
1709 Find HII Handle in the HII database associated with given Device Path.
1711 If DevicePath is NULL, then ASSERT.
1713 @param DevicePath Device Path associated with the HII package list
1715 @param FormsetGuid The formset guid for this formset.
1717 @retval Handle HII package list Handle associated with the Device
1719 @retval NULL Hii Package list handle is not found.
1723 DevicePathToHiiHandle (
1724 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1725 IN EFI_GUID
*FormsetGuid
1729 Adjust the config request info, remove the request elements which already in AllConfigRequest string.
1731 @param Storage Form set Storage.
1732 @param Request The input request string.
1733 @param RespString Whether the input is ConfigRequest or ConfigResp format.
1735 @retval TRUE Has element not covered by current used elements, need to continue to call ExtractConfig
1736 @retval FALSE All elements covered by current used elements.
1740 ConfigRequestAdjust (
1741 IN BROWSER_STORAGE
*Storage
,
1743 IN BOOLEAN RespString
1747 Perform question check.
1749 If one question has more than one check, process form high priority to low.
1751 @param FormSet FormSet data structure.
1752 @param Form Form data structure.
1753 @param Question The Question to be validated.
1755 @retval EFI_SUCCESS Form validation pass.
1756 @retval other Form validation failed.
1760 ValueChangedValidation (
1761 IN FORM_BROWSER_FORMSET
*FormSet
,
1762 IN FORM_BROWSER_FORM
*Form
,
1763 IN FORM_BROWSER_STATEMENT
*Question
1767 Pop up the error info.
1769 @param BrowserStatus The input browser status.
1770 @param HiiHandle The HiiHandle for this error opcode.
1771 @param OpCode The opcode use to get the erro info and timeout value.
1772 @param ErrorString Error string used by BROWSER_NO_SUBMIT_IF.
1777 IN UINT32 BrowserStatus
,
1778 IN EFI_HII_HANDLE HiiHandle
,
1779 IN EFI_IFR_OP_HEADER
*OpCode
, OPTIONAL
1780 IN CHAR16
*ErrorString
1784 Check whether the result is TRUE or FALSE.
1786 For the EFI_HII_VALUE value type is numeric, return TRUE if the
1789 @param Result Input the result data.
1791 @retval TRUE The result is TRUE.
1792 @retval FALSE The result is FALSE.
1797 IN EFI_HII_VALUE
*Result
1801 Get Formset_storage base on the input varstoreid info.
1803 @param FormSet Pointer of the current FormSet.
1804 @param VarStoreId Varstore ID info.
1806 @return Pointer to a FORMSET_STORAGE data structure.
1810 GetFstStgFromVarId (
1811 IN FORM_BROWSER_FORMSET
*FormSet
,
1812 IN EFI_VARSTORE_ID VarStoreId
1816 Get Formset_storage base on the input browser storage.
1818 More than one formsets may share the same browser storage,
1819 this function just get the first formset storage which
1820 share the browser storage.
1822 @param Storage browser storage info.
1824 @return Pointer to a FORMSET_STORAGE data structure.
1829 GetFstStgFromBrsStg (
1830 IN BROWSER_STORAGE
*Storage