TianoCore EDK2 master
Loading...
Searching...
No Matches
Setup.c File Reference
#include "Setup.h"

Go to the source code of this file.

Functions

FORM_ENTRY_INFOUiAddMenuList (IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid, IN UINT16 FormId, IN UINT16 QuestionId)
 
EFI_FORM_ID GetFirstFormId (IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid)
 
FORM_ENTRY_INFOUiFindMenuList (IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid, IN UINT16 FormId)
 
FORM_ENTRY_INFOUiFindParentMenu (IN FORM_ENTRY_INFO *CurrentMenu, IN BROWSER_SETTING_SCOPE SettingLevel)
 
VOID UiFreeMenuList (LIST_ENTRY *MenuListHead)
 
VOID UiCopyMenuList (OUT LIST_ENTRY *NewMenuListHead, IN LIST_ENTRY *CurrentMenuListHead)
 
VOID LoadAllHiiFormset (VOID)
 
UINT32 PopupErrorMessage (IN UINT32 BrowserStatus, IN EFI_HII_HANDLE HiiHandle, IN EFI_IFR_OP_HEADER *OpCode OPTIONAL, IN CHAR16 *ErrorString)
 
EFI_STATUS EFIAPI SendForm (IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, IN EFI_HII_HANDLE *Handles, IN UINTN HandleCount, IN EFI_GUID *FormSetGuid OPTIONAL, IN UINT16 FormId OPTIONAL, IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions OPTIONAL, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL)
 
EFI_STATUS ProcessStorage (IN OUT UINTN *ResultsDataSize, IN OUT EFI_STRING *ResultsData, IN BOOLEAN RetrieveData, IN BROWSER_STORAGE *Storage)
 
EFI_STATUS EFIAPI BrowserCallback (IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, IN OUT UINTN *ResultsDataSize, IN OUT EFI_STRING ResultsData, IN BOOLEAN RetrieveData, IN CONST EFI_GUID *VariableGuid OPTIONAL, IN CONST CHAR16 *VariableName OPTIONAL)
 
VOID EFIAPI FormDisplayCallback (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI InitializeSetup (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STRING_ID NewString (IN CHAR16 *String, IN EFI_HII_HANDLE HiiHandle)
 
EFI_STATUS DeleteString (IN EFI_STRING_ID StringId, IN EFI_HII_HANDLE HiiHandle)
 
CHAR16 * GetToken (IN EFI_STRING_ID Token, IN EFI_HII_HANDLE HiiHandle)
 
VOID NewStringCpy (IN OUT CHAR16 **Dest, IN CHAR16 *Src)
 
VOID NewStringCat (IN OUT CHAR16 **Dest, IN CHAR16 *Src)
 
EFI_STATUS GetValueByName (IN BROWSER_STORAGE *Storage, IN CHAR16 *Name, IN OUT CHAR16 **Value, IN GET_SET_QUESTION_VALUE_WITH GetValueFrom)
 
EFI_STATUS SetValueByName (IN BROWSER_STORAGE *Storage, IN CHAR16 *Name, IN CHAR16 *Value, IN GET_SET_QUESTION_VALUE_WITH SetValueTo, OUT NAME_VALUE_NODE **ReturnNode)
 
EFI_STATUS StorageToConfigResp (IN BROWSER_STORAGE *Storage, IN CHAR16 **ConfigResp, IN CHAR16 *ConfigRequest, IN BOOLEAN GetEditBuf)
 
EFI_STATUS ConfigRespToStorage (IN BROWSER_STORAGE *Storage, IN CHAR16 *ConfigResp)
 
VOID GetBitsQuestionValue (IN FORM_BROWSER_STATEMENT *Question, IN UINT8 *Buffer)
 
VOID SetBitsQuestionValue (IN FORM_BROWSER_STATEMENT *Question, IN OUT UINT8 *Buffer, IN UINT32 Value)
 
EFI_STATUS BufferToValue (IN OUT FORM_BROWSER_STATEMENT *Question, IN CHAR16 *Value)
 
EFI_STATUS GetQuestionValue (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_BROWSER_STATEMENT *Question, IN GET_SET_QUESTION_VALUE_WITH GetValueFrom)
 
EFI_STATUS SetQuestionValue (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_BROWSER_STATEMENT *Question, IN GET_SET_QUESTION_VALUE_WITH SetValueTo)
 
EFI_STATUS ValidateQuestion (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN FORM_BROWSER_STATEMENT *Question, IN UINTN Type)
 
EFI_STATUS ValueChangedValidation (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN FORM_BROWSER_STATEMENT *Question)
 
EFI_STATUS NoSubmitCheck (IN FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_FORM **CurrentForm, OUT FORM_BROWSER_STATEMENT **Statement)
 
EFI_STATUS SynchronizeStorage (OUT BROWSER_STORAGE *Storage, IN CHAR16 *ConfigRequest, IN BOOLEAN SyncOrRestore)
 
VOID SendDiscardInfoToDriver (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
 
VOID SubmitCallbackForForm (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
 
VOID SubmitCallback (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
 
BOOLEAN ValidateHiiHandle (EFI_HII_HANDLE HiiHandle)
 
BOOLEAN ValidateFormSet (FORM_BROWSER_FORMSET *FormSet)
 
VOID UpdateFlagForForm (IN BOOLEAN SetFlag, IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
 
VOID ValueChangeResetFlagUpdate (IN BOOLEAN SetFlag, IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
 
BOOLEAN FindQuestionFromProgress (IN FORM_BROWSER_FORMSET *FormSet, IN BROWSER_STORAGE *Storage, IN EFI_STRING Progress, OUT FORM_BROWSER_FORM **RetForm, OUT FORM_BROWSER_STATEMENT **RetQuestion)
 
VOID GetSyncRestoreConfigRequest (IN BROWSER_STORAGE *Storage, IN EFI_STRING ConfigRequest, IN EFI_STRING Progress, OUT EFI_STRING *RestoreConfigRequest, OUT EFI_STRING *SyncConfigRequest)
 
UINT32 ConfirmSaveFail (IN EFI_STRING_ID TitleId, IN EFI_HII_HANDLE HiiHandle)
 
UINT32 ConfirmNoSubmitFail (IN EFI_STRING_ID TitleId, IN EFI_HII_HANDLE HiiHandle)
 
EFI_STATUS DiscardForm (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN BROWSER_SETTING_SCOPE SettingScope)
 
EFI_STATUS SubmitForForm (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
 
EFI_STATUS SubmitForFormSet (IN FORM_BROWSER_FORMSET *FormSet, IN BOOLEAN SkipProcessFail)
 
EFI_STATUS SubmitForSystem (VOID)
 
EFI_STATUS SubmitForm (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN BROWSER_SETTING_SCOPE SettingScope)
 
VOID EFIAPI HiiToLower (IN EFI_STRING ConfigString)
 
CHAR16 * GetOffsetFromConfigResp (IN FORM_BROWSER_STATEMENT *Question, IN CHAR16 *ConfigResp)
 
EFI_STATUS GetDefaultValueFromAltCfg (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_BROWSER_STATEMENT *Question)
 
INTN GetDefaultIdForCallBack (UINTN DefaultId)
 
UINT64 GetArrayData (IN VOID *Array, IN UINT8 Type, IN UINTN Index)
 
VOID SetArrayData (IN VOID *Array, IN UINT8 Type, IN UINTN Index, IN UINT64 Value)
 
QUESTION_OPTIONValueToOption (IN FORM_BROWSER_STATEMENT *Question, IN EFI_HII_VALUE *OptionValue)
 
EFI_STATUS GetQuestionDefault (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN FORM_BROWSER_STATEMENT *Question, IN UINT16 DefaultId)
 
VOID ExtractAltCfgForForm (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN UINT16 DefaultId, IN BROWSER_STORAGE *BrowserStorage)
 
VOID CleanAltCfgForForm (IN FORM_BROWSER_FORM *Form)
 
VOID ExtractAltCfgForFormSet (IN FORM_BROWSER_FORMSET *FormSet, IN UINT16 DefaultId, IN BROWSER_STORAGE *BrowserStorage)
 
VOID CleanAltCfgForFormSet (IN FORM_BROWSER_FORMSET *FormSet)
 
EFI_STATUS ExtractDefault (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN UINT16 DefaultId, IN BROWSER_SETTING_SCOPE SettingScope, IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope, IN BROWSER_STORAGE *Storage OPTIONAL, IN BOOLEAN RetrieveValueFirst, IN BOOLEAN SkipGetAltCfg)
 
BOOLEAN IsQuestionValueChanged (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_BROWSER_STATEMENT *Question, IN GET_SET_QUESTION_VALUE_WITH GetValueFrom)
 
EFI_STATUS LoadFormConfig (IN OUT UI_MENU_SELECTION *Selection, IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
 
EFI_STATUS LoadFormSetConfig (IN OUT UI_MENU_SELECTION *Selection, IN FORM_BROWSER_FORMSET *FormSet)
 
VOID RemoveElement (IN OUT BROWSER_STORAGE *Storage, IN CHAR16 *RequestElement)
 
VOID RemoveConfigRequest (FORMSET_STORAGE *Storage, CHAR16 *ConfigRequest)
 
VOID CleanBrowserStorage (IN OUT FORM_BROWSER_FORMSET *FormSet)
 
BOOLEAN ElementValidation (BROWSER_STORAGE *BrowserStorage, CHAR16 *RequestElement)
 
VOID AppendConfigRequest (IN OUT CHAR16 **ConfigRequest, IN OUT UINTN *SpareStrLen, IN CHAR16 *RequestElement)
 
BOOLEAN ConfigRequestAdjust (IN BROWSER_STORAGE *Storage, IN CHAR16 *Request, IN BOOLEAN RespString)
 
VOID LoadStorage (IN FORM_BROWSER_FORMSET *FormSet, IN FORMSET_STORAGE *Storage)
 
VOID SyncStatusForQuestion (IN OUT FORM_BROWSER_FORMSET *NewFormSet, IN FORM_BROWSER_STATEMENT *OldQuestion)
 
VOID SyncStatusForFormSet (IN OUT FORM_BROWSER_FORMSET *NewFormSet, IN FORM_BROWSER_FORMSET *OldFormSet)
 
VOID InitializeCurrentSetting (IN OUT FORM_BROWSER_FORMSET *FormSet)
 
EFI_STATUS GetIfrBinaryData (IN EFI_HII_HANDLE Handle, IN OUT EFI_GUID *FormSetGuid, OUT UINTN *BinaryLength, OUT UINT8 **BinaryData)
 
EFI_STATUS InitializeFormSet (IN EFI_HII_HANDLE Handle, IN OUT EFI_GUID *FormSetGuid, OUT FORM_BROWSER_FORMSET *FormSet)
 
VOID SaveBrowserContext (VOID)
 
VOID RestoreBrowserContext (VOID)
 
FORM_BROWSER_FORMSETGetFormSetFromHiiHandle (EFI_HII_HANDLE Handle)
 
BOOLEAN IsHiiHandleInBrowserContext (EFI_HII_HANDLE Handle)
 
EFI_STATUS EFIAPI PasswordCheck (IN FORM_DISPLAY_ENGINE_FORM *Form, IN FORM_DISPLAY_ENGINE_STATEMENT *Statement, IN EFI_STRING PasswordString OPTIONAL)
 
BROWSER_HOT_KEYGetHotKeyFromRegisterList (IN EFI_INPUT_KEY *KeyData)
 
EFI_STATUS EFIAPI SetScope (IN BROWSER_SETTING_SCOPE Scope)
 
EFI_STATUS EFIAPI RegisterHotKey (IN EFI_INPUT_KEY *KeyData, IN UINT32 Action, IN UINT16 DefaultId, IN EFI_STRING HelpString OPTIONAL)
 
VOID EFIAPI RegiserExitHandler (IN EXIT_HANDLER Handler)
 
BOOLEAN EFIAPI IsBrowserDataModified (VOID)
 
EFI_STATUS EFIAPI ExecuteAction (IN UINT32 Action, IN UINT16 DefaultId)
 
UINT32 EFIAPI SaveReminder (VOID)
 
BOOLEAN EFIAPI IsResetRequired (VOID)
 

Variables

SETUP_DRIVER_PRIVATE_DATA mPrivateData
 
EFI_HII_DATABASE_PROTOCOLmHiiDatabase
 
EFI_HII_CONFIG_ROUTING_PROTOCOLmHiiConfigRouting
 
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOLmPathFromText
 
EDKII_FORM_DISPLAY_ENGINE_PROTOCOLmFormDisplay
 
UINTN gBrowserContextCount = 0
 
LIST_ENTRY gBrowserContextList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserContextList)
 
LIST_ENTRY gBrowserFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserFormSetList)
 
LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList)
 
LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList)
 
LIST_ENTRY gBrowserSaveFailFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserSaveFailFormSetList)
 
BOOLEAN mSystemSubmit = FALSE
 
BOOLEAN gResetRequiredFormLevel
 
BOOLEAN gResetRequiredSystemLevel = FALSE
 
BOOLEAN gExitRequired
 
BOOLEAN gFlagReconnect
 
BOOLEAN gCallbackReconnect
 
BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel
 
BOOLEAN mBrowserScopeFirstSet = TRUE
 
EXIT_HANDLER ExitHandlerFunction = NULL
 
FORM_BROWSER_FORMSETmSystemLevelFormSet
 
CHAR16 * gEmptyString
 
CHAR16 * mUnknownString = L"!"
 
EFI_GUID mCurrentFormSetGuid
 
EFI_HII_HANDLE mCurrentHiiHandle
 
UINT16 mCurrentFormId
 
FORM_DISPLAY_ENGINE_FORM gDisplayFormData
 

Detailed Description

Entry and initialization module for the browser.

Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2020 - 2022 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Setup.c.

Function Documentation

◆ AppendConfigRequest()

VOID AppendConfigRequest ( IN OUT CHAR16 **  ConfigRequest,
IN OUT UINTN SpareStrLen,
IN CHAR16 *  RequestElement 
)

Append the Request element to the Config Request.

Parameters
ConfigRequestCurrent ConfigRequest info.
SpareStrLenCurrent remain free buffer for config reqeust.
RequestElementNew Request element.

Definition at line 5398 of file Setup.c.

◆ BrowserCallback()

EFI_STATUS EFIAPI BrowserCallback ( IN CONST EFI_FORM_BROWSER2_PROTOCOL This,
IN OUT UINTN ResultsDataSize,
IN OUT EFI_STRING  ResultsData,
IN BOOLEAN  RetrieveData,
IN CONST EFI_GUID *VariableGuid  OPTIONAL,
IN CONST CHAR16 *VariableName  OPTIONAL 
)

This routine called this service in the browser to retrieve or set certain uncommitted state information that resides in the open formsets.

Parameters
ThisA pointer to the EFI_FORM_BROWSER2_PROTOCOL instance.
ResultsDataSizeA pointer to the size of the buffer associated with ResultsData.
ResultsDataA string returned from an IFR browser or equivalent. The results string will have no routing information in them.
RetrieveDataA BOOLEAN field which allows an agent to retrieve (if RetrieveData = TRUE) data from the uncommitted browser state information or set (if RetrieveData = FALSE) data in the uncommitted browser state information.
VariableGuidAn optional field to indicate the target variable GUID name to use.
VariableNameAn optional field to indicate the target human-readable variable name.
Return values
EFI_SUCCESSThe results have been distributed or are awaiting distribution.
EFI_BUFFER_TOO_SMALLThe ResultsDataSize specified was too small to contain the results data.

Definition at line 728 of file Setup.c.

◆ BufferToValue()

EFI_STATUS BufferToValue ( IN OUT FORM_BROWSER_STATEMENT Question,
IN CHAR16 *  Value 
)

Convert the buffer value to HiiValue.

Parameters
QuestionThe question.
ValueUnicode buffer save the question value.
Return values
Statuswhether convert the value success.

Definition at line 1450 of file Setup.c.

◆ CleanAltCfgForForm()

VOID CleanAltCfgForForm ( IN FORM_BROWSER_FORM Form)

Clean AltCfg string for current form.

Parameters
FormForm data structure.

Definition at line 4693 of file Setup.c.

◆ CleanAltCfgForFormSet()

VOID CleanAltCfgForFormSet ( IN FORM_BROWSER_FORMSET FormSet)

Clean AltCfg string for current formset.

Parameters
FormSetForm data structure.

Definition at line 4801 of file Setup.c.

◆ CleanBrowserStorage()

VOID CleanBrowserStorage ( IN OUT FORM_BROWSER_FORMSET FormSet)

Base on the current formset info, clean the ConfigRequest string in browser storage.

Parameters
FormSetPointer of the FormSet

Definition at line 5339 of file Setup.c.

◆ ConfigRequestAdjust()

BOOLEAN ConfigRequestAdjust ( IN BROWSER_STORAGE Storage,
IN CHAR16 *  Request,
IN BOOLEAN  RespString 
)

Adjust the config request info, remove the request elements which already in AllConfigRequest string.

Parameters
StorageForm set Storage.
RequestThe input request string.
RespStringWhether the input is ConfigRequest or ConfigResp format.
Return values
TRUEHas element not covered by current used elements, need to continue to call ExtractConfig
FALSEAll elements covered by current used elements.

Definition at line 5449 of file Setup.c.

◆ ConfigRespToStorage()

EFI_STATUS ConfigRespToStorage ( IN BROWSER_STORAGE Storage,
IN CHAR16 *  ConfigResp 
)

Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.

Parameters
StorageThe Storage to receive the settings.
ConfigRespThe <ConfigResp> to be converted.
Return values
EFI_SUCCESSConvert success.
EFI_INVALID_PARAMETERIncorrect storage type.

Definition at line 1304 of file Setup.c.

◆ ConfirmNoSubmitFail()

UINT32 ConfirmNoSubmitFail ( IN EFI_STRING_ID  TitleId,
IN EFI_HII_HANDLE  HiiHandle 
)

Popup an NO_SUBMIT_IF error info and get user input.

Parameters
TitleIdThe form title id.
HiiHandleThe hii handle for this package.
Return values
UINT32The user select option for the save fail. BROWSER_ACTION_DISCARD or BROWSER_ACTION_JUMP_TO_FORMSET

Definition at line 3167 of file Setup.c.

◆ ConfirmSaveFail()

UINT32 ConfirmSaveFail ( IN EFI_STRING_ID  TitleId,
IN EFI_HII_HANDLE  HiiHandle 
)

Popup an save error info and get user input.

Parameters
TitleIdThe form title id.
HiiHandleThe hii handle for this package.
Return values
UINT32The user select option for the save fail. BROWSER_ACTION_DISCARD or BROWSER_ACTION_JUMP_TO_FORMSET

Definition at line 3128 of file Setup.c.

◆ DeleteString()

EFI_STATUS DeleteString ( IN EFI_STRING_ID  StringId,
IN EFI_HII_HANDLE  HiiHandle 
)

Delete a string from HII Package List.

Parameters
StringIdId of the string in HII database.
HiiHandleThe HII package list handle.
Return values
EFI_SUCCESSThe string was deleted successfully.

Definition at line 1004 of file Setup.c.

◆ DiscardForm()

EFI_STATUS DiscardForm ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN BROWSER_SETTING_SCOPE  SettingScope 
)

Discard data based on the input setting scope (Form, FormSet or System).

Parameters
FormSetFormSet data structure.
FormForm data structure.
SettingScopeSetting Scope for Discard action.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_UNSUPPORTEDUnsupport SettingScope.

Definition at line 3208 of file Setup.c.

◆ ElementValidation()

BOOLEAN ElementValidation ( BROWSER_STORAGE BrowserStorage,
CHAR16 *  RequestElement 
)

Check whether current element in the ConfigReqeust string.

Parameters
BrowserStorageStorage which includes ConfigReqeust.
RequestElementNew element need to check.
Return values
TRUEThe Element is in the ConfigReqeust string.
FALSEThe Element not in the configReqeust String.

Definition at line 5381 of file Setup.c.

◆ ExecuteAction()

EFI_STATUS EFIAPI ExecuteAction ( IN UINT32  Action,
IN UINT16  DefaultId 
)

Execute the action requested by the Action parameter.

Parameters
[in]ActionExecute the request action.
[in]DefaultIdThe default Id info when need to load default value. Only used when Action is BROWSER_ACTION_DEFAULT.
Return values
EFI_SUCCESSExecute the request action succss.
EFI_INVALID_PARAMETERThe input action value is invalid.

Definition at line 6592 of file Setup.c.

◆ ExtractAltCfgForForm()

VOID ExtractAltCfgForForm ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN UINT16  DefaultId,
IN BROWSER_STORAGE BrowserStorage 
)

Get AltCfg string for current form.

Parameters
FormSetForm data structure.
FormForm data structure.
DefaultIdThe Class of the default.
BrowserStorageThe input request storage for the questions.

Definition at line 4590 of file Setup.c.

◆ ExtractAltCfgForFormSet()

VOID ExtractAltCfgForFormSet ( IN FORM_BROWSER_FORMSET FormSet,
IN UINT16  DefaultId,
IN BROWSER_STORAGE BrowserStorage 
)

Get AltCfg string for current formset.

Parameters
FormSetForm data structure.
DefaultIdThe Class of the default.
BrowserStorageThe input request storage for the questions.

Definition at line 4721 of file Setup.c.

◆ ExtractDefault()

EFI_STATUS ExtractDefault ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN UINT16  DefaultId,
IN BROWSER_SETTING_SCOPE  SettingScope,
IN BROWSER_GET_DEFAULT_VALUE  GetDefaultValueScope,
IN BROWSER_STORAGE *Storage  OPTIONAL,
IN BOOLEAN  RetrieveValueFirst,
IN BOOLEAN  SkipGetAltCfg 
)

Reset Questions to their initial value or default value in a Form, Formset or System.

GetDefaultValueScope parameter decides which questions will reset to its default value.

Parameters
FormSetFormSet data structure.
FormForm data structure.
DefaultIdThe Class of the default.
SettingScopeSetting Scope for Default action.
GetDefaultValueScopeGet default value scope.
StorageGet default value only for this storage.
RetrieveValueFirstWhether call the retrieve call back to get the initial value before get default value.
SkipGetAltCfgWhether skip the get altcfg string process.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_UNSUPPORTEDUnsupport SettingScope.

Definition at line 4844 of file Setup.c.

◆ FindQuestionFromProgress()

BOOLEAN FindQuestionFromProgress ( IN FORM_BROWSER_FORMSET FormSet,
IN BROWSER_STORAGE Storage,
IN EFI_STRING  Progress,
OUT FORM_BROWSER_FORM **  RetForm,
OUT FORM_BROWSER_STATEMENT **  RetQuestion 
)

Base on the return Progress string to find the form.

Base on the first return Offset/Width (Name) string to find the form which keep this string.

Parameters
FormSetFormSet data structure.
StorageStorage which has this Progress string.
ProgressThe Progress string which has the first fail string.
RetFormThe return form for this progress string.
RetQuestionThe return question for the error progress string.
Return values
TRUEFind the error form and statement for this error progress string.
FALSENot find the error form.

Definition at line 2876 of file Setup.c.

◆ FormDisplayCallback()

VOID EFIAPI FormDisplayCallback ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Callback function for SimpleTextInEx protocol install events

Parameters
Eventthe event that is signaled.
Contextnot used here.

Definition at line 856 of file Setup.c.

◆ GetArrayData()

UINT64 GetArrayData ( IN VOID *  Array,
IN UINT8  Type,
IN UINTN  Index 
)

Return data element in an Array by its Index.

Parameters
ArrayThe data array.
TypeType of the data in this array.
IndexZero based index for data in this array.
Return values
ValueThe data to be returned

Definition at line 4104 of file Setup.c.

◆ GetBitsQuestionValue()

VOID GetBitsQuestionValue ( IN FORM_BROWSER_STATEMENT Question,
IN UINT8 *  Buffer 
)

Get bit field value from the buffer and then set the value for the question. Note: Data type UINT32 can cover all the bit field value.

Parameters
QuestionThe question refer to bit field.
BufferPoint to the buffer which the question value get from.

Definition at line 1384 of file Setup.c.

◆ GetDefaultIdForCallBack()

INTN GetDefaultIdForCallBack ( UINTN  DefaultId)

Get default Id value used for browser.

Parameters
DefaultIdThe default id value used by hii.
Return values
Browserused default value.

Definition at line 4072 of file Setup.c.

◆ GetDefaultValueFromAltCfg()

EFI_STATUS GetDefaultValueFromAltCfg ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN OUT FORM_BROWSER_STATEMENT Question 
)

Get Question default value from AltCfg string.

Parameters
FormSetThe form set.
FormThe form
QuestionThe question.
Return values
EFI_SUCCESSQuestion is reset to default value.

Definition at line 4004 of file Setup.c.

◆ GetFirstFormId()

EFI_FORM_ID GetFirstFormId ( IN EFI_HII_HANDLE  HiiHandle,
IN EFI_GUID FormSetGuid 
)

Return the form id for the input hiihandle and formset.

Parameters
HiiHandleHiiHandle for FormSet.
FormSetGuidThe Formset GUID of the menu to search.
Returns
First form's id for this form set.

Definition at line 124 of file Setup.c.

◆ GetFormSetFromHiiHandle()

FORM_BROWSER_FORMSET * GetFormSetFromHiiHandle ( EFI_HII_HANDLE  Handle)

Find the matched FormSet context in the backup maintain list based on HiiHandle.

Parameters
HandleThe Hii Handle.
Returns
the found FormSet context. If no found, NULL will return.

Definition at line 6212 of file Setup.c.

◆ GetHotKeyFromRegisterList()

BROWSER_HOT_KEY * GetHotKeyFromRegisterList ( IN EFI_INPUT_KEY KeyData)

Find the registered HotKey based on KeyData.

Parameters
[in]KeyDataA pointer to a buffer that describes the keystroke information for the hot key.
Returns
The registered HotKey context. If no found, NULL will return.

Definition at line 6359 of file Setup.c.

◆ GetIfrBinaryData()

EFI_STATUS GetIfrBinaryData ( IN EFI_HII_HANDLE  Handle,
IN OUT EFI_GUID FormSetGuid,
OUT UINTN BinaryLength,
OUT UINT8 **  BinaryData 
)

Fetch the Ifr binary data of a FormSet.

Parameters
HandlePackageList Handle
FormSetGuidOn input, GUID or class GUID of a formset. If not specified (NULL or zero GUID), take the first FormSet with class GUID EFI_HII_PLATFORM_SETUP_FORMSET_GUID found in package list. On output, GUID of the formset found(if not NULL).
BinaryLengthThe length of the FormSet IFR binary.
BinaryDataThe buffer designed to receive the FormSet.
Return values
EFI_SUCCESSBuffer filled with the requested FormSet. BufferLength was updated.
EFI_INVALID_PARAMETERThe handle is unknown.
EFI_NOT_FOUNDA form or FormSet on the requested handle cannot be found with the requested FormId.

Definition at line 5843 of file Setup.c.

◆ GetOffsetFromConfigResp()

CHAR16 * GetOffsetFromConfigResp ( IN FORM_BROWSER_STATEMENT Question,
IN CHAR16 *  ConfigResp 
)

Find the point in the ConfigResp string for this question.

Parameters
QuestionThe question.
ConfigRespGet ConfigResp string.
Return values
pointto the offset where is for this question.

Definition at line 3930 of file Setup.c.

◆ GetQuestionDefault()

EFI_STATUS GetQuestionDefault ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN FORM_BROWSER_STATEMENT Question,
IN UINT16  DefaultId 
)

Reset Question to its default value.

Parameters
FormSetThe form set.
FormThe form.
QuestionThe question.
DefaultIdThe Class of the default.
Return values
EFI_SUCCESSQuestion is reset to default value.

Definition at line 4233 of file Setup.c.

◆ GetQuestionValue()

EFI_STATUS GetQuestionValue ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN OUT FORM_BROWSER_STATEMENT Question,
IN GET_SET_QUESTION_VALUE_WITH  GetValueFrom 
)

Get Question's current Value.

Parameters
FormSetFormSet data structure.
FormForm data structure.
QuestionQuestion to be initialized.
GetValueFromWhere to get value, may from editbuffer, buffer or hii driver.
Return values
EFI_SUCCESSThe function completed successfully.

Definition at line 1581 of file Setup.c.

◆ GetSyncRestoreConfigRequest()

VOID GetSyncRestoreConfigRequest ( IN BROWSER_STORAGE Storage,
IN EFI_STRING  ConfigRequest,
IN EFI_STRING  Progress,
OUT EFI_STRING *  RestoreConfigRequest,
OUT EFI_STRING *  SyncConfigRequest 
)

Base on the return Progress string to get the SyncConfigRequest and RestoreConfigRequest for form and formset.

Parameters
StorageStorage which has this Progress string.
ConfigRequestThe ConfigRequest string.
ProgressThe Progress string which has the first fail string.
RestoreConfigRequestReturn the RestoreConfigRequest string.
SyncConfigRequestReturn the SyncConfigRequest string.

Definition at line 3027 of file Setup.c.

◆ GetToken()

CHAR16 * GetToken ( IN EFI_STRING_ID  Token,
IN EFI_HII_HANDLE  HiiHandle 
)

Get the string based on the StringId and HII Package List Handle.

Parameters
TokenThe String's ID.
HiiHandleThe package list in the HII database to search for the specified string.
Returns
The output string.

Definition at line 1027 of file Setup.c.

◆ GetValueByName()

EFI_STATUS GetValueByName ( IN BROWSER_STORAGE Storage,
IN CHAR16 *  Name,
IN OUT CHAR16 **  Value,
IN GET_SET_QUESTION_VALUE_WITH  GetValueFrom 
)

Get Value for given Name from a NameValue Storage.

Parameters
StorageThe NameValue Storage.
NameThe Name.
ValueThe retured Value.
GetValueFromWhere to get source value, from EditValue or Value.
Return values
EFI_SUCCESSValue found for given Name.
EFI_NOT_FOUNDNo such Name found in NameValue storage.

Definition at line 1113 of file Setup.c.

◆ HiiToLower()

VOID EFIAPI HiiToLower ( IN EFI_STRING  ConfigString)

Converts the unicode character of the string from uppercase to lowercase. This is a internal function.

Parameters
ConfigStringString to be converted

Definition at line 3897 of file Setup.c.

◆ InitializeCurrentSetting()

VOID InitializeCurrentSetting ( IN OUT FORM_BROWSER_FORMSET FormSet)

Get current setting of Questions.

Parameters
FormSetFormSet data structure.

Definition at line 5784 of file Setup.c.

◆ InitializeFormSet()

EFI_STATUS InitializeFormSet ( IN EFI_HII_HANDLE  Handle,
IN OUT EFI_GUID FormSetGuid,
OUT FORM_BROWSER_FORMSET FormSet 
)

Initialize the internal data structure of a FormSet.

Parameters
HandlePackageList Handle
FormSetGuidOn input, GUID or class GUID of a formset. If not specified (NULL or zero GUID), take the first FormSet with class GUID EFI_HII_PLATFORM_SETUP_FORMSET_GUID found in package list. On output, GUID of the formset found(if not NULL).
FormSetFormSet data structure.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_NOT_FOUNDThe specified FormSet could not be found.

Definition at line 6011 of file Setup.c.

◆ InitializeSetup()

EFI_STATUS EFIAPI InitializeSetup ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Initialize Setup Browser driver.

Parameters
ImageHandleThe image handle.
SystemTableThe system table.
Return values
EFI_SUCCESSThe Setup Browser module is initialized correctly..
Returns
Other value if failed to initialize the Setup Browser module.

Definition at line 884 of file Setup.c.

◆ IsBrowserDataModified()

BOOLEAN EFIAPI IsBrowserDataModified ( VOID  )

Check whether the browser data has been modified.

Return values
TRUEBrowser data is modified.
FALSENo browser data is modified.

Definition at line 6536 of file Setup.c.

◆ IsHiiHandleInBrowserContext()

BOOLEAN IsHiiHandleInBrowserContext ( EFI_HII_HANDLE  Handle)

Check whether the input HII handle is the FormSet that is being used.

Parameters
HandleThe Hii Handle.
Return values
TRUEHII handle is being used.
FALSEHII handle is not being used.

Definition at line 6245 of file Setup.c.

◆ IsQuestionValueChanged()

BOOLEAN IsQuestionValueChanged ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN OUT FORM_BROWSER_STATEMENT Question,
IN GET_SET_QUESTION_VALUE_WITH  GetValueFrom 
)

Validate whether this question's value has changed.

Parameters
FormSetFormSet data structure.
FormForm data structure.
QuestionQuestion to be initialized.
GetValueFromWhere to get value, may from editbuffer, buffer or hii driver.
Return values
TRUEQuestion's value has changed.
FALSEQuestion's value has not changed

Definition at line 5011 of file Setup.c.

◆ IsResetRequired()

BOOLEAN EFIAPI IsResetRequired ( VOID  )

Check whether the Reset Required for the browser

Return values
TRUEBrowser required to reset after exit.
FALSEBrowser not need to reset after exit.

Definition at line 6747 of file Setup.c.

◆ LoadAllHiiFormset()

VOID LoadAllHiiFormset ( VOID  )

Load all hii formset to the browser.

Definition at line 325 of file Setup.c.

◆ LoadFormConfig()

EFI_STATUS LoadFormConfig ( IN OUT UI_MENU_SELECTION Selection,
IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form 
)

Initialize Question's Edit copy from Storage.

Parameters
SelectionSelection contains the information about the Selection, form and formset to be displayed. Selection action may be updated in retrieve callback. If Selection is NULL, only initialize Question value.
FormSetFormSet data structure.
FormForm data structure.
Return values
EFI_SUCCESSThe function completed successfully.

Definition at line 5131 of file Setup.c.

◆ LoadFormSetConfig()

EFI_STATUS LoadFormSetConfig ( IN OUT UI_MENU_SELECTION Selection,
IN FORM_BROWSER_FORMSET FormSet 
)

Initialize Question's Edit copy from Storage for the whole Formset.

Parameters
SelectionSelection contains the information about the Selection, form and formset to be displayed. Selection action may be updated in retrieve callback. If Selection is NULL, only initialize Question value.
FormSetFormSet data structure.
Return values
EFI_SUCCESSThe function completed successfully.

Definition at line 5181 of file Setup.c.

◆ LoadStorage()

VOID LoadStorage ( IN FORM_BROWSER_FORMSET FormSet,
IN FORMSET_STORAGE Storage 
)

Fill storage's edit copy with settings requested from Configuration Driver.

Parameters
FormSetFormSet data structure.
StorageBuffer Storage.

Definition at line 5567 of file Setup.c.

◆ NewString()

EFI_STRING_ID NewString ( IN CHAR16 *  String,
IN EFI_HII_HANDLE  HiiHandle 
)

Create a new string in HII Package List.

Parameters
StringThe String to be added
HiiHandleThe package list in the HII database to insert the specified string.
Returns
The output string.

Definition at line 981 of file Setup.c.

◆ NewStringCat()

VOID NewStringCat ( IN OUT CHAR16 **  Dest,
IN CHAR16 *  Src 
)

Allocate new memory and concatinate Source on the end of Destination.

Parameters
DestString to added to the end of.
SrcString to concatinate.

Definition at line 1076 of file Setup.c.

◆ NewStringCpy()

VOID NewStringCpy ( IN OUT CHAR16 **  Dest,
IN CHAR16 *  Src 
)

Allocate new memory and then copy the Unicode string Source to Destination.

Parameters
DestLocation to copy string
SrcString to copy

Definition at line 1055 of file Setup.c.

◆ NoSubmitCheck()

EFI_STATUS NoSubmitCheck ( IN FORM_BROWSER_FORMSET FormSet,
IN OUT FORM_BROWSER_FORM **  CurrentForm,
OUT FORM_BROWSER_STATEMENT **  Statement 
)

Perform NoSubmit check for each Form in FormSet.

Parameters
FormSetFormSet data structure.
CurrentFormCurrent input form data structure.
StatementThe statement for this check.
Return values
EFI_SUCCESSForm validation pass.
otherForm validation failed.

Definition at line 2406 of file Setup.c.

◆ PasswordCheck()

EFI_STATUS EFIAPI PasswordCheck ( IN FORM_DISPLAY_ENGINE_FORM Form,
IN FORM_DISPLAY_ENGINE_STATEMENT Statement,
IN EFI_STRING PasswordString  OPTIONAL 
)

Perform Password check. Passwork may be encrypted by driver that requires the specific check.

Parameters
FormForm where Password Statement is in.
StatementPassword statement
PasswordStringPassword string to be checked. It may be NULL. NULL means to restore password. "" string can be used to checked whether old password does exist.
Returns
Status Status of Password check.

Definition at line 6292 of file Setup.c.

◆ PopupErrorMessage()

UINT32 PopupErrorMessage ( IN UINT32  BrowserStatus,
IN EFI_HII_HANDLE  HiiHandle,
IN EFI_IFR_OP_HEADER *OpCode  OPTIONAL,
IN CHAR16 *  ErrorString 
)

Pop up the error info.

Parameters
BrowserStatusThe input browser status.
HiiHandleThe Hiihandle for this opcode.
OpCodeThe opcode use to get the erro info and timeout value.
ErrorStringError string used by BROWSER_NO_SUBMIT_IF.

Definition at line 399 of file Setup.c.

◆ ProcessStorage()

EFI_STATUS ProcessStorage ( IN OUT UINTN ResultsDataSize,
IN OUT EFI_STRING *  ResultsData,
IN BOOLEAN  RetrieveData,
IN BROWSER_STORAGE Storage 
)

Get or set data to the storage.

Parameters
ResultsDataSizeThe size of the buffer associatedwith ResultsData.
ResultsDataA string returned from an IFR browser or equivalent. The results string will have no routing information in them.
RetrieveDataA BOOLEAN field which allows an agent to retrieve (if RetrieveData = TRUE) data from the uncommitted browser state information or set (if RetrieveData = FALSE) data in the uncommitted browser state information.
StorageThe pointer to the storage.
Return values
EFI_SUCCESSThe results have been distributed or are awaiting distribution.

Definition at line 627 of file Setup.c.

◆ RegiserExitHandler()

VOID EFIAPI RegiserExitHandler ( IN EXIT_HANDLER  Handler)

Register Exit handler function. When more than one handler function is registered, the latter one will override the previous one. When NULL handler is specified, the previous Exit handler will be unregistered.

Parameters
[in]HandlerPointer to handler function.

Definition at line 6519 of file Setup.c.

◆ RegisterHotKey()

EFI_STATUS EFIAPI RegisterHotKey ( IN EFI_INPUT_KEY KeyData,
IN UINT32  Action,
IN UINT16  DefaultId,
IN EFI_STRING HelpString  OPTIONAL 
)

Register the hot key with its browser action, or unregistered the hot key. Only support hot key that is not printable character (control key, function key, etc.). If the action value is zero, the hot key will be unregistered if it has been registered. If the same hot key has been registered, the new action and help string will override the previous ones.

Parameters
[in]KeyDataA pointer to a buffer that describes the keystroke information for the hot key. Its type is EFI_INPUT_KEY to be supported by all ConsoleIn devices.
[in]ActionAction value that describes what action will be trigged when the hot key is pressed.
[in]DefaultIdSpecifies the type of defaults to retrieve, which is only for DEFAULT action.
[in]HelpStringHelp string that describes the hot key information. Its value may be NULL for the unregistered hot key.
Return values
EFI_SUCCESSHot key is registered or unregistered.
EFI_INVALID_PARAMETERKeyData is NULL or HelpString is NULL on register.
EFI_NOT_FOUNDKeyData is not found to be unregistered.
EFI_UNSUPPORTEDKey represents a printable character. It is conflicted with Browser.
EFI_ALREADY_STARTEDKey already been registered for one hot key.

Definition at line 6438 of file Setup.c.

◆ RemoveConfigRequest()

VOID RemoveConfigRequest ( FORMSET_STORAGE Storage,
CHAR16 *  ConfigRequest 
)

Adjust config request in storage, remove the request elements existed in the input ConfigRequest.

Parameters
StoragePointer to the formset storage.
ConfigRequestThe pointer to the Request element.

Definition at line 5255 of file Setup.c.

◆ RemoveElement()

VOID RemoveElement ( IN OUT BROWSER_STORAGE Storage,
IN CHAR16 *  RequestElement 
)

Remove the Request element from the Config Request.

Parameters
StoragePointer to the browser storage.
RequestElementThe pointer to the Request element.

Definition at line 5221 of file Setup.c.

◆ RestoreBrowserContext()

VOID RestoreBrowserContext ( VOID  )

Restore globals used by previous call to SendForm().

Definition at line 6137 of file Setup.c.

◆ SaveBrowserContext()

VOID SaveBrowserContext ( VOID  )

Save globals used by previous call to SendForm(). SendForm() may be called from HiiConfigAccess.Callback(), this will cause SendForm() be reentried. So, save globals of previous call to SendForm() and restore them upon exit.

Definition at line 6067 of file Setup.c.

◆ SaveReminder()

UINT32 EFIAPI SaveReminder ( VOID  )

Create reminder to let user to choose save or discard the changed browser data. Caller can use it to actively check the changed browser data.

Return values
BROWSER_NO_CHANGESNo browser data is changed.
BROWSER_SAVE_CHANGESThe changed browser data is saved.
BROWSER_DISCARD_CHANGESThe changed browser data is discard.
BROWSER_KEEP_CURRENTBrowser keep current changes.

Definition at line 6682 of file Setup.c.

◆ SendDiscardInfoToDriver()

VOID SendDiscardInfoToDriver ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form 
)

When discard the question value, call the callback function with Changed type to inform the hii driver.

Parameters
FormSetFormSet data structure.
FormForm data structure.

Definition at line 2552 of file Setup.c.

◆ SendForm()

EFI_STATUS EFIAPI SendForm ( IN CONST EFI_FORM_BROWSER2_PROTOCOL This,
IN EFI_HII_HANDLE Handles,
IN UINTN  HandleCount,
IN EFI_GUID *FormSetGuid  OPTIONAL,
IN UINT16 FormId  OPTIONAL,
IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions  OPTIONAL,
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest  OPTIONAL 
)

This is the routine which an external caller uses to direct the browser where to obtain it's information.

Parameters
ThisThe Form Browser protocol instanse.
HandlesA pointer to an array of Handles. If HandleCount > 1 we display a list of the formsets for the handles specified.
HandleCountThe number of Handles specified in Handle.
FormSetGuidThis field points to the EFI_GUID which must match the Guid field in the EFI_IFR_FORM_SET op-code for the specified forms-based package. If FormSetGuid is NULL, then this function will display the first found forms package.
FormIdThis field specifies which EFI_IFR_FORM to render as the first displayable page. If this field has a value of 0x0000, then the forms browser will render the specified forms in their encoded order.
ScreenDimensionsPoints to recommended form dimensions, including any non-content area, in characters.
ActionRequestPoints to the action recommended by the form.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.
EFI_NOT_FOUNDNo valid forms could be found to display.

Definition at line 468 of file Setup.c.

◆ SetArrayData()

VOID SetArrayData ( IN VOID *  Array,
IN UINT8  Type,
IN UINTN  Index,
IN UINT64  Value 
)

Set value of a data element in an Array by its Index.

Parameters
ArrayThe data array.
TypeType of the data in this array.
IndexZero based index for data in this array.
ValueThe value to be set.

Definition at line 4149 of file Setup.c.

◆ SetBitsQuestionValue()

VOID SetBitsQuestionValue ( IN FORM_BROWSER_STATEMENT Question,
IN OUT UINT8 *  Buffer,
IN UINT32  Value 
)

Set bit field value to the buffer. Note: Data type UINT32 can cover all the bit field value.

Parameters
QuestionThe question refer to bit field.
BufferPoint to the buffer which the question value set to.
ValueThe bit field value need to set.

Definition at line 1419 of file Setup.c.

◆ SetQuestionValue()

EFI_STATUS SetQuestionValue ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN OUT FORM_BROWSER_STATEMENT Question,
IN GET_SET_QUESTION_VALUE_WITH  SetValueTo 
)

Save Question Value to edit copy(cached) or Storage(uncached).

Parameters
FormSetFormSet data structure.
FormForm data structure.
QuestionPointer to the Question.
SetValueToUpdate the question value to editbuffer , buffer or hii driver.
Return values
EFI_SUCCESSThe function completed successfully.

Definition at line 1913 of file Setup.c.

◆ SetScope()

EFI_STATUS EFIAPI SetScope ( IN BROWSER_SETTING_SCOPE  Scope)

Configure what scope the hot key will impact. All hot keys have the same scope. The mixed hot keys with the different level are not supported. If no scope is set, the default scope will be FormSet level. After all registered hot keys are removed, previous Scope can reset to another level.

Parameters
[in]ScopeScope level to be set.
Return values
EFI_SUCCESSScope is set correctly.
EFI_INVALID_PARAMETERScope is not the valid value specified in BROWSER_SETTING_SCOPE.
EFI_UNSPPORTEDScope level is different from current one that the registered hot keys have.

Definition at line 6394 of file Setup.c.

◆ SetValueByName()

EFI_STATUS SetValueByName ( IN BROWSER_STORAGE Storage,
IN CHAR16 *  Name,
IN CHAR16 *  Value,
IN GET_SET_QUESTION_VALUE_WITH  SetValueTo,
OUT NAME_VALUE_NODE **  ReturnNode 
)

Set Value of given Name in a NameValue Storage.

Parameters
StorageThe NameValue Storage.
NameThe Name.
ValueThe Value to set.
SetValueToWhether update editValue or Value.
ReturnNodeThe node use the input name.
Return values
EFI_SUCCESSValue found for given Name.
EFI_NOT_FOUNDNo such Name found in NameValue storage.

Definition at line 1163 of file Setup.c.

◆ StorageToConfigResp()

EFI_STATUS StorageToConfigResp ( IN BROWSER_STORAGE Storage,
IN CHAR16 **  ConfigResp,
IN CHAR16 *  ConfigRequest,
IN BOOLEAN  GetEditBuf 
)

Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.

Parameters
StorageThe Storage to be conveted.
ConfigRespThe returned <ConfigResp>.
ConfigRequestThe ConfigRequest string.
GetEditBufGet the data from editbuffer or buffer.
Return values
EFI_SUCCESSConvert success.
EFI_INVALID_PARAMETERIncorrect storage type.

Definition at line 1228 of file Setup.c.

◆ SubmitCallback()

VOID SubmitCallback ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form 
)

When value set Success, call the submit callback function.

Parameters
FormSetFormSet data structure.
FormForm data structure.

Definition at line 2680 of file Setup.c.

◆ SubmitCallbackForForm()

VOID SubmitCallbackForForm ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form 
)

When submit the question value, call the callback function with Submitted type to inform the hii driver.

Parameters
FormSetFormSet data structure.
FormForm data structure.

Definition at line 2623 of file Setup.c.

◆ SubmitForForm()

EFI_STATUS SubmitForForm ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form 
)

Submit data for a form.

Parameters
FormSetFormSet data structure.
FormForm data structure.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_UNSUPPORTEDUnsupport SettingScope.

Definition at line 3339 of file Setup.c.

◆ SubmitForFormSet()

EFI_STATUS SubmitForFormSet ( IN FORM_BROWSER_FORMSET FormSet,
IN BOOLEAN  SkipProcessFail 
)

Submit data for a formset.

Parameters
FormSetFormSet data structure.
SkipProcessFailWhether skip to process the save failed storage. If submit formset is called when do system level save, set this value to true and process the failed formset together. if submit formset is called when do formset level save, set the value to false and process the failed storage right after process all storages for this formset.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_UNSUPPORTEDUnsupport SettingScope.

Definition at line 3487 of file Setup.c.

◆ SubmitForm()

EFI_STATUS SubmitForm ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN BROWSER_SETTING_SCOPE  SettingScope 
)

Submit data based on the input Setting level (Form, FormSet or System).

Parameters
FormSetFormSet data structure.
FormForm data structure.
SettingScopeSetting Scope for Submit action.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_UNSUPPORTEDUnsupport SettingScope.

Definition at line 3859 of file Setup.c.

◆ SubmitForSystem()

EFI_STATUS SubmitForSystem ( VOID  )

Submit data for all formsets.

Return values
EFI_SUCCESSThe function completed successfully.
EFI_UNSUPPORTEDUnsupport SettingScope.

Definition at line 3695 of file Setup.c.

◆ SynchronizeStorage()

EFI_STATUS SynchronizeStorage ( OUT BROWSER_STORAGE Storage,
IN CHAR16 *  ConfigRequest,
IN BOOLEAN  SyncOrRestore 
)

Fill storage's edit copy with settings requested from Configuration Driver.

Parameters
StorageThe storage which need to sync.
ConfigRequestThe config request string which used to sync storage.
SyncOrRestoreSync the buffer to editbuffer or Restore the editbuffer to buffer if TRUE, copy the editbuffer to the buffer. if FALSE, copy the buffer to the editbuffer.
Return values
EFI_SUCCESSThe function completed successfully.

Definition at line 2464 of file Setup.c.

◆ SyncStatusForFormSet()

VOID SyncStatusForFormSet ( IN OUT FORM_BROWSER_FORMSET NewFormSet,
IN FORM_BROWSER_FORMSET OldFormSet 
)

Get Value changed status from old formset.

Parameters
NewFormSetFormSet data structure.
OldFormSetFormSet data structure.

Definition at line 5739 of file Setup.c.

◆ SyncStatusForQuestion()

VOID SyncStatusForQuestion ( IN OUT FORM_BROWSER_FORMSET NewFormSet,
IN FORM_BROWSER_STATEMENT OldQuestion 
)

Get Value changed status from old question.

Parameters
NewFormSetFormSet data structure.
OldQuestionOld question which has value changed.

Definition at line 5697 of file Setup.c.

◆ UiAddMenuList()

FORM_ENTRY_INFO * UiAddMenuList ( IN EFI_HII_HANDLE  HiiHandle,
IN EFI_GUID FormSetGuid,
IN UINT16  FormId,
IN UINT16  QuestionId 
)

Create a menu with specified formset GUID and form ID, and add it as a child of the given parent menu.

Parameters
HiiHandleHii handle related to this formset.
FormSetGuidThe Formset Guid of menu to be added.
FormIdThe Form ID of menu to be added.
QuestionIdThe question id of this menu to be added.
Returns
A pointer to the newly added menu or NULL if memory is insufficient.

Definition at line 85 of file Setup.c.

◆ UiCopyMenuList()

VOID UiCopyMenuList ( OUT LIST_ENTRY NewMenuListHead,
IN LIST_ENTRY CurrentMenuListHead 
)

Copy current Menu list to the new menu list.

Parameters
NewMenuListHeadNew create Menu list.
CurrentMenuListHeadCurrent Menu list.

Definition at line 289 of file Setup.c.

◆ UiFindMenuList()

FORM_ENTRY_INFO * UiFindMenuList ( IN EFI_HII_HANDLE  HiiHandle,
IN EFI_GUID FormSetGuid,
IN UINT16  FormId 
)

Search Menu with given FormSetGuid and FormId in all cached menu list.

Parameters
HiiHandleHiiHandle for FormSet.
FormSetGuidThe Formset GUID of the menu to search.
FormIdThe Form ID of menu to search.
Returns
A pointer to menu found or NULL if not found.

Definition at line 149 of file Setup.c.

◆ UiFindParentMenu()

FORM_ENTRY_INFO * UiFindParentMenu ( IN FORM_ENTRY_INFO CurrentMenu,
IN BROWSER_SETTING_SCOPE  SettingLevel 
)

Find parent menu for current menu.

Parameters
CurrentMenuCurrent Menu
SettingLevelWhether find parent menu in Form Level or Formset level. In form level, just find the parent menu; In formset level, find the parent menu which has different formset guid value.
Return values
Theparent menu for current menu.

Definition at line 213 of file Setup.c.

◆ UiFreeMenuList()

VOID UiFreeMenuList ( LIST_ENTRY MenuListHead)

Free Menu list linked list.

Parameters
MenuListHeadOne Menu list point in the menu list.

Definition at line 267 of file Setup.c.

◆ UpdateFlagForForm()

VOID UpdateFlagForForm ( IN BOOLEAN  SetFlag,
IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form 
)

Check whether need to enable the reset flag in form level. Also clean all ValueChanged flag in question.

Parameters
SetFlagWhether need to set the Reset Flag.
FormSetFormSet data structure.
FormForm data structure.

Definition at line 2782 of file Setup.c.

◆ ValidateFormSet()

BOOLEAN ValidateFormSet ( FORM_BROWSER_FORMSET FormSet)

Validate the FormSet. If the formset is not validate, remove it from the list.

Parameters
FormSetThe input FormSet which need to validate.
Return values
TRUEThe handle is validate.
FALSEThe handle is invalidate.

Definition at line 2751 of file Setup.c.

◆ ValidateHiiHandle()

BOOLEAN ValidateHiiHandle ( EFI_HII_HANDLE  HiiHandle)

Validate the HiiHandle.

Parameters
HiiHandleThe input HiiHandle which need to validate.
Return values
TRUEThe handle is validate.
FALSEThe handle is invalidate.

Definition at line 2712 of file Setup.c.

◆ ValidateQuestion()

EFI_STATUS ValidateQuestion ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN FORM_BROWSER_STATEMENT Question,
IN UINTN  Type 
)

Perform nosubmitif check for a Form.

Parameters
FormSetFormSet data structure.
FormForm data structure.
QuestionThe Question to be validated.
TypeValidation type: NoSubmit
Return values
EFI_SUCCESSForm validation pass.
otherForm validation failed.

Definition at line 2250 of file Setup.c.

◆ ValueChangedValidation()

EFI_STATUS ValueChangedValidation ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN FORM_BROWSER_STATEMENT Question 
)

Perform question check.

If one question has more than one check, process form high priority to low. Only one error info will be popup.

Parameters
FormSetFormSet data structure.
FormForm data structure.
QuestionThe Question to be validated.
Return values
EFI_SUCCESSForm validation pass.
otherForm validation failed.

Definition at line 2364 of file Setup.c.

◆ ValueChangeResetFlagUpdate()

VOID ValueChangeResetFlagUpdate ( IN BOOLEAN  SetFlag,
IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form 
)

Check whether need to enable the reset flag. Also clean ValueChanged flag for all statements.

Form level or formset level, only one.

Parameters
SetFlagWhether need to set the Reset Flag.
FormSetFormSet data structure.
FormForm data structure.

Definition at line 2836 of file Setup.c.

◆ ValueToOption()

QUESTION_OPTION * ValueToOption ( IN FORM_BROWSER_STATEMENT Question,
IN EFI_HII_VALUE OptionValue 
)

Search an Option of a Question by its value.

Parameters
QuestionThe Question
OptionValueValue for Option to be searched.
Return values
PointerPointer to the found Option.
NULLOption not found.

Definition at line 4191 of file Setup.c.

Variable Documentation

◆ ExitHandlerFunction

EXIT_HANDLER ExitHandlerFunction = NULL

Definition at line 58 of file Setup.c.

◆ gBrowserContextCount

UINTN gBrowserContextCount = 0

Definition at line 43 of file Setup.c.

◆ gBrowserContextList

LIST_ENTRY gBrowserContextList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserContextList)

Definition at line 44 of file Setup.c.

◆ gBrowserFormSetList

LIST_ENTRY gBrowserFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserFormSetList)

Definition at line 45 of file Setup.c.

◆ gBrowserHotKeyList

LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList)

Definition at line 46 of file Setup.c.

◆ gBrowserSaveFailFormSetList

LIST_ENTRY gBrowserSaveFailFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserSaveFailFormSetList)

Definition at line 48 of file Setup.c.

◆ gBrowserSettingScope

BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel

Definition at line 56 of file Setup.c.

◆ gBrowserStorageList

LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList)

Definition at line 47 of file Setup.c.

◆ gCallbackReconnect

BOOLEAN gCallbackReconnect

Definition at line 55 of file Setup.c.

◆ gDisplayFormData

FORM_DISPLAY_ENGINE_FORM gDisplayFormData
extern

Definition at line 22 of file Presentation.c.

◆ gEmptyString

CHAR16* gEmptyString

Definition at line 64 of file Setup.c.

◆ gExitRequired

BOOLEAN gExitRequired

Definition at line 53 of file Setup.c.

◆ gFlagReconnect

BOOLEAN gFlagReconnect

Definition at line 54 of file Setup.c.

◆ gResetRequiredFormLevel

BOOLEAN gResetRequiredFormLevel

Definition at line 51 of file Setup.c.

◆ gResetRequiredSystemLevel

BOOLEAN gResetRequiredSystemLevel = FALSE

Definition at line 52 of file Setup.c.

◆ mBrowserScopeFirstSet

BOOLEAN mBrowserScopeFirstSet = TRUE

Definition at line 57 of file Setup.c.

◆ mCurrentFormId

UINT16 mCurrentFormId
extern

Definition at line 18 of file Presentation.c.

◆ mCurrentFormSetGuid

EFI_GUID mCurrentFormSetGuid
extern

Definition at line 15 of file Presentation.c.

◆ mCurrentHiiHandle

EFI_HII_HANDLE mCurrentHiiHandle
extern

Definition at line 14 of file Presentation.c.

◆ mFormDisplay

Definition at line 41 of file Setup.c.

◆ mHiiConfigRouting

EFI_HII_CONFIG_ROUTING_PROTOCOL* mHiiConfigRouting

Definition at line 39 of file Setup.c.

◆ mHiiDatabase

Definition at line 38 of file Setup.c.

◆ mPathFromText

Definition at line 40 of file Setup.c.

◆ mPrivateData

Initial value:
= {
SETUP_DRIVER_SIGNATURE,
{
},
{
},
{
BROWSER_EXTENSION2_VERSION_1_1,
{ NULL, NULL },
{ NULL, NULL },
}
}
#define NULL
Definition: Base.h:319
EFI_STATUS EFIAPI SetScope(IN BROWSER_SETTING_SCOPE Scope)
Definition: Setup.c:6394
EFI_STATUS EFIAPI BrowserCallback(IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, IN OUT UINTN *ResultsDataSize, IN OUT EFI_STRING ResultsData, IN BOOLEAN RetrieveData, IN CONST EFI_GUID *VariableGuid OPTIONAL, IN CONST CHAR16 *VariableName OPTIONAL)
Definition: Setup.c:728
UINT32 EFIAPI SaveReminder(VOID)
Definition: Setup.c:6682
BOOLEAN EFIAPI IsResetRequired(VOID)
Definition: Setup.c:6747
EFI_STATUS EFIAPI ExecuteAction(IN UINT32 Action, IN UINT16 DefaultId)
Definition: Setup.c:6592
EFI_STATUS EFIAPI SendForm(IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, IN EFI_HII_HANDLE *Handles, IN UINTN HandleCount, IN EFI_GUID *FormSetGuid OPTIONAL, IN UINT16 FormId OPTIONAL, IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions OPTIONAL, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL)
Definition: Setup.c:468
BOOLEAN EFIAPI IsBrowserDataModified(VOID)
Definition: Setup.c:6536
VOID EFIAPI RegiserExitHandler(IN EXIT_HANDLER Handler)
Definition: Setup.c:6519
EFI_STATUS EFIAPI RegisterHotKey(IN EFI_INPUT_KEY *KeyData, IN UINT32 Action, IN UINT16 DefaultId, IN EFI_STRING HelpString OPTIONAL)
Definition: Setup.c:6438

Definition at line 12 of file Setup.c.

◆ mSystemLevelFormSet

FORM_BROWSER_FORMSET* mSystemLevelFormSet

Definition at line 59 of file Setup.c.

◆ mSystemSubmit

BOOLEAN mSystemSubmit = FALSE

Definition at line 50 of file Setup.c.

◆ mUnknownString

CHAR16* mUnknownString = L"!"

Definition at line 65 of file Setup.c.