2 Private MACRO, structure and function definitions for Setup Browser module.
4 Copyright (c) 2007 - 2014, 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
*ConfigHdr
; // <ConfigHdr>
154 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
155 // <RequestElement> includes all fields which is used by current form sets.
156 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
159 #define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link, BROWSER_STORAGE_SIGNATURE)
161 #define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')
167 LIST_ENTRY SaveFailLink
;
171 BROWSER_STORAGE
*BrowserStorage
;
173 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
174 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
175 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
176 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
179 #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
180 #define FORMSET_STORAGE_FROM_SAVE_FAIL_LINK(a) CR (a, FORMSET_STORAGE, SaveFailLink, FORMSET_STORAGE_SIGNATURE)
183 EFI_STRING_ID VarName
;
187 #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')
195 UINT8 Format
; // For EFI_IFR_TO_STRING, EFI_IFR_FIND
196 UINT8 Flags
; // For EFI_IFR_SPAN
197 UINT8 RuleId
; // For EFI_IFR_RULE_REF
199 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
201 EFI_QUESTION_ID QuestionId
; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1
202 EFI_QUESTION_ID QuestionId2
;
204 UINT16 ListLength
; // For EFI_IFR_EQ_ID_VAL_LIST
207 EFI_STRING_ID DevicePath
; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
210 BROWSER_STORAGE
*VarStorage
; // For EFI_IFR_SET, EFI_IFR_GET
211 VAR_STORE_INFO VarStoreInfo
;// For EFI_IFR_SET, EFI_IFR_GET
212 UINT8 ValueType
; // For EFI_IFR_SET, EFI_IFR_GET
213 UINT8 ValueWidth
; // For EFI_IFR_SET, EFI_IFR_GET
214 CHAR16
*ValueName
; // For EFI_IFR_SET, EFI_IFR_GET
215 LIST_ENTRY MapExpressionList
; // nested expressions inside of Map opcode.
218 #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)
220 #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')
226 UINT8 Type
; // Type for this expression
228 UINT8 RuleId
; // For EFI_IFR_RULE only
229 EFI_STRING_ID Error
; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only
231 EFI_HII_VALUE Result
; // Expression evaluation result
233 UINT8 TimeOut
; // For EFI_IFR_WARNING_IF
234 EFI_IFR_OP_HEADER
*OpCode
; // Save the opcode buffer.
236 LIST_ENTRY OpCodeListHead
; // OpCodes consist of this expression (EXPRESSION_OPCODE)
239 #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)
241 #define FORM_EXPRESSION_LIST_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'R')
246 FORM_EXPRESSION
*Expression
[1]; // Array[Count] of expressions
247 } FORM_EXPRESSION_LIST
;
249 #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')
256 EFI_HII_VALUE Value
; // Default value
258 FORM_EXPRESSION
*ValueExpression
; // Not-NULL indicates default value is provided by EFI_IFR_VALUE
261 #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)
263 #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')
269 EFI_IFR_ONE_OF_OPTION
*OpCode
; // OneOfOption Data
274 EFI_IMAGE_ID ImageId
;
276 FORM_EXPRESSION_LIST
*SuppressExpression
; // Non-NULL indicates nested inside of SuppressIf
279 #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
295 typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT
;
297 #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
299 struct _FORM_BROWSER_STATEMENT
{
303 UINT8 Operand
; // The operand (first byte) of this Statement or Question
304 EFI_IFR_OP_HEADER
*OpCode
;
309 EFI_STRING_ID Prompt
;
311 EFI_STRING_ID TextTwo
; // For EFI_IFR_TEXT
314 // Fake Question Id, used for statement not has true QuestionId.
316 EFI_QUESTION_ID FakeQuestionId
;
321 EFI_QUESTION_ID QuestionId
; // The value of zero is reserved
322 EFI_VARSTORE_ID VarStoreId
; // A value of zero indicates no variable storage
323 BROWSER_STORAGE
*Storage
;
324 VAR_STORE_INFO VarStoreInfo
;
327 CHAR16
*VariableName
; // Name/Value or EFI Variable name
328 CHAR16
*BlockName
; // Buffer storage block name: "OFFSET=...WIDTH=..."
330 EFI_HII_VALUE HiiValue
; // Edit copy for checkbox, numberic, oneof
331 UINT8
*BufferValue
; // Edit copy for string, password, orderedlist
332 UINT8 ValueType
; // Data type for orderedlist value array
335 // OpCode specific members
337 UINT8 Flags
; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
338 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
339 UINT8 MaxContainers
; // for EFI_IFR_ORDERED_LIST
341 UINT16 BannerLineNumber
; // for EFI_IFR_BANNER, 1-based line number
342 EFI_STRING_ID QuestionConfig
; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed
344 UINT64 Minimum
; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
345 UINT64 Maximum
; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
348 EFI_DEFAULT_ID DefaultId
; // for EFI_IFR_RESET_BUTTON
349 EFI_GUID RefreshGuid
; // for EFI_IFR_REFRESH_ID
350 BOOLEAN Locked
; // Whether this statement is locked.
351 BOOLEAN ValueChanged
; // Whether this statement's value is changed.
353 // Get from IFR parsing
355 FORM_EXPRESSION
*ValueExpression
; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
356 LIST_ENTRY DefaultListHead
; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
357 LIST_ENTRY OptionListHead
; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
359 EFI_IMAGE_ID ImageId
; // nested EFI_IFR_IMAGE
360 UINT8 RefreshInterval
; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
362 FORM_BROWSER_STATEMENT
*ParentStatement
;
364 LIST_ENTRY InconsistentListHead
;// nested inconsistent expression list (FORM_EXPRESSION)
365 LIST_ENTRY NoSubmitListHead
; // nested nosubmit expression list (FORM_EXPRESSION)
366 LIST_ENTRY WarningListHead
; // nested warning expression list (FORM_EXPRESSION)
367 FORM_EXPRESSION_LIST
*Expression
; // nesting inside of GrayOutIf/DisableIf/SuppressIf
369 FORM_EXPRESSION
*ReadExpression
; // nested EFI_IFR_READ, provide this question value by read expression.
370 FORM_EXPRESSION
*WriteExpression
; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
373 #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
375 #define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')
380 LIST_ENTRY SaveFailLink
;
382 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
383 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
384 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
387 BROWSER_STORAGE
*Storage
;
388 } FORM_BROWSER_CONFIG_REQUEST
;
389 #define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
390 #define FORM_BROWSER_CONFIG_REQUEST_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, SaveFailLink, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
392 #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
393 #define STANDARD_MAP_FORM_TYPE 0x01
399 UINT16 FormId
; // FormId of normal form or formmap form.
400 EFI_STRING_ID FormTitle
; // FormTile of normal form, or FormMapMethod title of formmap form.
401 UINT16 FormType
; // Specific form type for the different form.
403 EFI_IMAGE_ID ImageId
;
405 BOOLEAN ModalForm
; // Whether this is a modal form.
406 BOOLEAN Locked
; // Whether this form is locked.
408 LIST_ENTRY FormViewListHead
; // List of type FORMID_INFO is Browser View Form History List.
409 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
410 LIST_ENTRY StatementListHead
; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
411 LIST_ENTRY ConfigRequestHead
; // List of configreques for all storage.
412 FORM_EXPRESSION_LIST
*SuppressExpression
; // nesting inside of SuppressIf
415 #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)
417 #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')
424 EFI_STRING_ID DefaultName
;
425 } FORMSET_DEFAULTSTORE
;
427 #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)
429 #define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S')
434 LIST_ENTRY SaveFailLink
;
436 EFI_HII_HANDLE HiiHandle
; // unique id for formset.
437 EFI_HANDLE DriverHandle
;
438 EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
;
439 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
441 UINTN IfrBinaryLength
;
442 UINT8
*IfrBinaryData
;
444 BOOLEAN QuestionInited
; // Have finished question initilization?
446 EFI_STRING_ID FormSetTitle
;
448 UINT8 NumberOfClassGuid
;
449 EFI_GUID ClassGuid
[3]; // Up to three ClassGuid
450 UINT16 Class
; // Tiano extended Class code
451 UINT16 SubClass
; // Tiano extended Subclass code
452 EFI_IMAGE_ID ImageId
;
454 FORM_BROWSER_STATEMENT
*StatementBuffer
; // Buffer for all Statements and Questions
455 EXPRESSION_OPCODE
*ExpressionBuffer
; // Buffer for all Expression OpCode
456 FORM_BROWSER_FORM
*SaveFailForm
; // The form which failed to save.
457 FORM_BROWSER_STATEMENT
*SaveFailStatement
; // The Statement which failed to save.
459 LIST_ENTRY StatementListOSF
; // Statement list out side of the form.
460 LIST_ENTRY StorageListHead
; // Storage list (FORMSET_STORAGE)
461 LIST_ENTRY SaveFailStorageListHead
; // Storage list for the save fail storage.
462 LIST_ENTRY DefaultStoreListHead
; // DefaultStore list (FORMSET_DEFAULTSTORE)
463 LIST_ENTRY FormListHead
; // Form list (FORM_BROWSER_FORM)
464 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
465 } FORM_BROWSER_FORMSET
;
466 #define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)
468 #define FORM_BROWSER_FORMSET_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_FORMSET, SaveFailLink, FORM_BROWSER_FORMSET_SIGNATURE)
472 EFI_EVENT RefreshEvent
;
473 } FORM_BROWSER_REFRESH_EVENT_NODE
;
475 #define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)
479 EFI_HII_HANDLE Handle
;
482 // Target formset/form/Question information
484 EFI_GUID FormSetGuid
;
487 UINTN Sequence
; // used for time/date only.
496 // Ation for Browser to taken:
497 // UI_ACTION_NONE - navigation inside a form
498 // UI_ACTION_REFRESH_FORM - re-evaluate expressions and repaint form
499 // UI_ACTION_REFRESH_FORMSET - re-parse formset IFR binary
504 // Current selected fomset/form/Question
506 FORM_BROWSER_FORMSET
*FormSet
;
507 FORM_BROWSER_FORM
*Form
;
508 FORM_BROWSER_STATEMENT
*Statement
;
511 // Whether the Form is editable
513 BOOLEAN FormEditable
;
515 FORM_ENTRY_INFO
*CurrentMenu
;
518 #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
525 // Globals defined in Setup.c
527 BOOLEAN ResetRequired
;
528 BOOLEAN ExitRequired
;
529 EFI_HII_HANDLE HiiHandle
;
530 EFI_GUID FormSetGuid
;
532 UI_MENU_SELECTION
*Selection
;
534 LIST_ENTRY FormHistoryList
;
537 #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
540 // Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.
543 GetDefaultForNoStorage
, // Get default value for question which not has storage.
544 GetDefaultForStorage
, // Get default value for question which has storage.
545 GetDefaultForAll
, // Get default value for all questions.
546 GetDefaultForMax
// Invalid value.
547 } BROWSER_GET_DEFAULT_VALUE
;
550 // Get/set question value from/to.
553 GetSetValueWithEditBuffer
= 0, // Get/Set question value from/to editbuffer in the storage.
554 GetSetValueWithBuffer
, // Get/Set question value from/to buffer in the storage.
555 GetSetValueWithHiiDriver
, // Get/Set question value from/to hii driver.
556 GetSetValueWithBothBuffer
, // Compare the editbuffer with buffer for this question, not use the question value.
557 GetSetValueWithMax
// Invalid value.
558 } GET_SET_QUESTION_VALUE_WITH
;
560 extern EFI_HII_DATABASE_PROTOCOL
*mHiiDatabase
;
561 extern EFI_HII_CONFIG_ROUTING_PROTOCOL
*mHiiConfigRouting
;
562 extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL
*mPathFromText
;
563 extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL
*mFormDisplay
;
565 extern BOOLEAN gResetRequired
;
566 extern BOOLEAN gExitRequired
;
567 extern LIST_ENTRY gBrowserFormSetList
;
568 extern LIST_ENTRY gBrowserHotKeyList
;
569 extern BROWSER_SETTING_SCOPE gBrowserSettingScope
;
570 extern EXIT_HANDLER ExitHandlerFunction
;
571 extern EFI_HII_HANDLE mCurrentHiiHandle
;
572 extern SETUP_DRIVER_PRIVATE_DATA mPrivateData
;
574 // Browser Global Strings
576 extern CHAR16
*gEmptyString
;
578 extern EFI_GUID gZeroGuid
;
580 extern UI_MENU_SELECTION
*gCurrentSelection
;
583 // Global Procedure Defines
585 #include "Expression.h"
588 Initialize the HII String Token to the correct values.
592 InitializeBrowserStrings (
597 Parse opcodes in the formset IFR binary.
599 @param FormSet Pointer of the FormSet data structure.
601 @retval EFI_SUCCESS Opcode parse success.
602 @retval Other Opcode parse fail.
607 IN FORM_BROWSER_FORMSET
*FormSet
611 Free resources allocated for a FormSet.
613 @param FormSet Pointer of the FormSet
618 IN OUT FORM_BROWSER_FORMSET
*FormSet
623 Create a new string in HII Package List.
625 @param String The String to be added
626 @param HiiHandle The package list in the HII database to insert the
629 @return The output string.
635 IN EFI_HII_HANDLE HiiHandle
639 Delete a string from HII Package List.
641 @param StringId Id of the string in HII database.
642 @param HiiHandle The HII package list handle.
644 @retval EFI_SUCCESS The string was deleted successfully.
649 IN EFI_STRING_ID StringId
,
650 IN EFI_HII_HANDLE HiiHandle
654 Get the string based on the StringId and HII Package List Handle.
656 @param Token The String's ID.
657 @param HiiHandle The package list in the HII database to search for
658 the specified string.
660 @return The output string.
665 IN EFI_STRING_ID Token
,
666 IN EFI_HII_HANDLE HiiHandle
670 Get Value for given Name from a NameValue Storage.
672 @param Storage The NameValue Storage.
673 @param Name The Name.
674 @param Value The retured Value.
675 @param GetValueFrom Where to get source value, from EditValue or Value.
677 @retval EFI_SUCCESS Value found for given Name.
678 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
683 IN BROWSER_STORAGE
*Storage
,
685 IN OUT CHAR16
**Value
,
686 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
690 Set Value of given Name in a NameValue Storage.
692 @param Storage The NameValue Storage.
693 @param Name The Name.
694 @param Value The Value to set.
695 @param SetValueTo Whether update editValue or Value.
696 @param ReturnNode The node use the input name.
698 @retval EFI_SUCCESS Value found for given Name.
699 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
704 IN BROWSER_STORAGE
*Storage
,
707 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
,
708 OUT NAME_VALUE_NODE
**ReturnNode
712 Validate whether this question's value has changed.
714 @param FormSet FormSet data structure.
715 @param Form Form data structure.
716 @param Question Question to be initialized.
717 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
719 @retval TRUE Question's value has changed.
720 @retval FALSE Question's value has not changed
724 IsQuestionValueChanged (
725 IN FORM_BROWSER_FORMSET
*FormSet
,
726 IN FORM_BROWSER_FORM
*Form
,
727 IN OUT FORM_BROWSER_STATEMENT
*Question
,
728 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
732 Validate the FormSet. If the formset is not validate, remove it from the list.
734 @param FormSet The input FormSet which need to validate.
736 @retval TRUE The handle is validate.
737 @retval FALSE The handle is invalidate.
742 FORM_BROWSER_FORMSET
*FormSet
746 Update the ValueChanged status for questions.
748 @param FormSet FormSet data structure.
749 @param Form Form data structure.
750 @param SettingScope Setting Scope for Default action.
754 UpdateStatementStatus (
755 IN FORM_BROWSER_FORMSET
*FormSet
,
756 IN FORM_BROWSER_FORM
*Form
,
757 IN BROWSER_SETTING_SCOPE SettingScope
761 Get Question's current Value.
763 @param FormSet FormSet data structure.
764 @param Form Form data structure.
765 @param Question Question to be initialized.
766 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
768 @retval EFI_SUCCESS The function completed successfully.
773 IN FORM_BROWSER_FORMSET
*FormSet
,
774 IN FORM_BROWSER_FORM
*Form
,
775 IN OUT FORM_BROWSER_STATEMENT
*Question
,
776 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
780 Save Question Value to edit copy(cached) or Storage(uncached).
782 @param FormSet FormSet data structure.
783 @param Form Form data structure.
784 @param Question Pointer to the Question.
785 @param SetValueTo Update the question value to editbuffer , buffer or hii driver.
787 @retval EFI_SUCCESS The function completed successfully.
792 IN FORM_BROWSER_FORMSET
*FormSet
,
793 IN FORM_BROWSER_FORM
*Form
,
794 IN OUT FORM_BROWSER_STATEMENT
*Question
,
795 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
799 Perform inconsistent check for a Form.
801 @param FormSet FormSet data structure.
802 @param Form Form data structure.
803 @param Question The Question to be validated.
804 @param Type Validation type: InConsistent or NoSubmit
806 @retval EFI_SUCCESS Form validation pass.
807 @retval other Form validation failed.
812 IN FORM_BROWSER_FORMSET
*FormSet
,
813 IN FORM_BROWSER_FORM
*Form
,
814 IN FORM_BROWSER_STATEMENT
*Question
,
820 Discard data based on the input setting scope (Form, FormSet or System).
822 @param FormSet FormSet data structure.
823 @param Form Form data structure.
824 @param SettingScope Setting Scope for Discard action.
826 @retval EFI_SUCCESS The function completed successfully.
827 @retval EFI_UNSUPPORTED Unsupport SettingScope.
832 IN FORM_BROWSER_FORMSET
*FormSet
,
833 IN FORM_BROWSER_FORM
*Form
,
834 IN BROWSER_SETTING_SCOPE SettingScope
838 Submit data based on the input Setting level (Form, FormSet or System).
840 @param FormSet FormSet data structure.
841 @param Form Form data structure.
842 @param SettingScope Setting Scope for Submit action.
844 @retval EFI_SUCCESS The function completed successfully.
845 @retval EFI_UNSUPPORTED Unsupport SettingScope.
850 IN FORM_BROWSER_FORMSET
*FormSet
,
851 IN FORM_BROWSER_FORM
*Form
,
852 IN BROWSER_SETTING_SCOPE SettingScope
856 Reset Question to its default value.
858 @param FormSet The form set.
859 @param Form The form.
860 @param Question The question.
861 @param DefaultId The Class of the default.
863 @retval EFI_SUCCESS Question is reset to default value.
868 IN FORM_BROWSER_FORMSET
*FormSet
,
869 IN FORM_BROWSER_FORM
*Form
,
870 IN FORM_BROWSER_STATEMENT
*Question
,
875 Get current setting of Questions.
877 @param FormSet FormSet data structure.
881 InitializeCurrentSetting (
882 IN OUT FORM_BROWSER_FORMSET
*FormSet
886 Initialize the internal data structure of a FormSet.
888 @param Handle PackageList Handle
889 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
890 GUID), take the first FormSet found in package
892 @param FormSet FormSet data structure.
894 @retval EFI_SUCCESS The function completed successfully.
895 @retval EFI_NOT_FOUND The specified FormSet could not be found.
900 IN EFI_HII_HANDLE Handle
,
901 IN OUT EFI_GUID
*FormSetGuid
,
902 OUT FORM_BROWSER_FORMSET
*FormSet
906 Reset Questions to their initial value or default value in a Form, Formset or System.
908 GetDefaultValueScope parameter decides which questions will reset
909 to its default value.
911 @param FormSet FormSet data structure.
912 @param Form Form data structure.
913 @param DefaultId The Class of the default.
914 @param SettingScope Setting Scope for Default action.
915 @param GetDefaultValueScope Get default value scope.
916 @param Storage Get default value only for this storage.
917 @param RetrieveValueFirst Whether call the retrieve call back to
918 get the initial value before get default
921 @retval EFI_SUCCESS The function completed successfully.
922 @retval EFI_UNSUPPORTED Unsupport SettingScope.
927 IN FORM_BROWSER_FORMSET
*FormSet
,
928 IN FORM_BROWSER_FORM
*Form
,
930 IN BROWSER_SETTING_SCOPE SettingScope
,
931 IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope
,
932 IN BROWSER_STORAGE
*Storage
,
933 IN BOOLEAN RetrieveValueFirst
937 Initialize Question's Edit copy from Storage.
939 @param Selection Selection contains the information about
940 the Selection, form and formset to be displayed.
941 Selection action may be updated in retrieve callback.
942 If Selection is NULL, only initialize Question value.
943 @param FormSet FormSet data structure.
944 @param Form Form data structure.
946 @retval EFI_SUCCESS The function completed successfully.
951 IN OUT UI_MENU_SELECTION
*Selection
,
952 IN FORM_BROWSER_FORMSET
*FormSet
,
953 IN FORM_BROWSER_FORM
*Form
957 Initialize Question's Edit copy from Storage for the whole Formset.
959 @param Selection Selection contains the information about
960 the Selection, form and formset to be displayed.
961 Selection action may be updated in retrieve callback.
962 If Selection is NULL, only initialize Question value.
963 @param FormSet FormSet data structure.
965 @retval EFI_SUCCESS The function completed successfully.
970 IN OUT UI_MENU_SELECTION
*Selection
,
971 IN FORM_BROWSER_FORMSET
*FormSet
975 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
977 @param Storage The Storage to be conveted.
978 @param ConfigResp The returned <ConfigResp>.
979 @param ConfigRequest The ConfigRequest string.
980 @param GetEditBuf Get the data from editbuffer or buffer.
982 @retval EFI_SUCCESS Convert success.
983 @retval EFI_INVALID_PARAMETER Incorrect storage type.
987 StorageToConfigResp (
988 IN BROWSER_STORAGE
*Storage
,
989 IN CHAR16
**ConfigResp
,
990 IN CHAR16
*ConfigRequest
,
991 IN BOOLEAN GetEditBuf
995 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
997 @param Storage The Storage to receive the settings.
998 @param ConfigResp The <ConfigResp> to be converted.
1000 @retval EFI_SUCCESS Convert success.
1001 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1005 ConfigRespToStorage (
1006 IN BROWSER_STORAGE
*Storage
,
1007 IN CHAR16
*ConfigResp
1011 Fill storage's edit copy with settings requested from Configuration Driver.
1013 @param FormSet FormSet data structure.
1014 @param Storage Buffer Storage.
1019 IN FORM_BROWSER_FORMSET
*FormSet
,
1020 IN FORMSET_STORAGE
*Storage
1024 Fetch the Ifr binary data of a FormSet.
1026 @param Handle PackageList Handle
1027 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1028 GUID), take the first FormSet found in package
1030 @param BinaryLength The length of the FormSet IFR binary.
1031 @param BinaryData The buffer designed to receive the FormSet.
1033 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
1034 BufferLength was updated.
1035 @retval EFI_INVALID_PARAMETER The handle is unknown.
1036 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
1037 be found with the requested FormId.
1042 IN EFI_HII_HANDLE Handle
,
1043 IN OUT EFI_GUID
*FormSetGuid
,
1044 OUT UINTN
*BinaryLength
,
1045 OUT UINT8
**BinaryData
1049 Save globals used by previous call to SendForm(). SendForm() may be called from
1050 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.
1051 So, save globals of previous call to SendForm() and restore them upon exit.
1055 SaveBrowserContext (
1060 Restore globals used by previous call to SendForm().
1064 RestoreBrowserContext (
1069 This is the routine which an external caller uses to direct the browser
1070 where to obtain it's information.
1073 @param This The Form Browser protocol instanse.
1074 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
1075 display a list of the formsets for the handles specified.
1076 @param HandleCount The number of Handles specified in Handle.
1077 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
1078 field in the EFI_IFR_FORM_SET op-code for the specified
1079 forms-based package. If FormSetGuid is NULL, then this
1080 function will display the first found forms package.
1081 @param FormId This field specifies which EFI_IFR_FORM to render as the first
1082 displayable page. If this field has a value of 0x0000, then
1083 the forms browser will render the specified forms in their encoded order.
1084 ScreenDimenions - This allows the browser to be called so that it occupies a
1085 portion of the physical screen instead of dynamically determining the screen dimensions.
1086 ActionRequest - Points to the action recommended by the form.
1087 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
1089 @param ActionRequest Points to the action recommended by the form.
1091 @retval EFI_SUCCESS The function completed successfully.
1092 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1093 @retval EFI_NOT_FOUND No valid forms could be found to display.
1099 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1100 IN EFI_HII_HANDLE
*Handles
,
1101 IN UINTN HandleCount
,
1102 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1103 IN UINT16 FormId
, OPTIONAL
1104 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions
, OPTIONAL
1105 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1109 This function is called by a callback handler to retrieve uncommitted state
1110 data from the browser.
1112 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1114 @param ResultsDataSize A pointer to the size of the buffer associated
1116 @param ResultsData A string returned from an IFR browser or
1117 equivalent. The results string will have no
1118 routing information in them.
1119 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1120 (if RetrieveData = TRUE) data from the uncommitted
1121 browser state information or set (if RetrieveData
1122 = FALSE) data in the uncommitted browser state
1124 @param VariableGuid An optional field to indicate the target variable
1126 @param VariableName An optional field to indicate the target
1127 human-readable variable name.
1129 @retval EFI_SUCCESS The results have been distributed or are awaiting
1131 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1132 contain the results data.
1138 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1139 IN OUT UINTN
*ResultsDataSize
,
1140 IN OUT EFI_STRING ResultsData
,
1141 IN BOOLEAN RetrieveData
,
1142 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
1143 IN CONST CHAR16
*VariableName OPTIONAL
1147 Find menu which will show next time.
1149 @param Selection On input, Selection tell setup browser the information
1150 about the Selection, form and formset to be displayed.
1151 On output, Selection return the screen item that is selected
1153 @param SettingLevel Input Settting level, if it is FormLevel, just exit current form.
1154 else, we need to exit current formset.
1156 @retval TRUE Exit current form.
1157 @retval FALSE User press ESC and keep in current form.
1161 IN OUT UI_MENU_SELECTION
*Selection
,
1162 IN BROWSER_SETTING_SCOPE SettingLevel
1166 check whether the form need to update the NV.
1168 @param Form Form data structure.
1170 @retval TRUE Need to update the NV.
1171 @retval FALSE No need to update the NV.
1174 IsNvUpdateRequiredForForm (
1175 IN FORM_BROWSER_FORM
*Form
1179 check whether the formset need to update the NV.
1181 @param FormSet FormSet data structure.
1183 @retval TRUE Need to update the NV.
1184 @retval FALSE No need to update the NV.
1187 IsNvUpdateRequiredForFormSet (
1188 IN FORM_BROWSER_FORMSET
*FormSet
1192 Call the call back function for the question and process the return action.
1194 @param Selection On input, Selection tell setup browser the information
1195 about the Selection, form and formset to be displayed.
1196 On output, Selection return the screen item that is selected
1198 @param FormSet The formset this question belong to.
1199 @param Form The form this question belong to.
1200 @param Question The Question which need to call.
1201 @param Action The action request.
1202 @param SkipSaveOrDiscard Whether skip save or discard action.
1204 @retval EFI_SUCCESS The call back function excutes successfully.
1205 @return Other value if the call back function failed to excute.
1208 ProcessCallBackFunction (
1209 IN OUT UI_MENU_SELECTION
*Selection
,
1210 IN FORM_BROWSER_FORMSET
*FormSet
,
1211 IN FORM_BROWSER_FORM
*Form
,
1212 IN FORM_BROWSER_STATEMENT
*Question
,
1213 IN EFI_BROWSER_ACTION Action
,
1214 IN BOOLEAN SkipSaveOrDiscard
1218 Call the retrieve type call back function for one question to get the initialize data.
1220 This function only used when in the initialize stage, because in this stage, the
1221 Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.
1223 @param ConfigAccess The config access protocol produced by the hii driver.
1224 @param Statement The Question which need to call.
1225 @param FormSet The formset this question belong to.
1227 @retval EFI_SUCCESS The call back function excutes successfully.
1228 @return Other value if the call back function failed to excute.
1231 ProcessRetrieveForQuestion (
1232 IN EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
,
1233 IN FORM_BROWSER_STATEMENT
*Statement
,
1234 IN FORM_BROWSER_FORMSET
*FormSet
1238 Find the matched FormSet context in the backup maintain list based on HiiHandle.
1240 @param Handle The Hii Handle.
1242 @return the found FormSet context. If no found, NULL will return.
1245 FORM_BROWSER_FORMSET
*
1246 GetFormSetFromHiiHandle (
1247 EFI_HII_HANDLE Handle
1251 Check whether the input HII handle is the FormSet that is being used.
1253 @param Handle The Hii Handle.
1255 @retval TRUE HII handle is being used.
1256 @retval FALSE HII handle is not being used.
1260 IsHiiHandleInBrowserContext (
1261 EFI_HII_HANDLE Handle
1265 Configure what scope the hot key will impact.
1266 All hot keys have the same scope. The mixed hot keys with the different level are not supported.
1267 If no scope is set, the default scope will be FormSet level.
1268 After all registered hot keys are removed, previous Scope can reset to another level.
1270 @param[in] Scope Scope level to be set.
1272 @retval EFI_SUCCESS Scope is set correctly.
1273 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE.
1274 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.
1280 IN BROWSER_SETTING_SCOPE Scope
1284 Register the hot key with its browser action, or unregistered the hot key.
1285 Only support hot key that is not printable character (control key, function key, etc.).
1286 If the action value is zero, the hot key will be unregistered if it has been registered.
1287 If the same hot key has been registered, the new action and help string will override the previous ones.
1289 @param[in] KeyData A pointer to a buffer that describes the keystroke
1290 information for the hot key. Its type is EFI_INPUT_KEY to
1291 be supported by all ConsoleIn devices.
1292 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed.
1293 @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.
1294 @param[in] HelpString Help string that describes the hot key information.
1295 Its value may be NULL for the unregistered hot key.
1297 @retval EFI_SUCCESS Hot key is registered or unregistered.
1298 @retval EFI_INVALID_PARAMETER KeyData is NULL.
1299 @retval EFI_NOT_FOUND KeyData is not found to be unregistered.
1300 @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.
1305 IN EFI_INPUT_KEY
*KeyData
,
1307 IN UINT16 DefaultId
,
1308 IN EFI_STRING HelpString OPTIONAL
1312 Register Exit handler function.
1313 When more than one handler function is registered, the latter one will override the previous one.
1314 When NULL handler is specified, the previous Exit handler will be unregistered.
1316 @param[in] Handler Pointer to handler function.
1321 RegiserExitHandler (
1322 IN EXIT_HANDLER Handler
1327 Check whether the browser data has been modified.
1329 @retval TRUE Browser data is changed.
1330 @retval FALSE No browser data is changed.
1335 IsBrowserDataModified (
1341 Execute the action requested by the Action parameter.
1343 @param[in] Action Execute the request action.
1344 @param[in] DefaultId The default Id info when need to load default value.
1346 @retval EFI_SUCCESS Execute the request action succss.
1347 @retval EFI_INVALID_PARAMETER The input action value is invalid.
1358 Create reminder to let user to choose save or discard the changed browser data.
1359 Caller can use it to actively check the changed browser data.
1361 @retval BROWSER_NO_CHANGES No browser data is changed.
1362 @retval BROWSER_SAVE_CHANGES The changed browser data is saved.
1363 @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
1364 @retval BROWSER_KEEP_CURRENT Browser keep current changes.
1374 Check whether the Reset Required for the browser
1376 @retval TRUE Browser required to reset after exit.
1377 @retval FALSE Browser not need to reset after exit.
1387 Find the registered HotKey based on KeyData.
1389 @param[in] KeyData A pointer to a buffer that describes the keystroke
1390 information for the hot key.
1392 @return The registered HotKey context. If no found, NULL will return.
1395 GetHotKeyFromRegisterList (
1396 IN EFI_INPUT_KEY
*KeyData
1401 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1403 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1405 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1408 FORM_BROWSER_STATEMENT
*
1409 GetBrowserStatement (
1410 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1414 Password may be stored as encrypted by Configuration Driver. When change a
1415 password, user will be challenged with old password. To validate user input old
1416 password, we will send the clear text to Configuration Driver via Callback().
1417 Configuration driver is responsible to check the passed in password and return
1418 the validation result. If validation pass, state machine in password Callback()
1419 will transit from BROWSER_STATE_VALIDATE_PASSWORD to BROWSER_STATE_SET_PASSWORD.
1420 After user type in new password twice, Callback() will be invoked to send the
1421 new password to Configuration Driver.
1423 @param Selection Pointer to UI_MENU_SELECTION.
1424 @param MenuOption The MenuOption for this password Question.
1425 @param String The clear text of password.
1427 @retval EFI_NOT_AVAILABLE_YET Callback() request to terminate password input.
1428 @return In state of BROWSER_STATE_VALIDATE_PASSWORD:
1429 @retval EFI_SUCCESS Password correct, Browser will prompt for new
1431 @retval EFI_NOT_READY Password incorrect, Browser will show error
1433 @retval Other Browser will do nothing.
1434 @return In state of BROWSER_STATE_SET_PASSWORD:
1435 @retval EFI_SUCCESS Set password success.
1436 @retval Other Set password failed.
1441 IN UI_MENU_SELECTION
*Selection
,
1442 IN FORM_BROWSER_STATEMENT
*Question
,
1447 Display error message for invalid password.
1456 The worker function that send the displays to the screen. On output,
1457 the selection made by user is returned.
1459 @param Selection On input, Selection tell setup browser the information
1460 about the Selection, form and formset to be displayed.
1461 On output, Selection return the screen item that is selected
1464 @retval EFI_SUCCESS The page is displayed successfully.
1465 @return Other value if the page failed to be diplayed.
1470 IN OUT UI_MENU_SELECTION
*Selection
1474 Free up the resource allocated for all strings required
1479 FreeBrowserStrings (
1484 Create a menu with specified formset GUID and form ID, and add it as a child
1485 of the given parent menu.
1487 @param HiiHandle Hii handle related to this formset.
1488 @param FormSetGuid The Formset Guid of menu to be added.
1489 @param FormId The Form ID of menu to be added.
1490 @param QuestionId The question id of this menu to be added.
1492 @return A pointer to the newly added menu or NULL if memory is insufficient.
1497 IN EFI_HII_HANDLE HiiHandle
,
1498 IN EFI_GUID
*FormSetGuid
,
1500 IN UINT16 QuestionId
1504 Search Menu with given FormSetGuid and FormId in all cached menu list.
1506 @param HiiHandle HiiHandle for FormSet.
1507 @param FormSetGuid The Formset GUID of the menu to search.
1508 @param FormId The Form ID of menu to search.
1510 @return A pointer to menu found or NULL if not found.
1515 IN EFI_HII_HANDLE HiiHandle
,
1516 IN EFI_GUID
*FormSetGuid
,
1521 Free Menu list linked list.
1523 @param MenuListHead One Menu list point in the menu list.
1528 LIST_ENTRY
*MenuListHead
1532 Find parent menu for current menu.
1534 @param CurrentMenu Current Menu
1535 @param SettingLevel Whether find parent menu in Form Level or Formset level.
1536 In form level, just find the parent menu;
1537 In formset level, find the parent menu which has different
1540 @retval The parent menu for current menu.
1544 IN FORM_ENTRY_INFO
*CurrentMenu
,
1545 IN BROWSER_SETTING_SCOPE SettingLevel
1549 Validate the HiiHandle.
1551 @param HiiHandle The input HiiHandle which need to validate.
1553 @retval TRUE The handle is validate.
1554 @retval FALSE The handle is invalidate.
1559 EFI_HII_HANDLE HiiHandle
1563 Copy current Menu list to the new menu list.
1565 @param NewMenuListHead New create Menu list.
1566 @param CurrentMenuListHead Current Menu list.
1571 OUT LIST_ENTRY
*NewMenuListHead
,
1572 IN LIST_ENTRY
*CurrentMenuListHead
1576 Search an Option of a Question by its value.
1578 @param Question The Question
1579 @param OptionValue Value for Option to be searched.
1581 @retval Pointer Pointer to the found Option.
1582 @retval NULL Option not found.
1587 IN FORM_BROWSER_STATEMENT
*Question
,
1588 IN EFI_HII_VALUE
*OptionValue
1591 Return data element in an Array by its Index.
1593 @param Array The data array.
1594 @param Type Type of the data in this array.
1595 @param Index Zero based index for data in this array.
1597 @retval Value The data to be returned
1608 Set value of a data element in an Array by its Index.
1610 @param Array The data array.
1611 @param Type Type of the data in this array.
1612 @param Index Zero based index for data in this array.
1613 @param Value The value to be set.
1625 Compare two Hii value.
1627 @param Value1 Expression value to compare on left-hand.
1628 @param Value2 Expression value to compare on right-hand.
1629 @param Result Return value after compare.
1630 retval 0 Two operators equal.
1631 return Positive value if Value1 is greater than Value2.
1632 retval Negative value if Value1 is less than Value2.
1633 @param HiiHandle Only required for string compare.
1635 @retval other Could not perform compare on two values.
1636 @retval EFI_SUCCESS Compare the value success.
1641 IN EFI_HII_VALUE
*Value1
,
1642 IN EFI_HII_VALUE
*Value2
,
1644 IN EFI_HII_HANDLE HiiHandle OPTIONAL
1648 Perform Password check.
1649 Passwork may be encrypted by driver that requires the specific check.
1651 @param Form Form where Password Statement is in.
1652 @param Statement Password statement
1653 @param PasswordString Password string to be checked. It may be NULL.
1654 NULL means to restore password.
1655 "" string can be used to checked whether old password does exist.
1657 @return Status Status of Password check.
1662 IN FORM_DISPLAY_ENGINE_FORM
*Form
,
1663 IN FORM_DISPLAY_ENGINE_STATEMENT
*Statement
,
1664 IN EFI_STRING PasswordString OPTIONAL
1669 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1671 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1673 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1676 FORM_BROWSER_STATEMENT
*
1677 GetBrowserStatement (
1678 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1683 Initialize the Display form structure data.
1687 InitializeDisplayFormData (
1693 Base on the current formset info, clean the ConfigRequest string in browser storage.
1695 @param FormSet Pointer of the FormSet
1699 CleanBrowserStorage (
1700 IN OUT FORM_BROWSER_FORMSET
*FormSet
1704 Find HII Handle in the HII database associated with given Device Path.
1706 If DevicePath is NULL, then ASSERT.
1708 @param DevicePath Device Path associated with the HII package list
1710 @param FormsetGuid The formset guid for this formset.
1712 @retval Handle HII package list Handle associated with the Device
1714 @retval NULL Hii Package list handle is not found.
1718 DevicePathToHiiHandle (
1719 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1720 IN EFI_GUID
*FormsetGuid
1724 Adjust the config request info, remove the request elements which already in AllConfigRequest string.
1726 @param Storage Form set Storage.
1727 @param Request The input request string.
1728 @param RespString Whether the input is ConfigRequest or ConfigResp format.
1730 @retval TRUE Has element not covered by current used elements, need to continue to call ExtractConfig
1731 @retval FALSE All elements covered by current used elements.
1735 ConfigRequestAdjust (
1736 IN BROWSER_STORAGE
*Storage
,
1738 IN BOOLEAN RespString
1742 Perform question check.
1744 If one question has more than one check, process form high priority to low.
1746 @param FormSet FormSet data structure.
1747 @param Form Form data structure.
1748 @param Question The Question to be validated.
1750 @retval EFI_SUCCESS Form validation pass.
1751 @retval other Form validation failed.
1755 ValueChangedValidation (
1756 IN FORM_BROWSER_FORMSET
*FormSet
,
1757 IN FORM_BROWSER_FORM
*Form
,
1758 IN FORM_BROWSER_STATEMENT
*Question
1762 Pop up the error info.
1764 @param BrowserStatus The input browser status.
1765 @param HiiHandle The HiiHandle for this error opcode.
1766 @param OpCode The opcode use to get the erro info and timeout value.
1767 @param ErrorString Error string used by BROWSER_NO_SUBMIT_IF.
1772 IN UINT32 BrowserStatus
,
1773 IN EFI_HII_HANDLE HiiHandle
,
1774 IN EFI_IFR_OP_HEADER
*OpCode
, OPTIONAL
1775 IN CHAR16
*ErrorString
1779 Check whether the result is TRUE or FALSE.
1781 For the EFI_HII_VALUE value type is numeric, return TRUE if the
1784 @param Result Input the result data.
1786 @retval TRUE The result is TRUE.
1787 @retval FALSE The result is FALSE.
1792 IN EFI_HII_VALUE
*Result