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

Go to the source code of this file.

Functions

VOID NewStringCopy (IN OUT CHAR16 **Dest, IN CHAR16 *Src)
 
EFI_STATUS SetValueByName (IN HII_FORMSET_STORAGE *Storage, IN CHAR16 *Name, IN CHAR16 *Value, OUT HII_NAME_VALUE_NODE **ReturnNode)
 
VOID GetBitsQuestionValue (IN HII_STATEMENT *Question, IN UINT8 *Buffer, OUT HII_STATEMENT_VALUE *QuestionValue)
 
VOID SetBitsQuestionValue (IN HII_STATEMENT *Question, IN OUT UINT8 *Buffer, IN UINT32 Value)
 
EFI_STATUS BufferToQuestionValue (IN HII_STATEMENT *Question, IN CHAR16 *Value, OUT HII_STATEMENT_VALUE *QuestionValue)
 
CHAR16 * GetTokenString (IN EFI_STRING_ID Token, IN EFI_HII_HANDLE HiiHandle)
 
VOID EFIAPI HiiStringToLowercase (IN EFI_STRING ConfigString)
 
BOOLEAN IsHiiValueTrue (IN EFI_HII_VALUE *Result)
 
EFI_STRING_ID NewHiiString (IN CHAR16 *String, IN EFI_HII_HANDLE HiiHandle)
 
EFI_STATUS ValidateNoSubmit (IN HII_FORMSET *FormSet, IN HII_FORM *Form, IN HII_STATEMENT *Question)
 
EFI_STATUS NoSubmitCheck (IN HII_FORMSET *FormSet, IN OUT HII_FORM **CurrentForm, OUT HII_STATEMENT **Statement)
 
VOID NewStringCat (IN OUT CHAR16 **Dest, IN CHAR16 *Src)
 
EFI_STATUS StorageToConfigResp (IN HII_FORMSET_STORAGE *Storage, IN CHAR16 **ConfigResp, IN CHAR16 *ConfigRequest)
 
EFI_STATUS ConfigRespToStorage (IN HII_FORMSET_STORAGE *Storage, IN CHAR16 *ConfigResp)
 
EFI_STATUS GetIfrBinaryData (IN EFI_HII_HANDLE Handle, IN OUT EFI_GUID *FormSetGuid, OUT UINTN *BinaryLength, OUT UINT8 **BinaryData)
 
BOOLEAN ElementValidation (IN HII_FORMSET_STORAGE *Storage, IN CHAR16 *RequestElement)
 
VOID AppendConfigRequest (IN OUT CHAR16 **ConfigRequest, IN OUT UINTN *SpareStrLen, IN CHAR16 *RequestElement)
 
BOOLEAN ConfigRequestAdjust (IN HII_FORMSET_STORAGE *Storage, IN CHAR16 *Request, IN BOOLEAN RespString)
 
VOID LoadFormSetStorage (IN HII_FORMSET *FormSet, IN HII_FORMSET_STORAGE *Storage)
 
VOID ExtendValueToU64 (IN HII_STATEMENT_VALUE *Value)
 
EFI_STATUS PopStack (IN EFI_HII_VALUE *Stack, IN OUT EFI_HII_VALUE **StackPtr, OUT EFI_HII_VALUE *Data)
 
EFI_STATUS PushStack (IN OUT EFI_HII_VALUE **Stack, IN OUT EFI_HII_VALUE **StackPtr, IN OUT EFI_HII_VALUE **StackEnd, IN EFI_HII_VALUE *Data)
 
EFI_STATUS CreateFormSetFromHiiHandle (IN EFI_HII_HANDLE Handle, IN OUT EFI_GUID *FormSetGuid, OUT HII_FORMSET *FormSet)
 
VOID InitializeFormSet (IN OUT HII_FORMSET *FormSet)
 
EFI_STATUS GetValueByName (IN HII_FORMSET_STORAGE *Storage, IN CHAR16 *Name, IN OUT CHAR16 **Value)
 
EFI_STATUS GetQuestionValue (IN HII_FORMSET *FormSet, IN HII_FORM *Form, IN OUT HII_STATEMENT *Question, IN GET_SET_QUESTION_VALUE_WITH GetValueFrom)
 
VOID IfrStrToUpper (IN CHAR16 *String)
 
BOOLEAN IsTypeInBuffer (IN EFI_HII_VALUE *Value)
 
BOOLEAN IsTypeInUINT64 (IN EFI_HII_VALUE *Value)
 
UINT8 * GetBufferForValue (IN EFI_HII_VALUE *Value)
 
UINT16 GetLengthForValue (IN EFI_HII_VALUE *Value)
 
UINT64 HiiValueToUINT64 (IN EFI_HII_VALUE *Value)
 
EFI_STATUS CompareHiiValue (IN EFI_HII_VALUE *Value1, IN EFI_HII_VALUE *Value2, OUT INTN *Result, IN EFI_HII_HANDLE HiiHandle OPTIONAL)
 
BOOLEAN CheckUserPrivilege (IN EFI_GUID *Guid)
 
HII_STATEMENTQuestionIdInForm (IN HII_FORM *Form, IN UINT16 QuestionId)
 
HII_STATEMENTQuestionIdInFormset (IN HII_FORMSET *FormSet, IN HII_FORM *Form, IN UINT16 QuestionId)
 
EFI_STATUS PushExpression (IN EFI_HII_VALUE *Value)
 
EFI_STATUS PopExpression (OUT EFI_HII_VALUE *Value)
 
UINTN SaveExpressionEvaluationStackOffset (VOID)
 
VOID RestoreExpressionEvaluationStackOffset (UINTN StackOffset)
 
EFI_STATUS IfrToString (IN HII_FORMSET *FormSet, IN UINT8 Format, OUT EFI_HII_VALUE *Result)
 
EFI_STATUS IfrToUint (IN HII_FORMSET *FormSet, OUT EFI_HII_VALUE *Result)
 
EFI_STATUS IfrCatenate (IN HII_FORMSET *FormSet, OUT EFI_HII_VALUE *Result)
 
EFI_STATUS IfrMatch (IN HII_FORMSET *FormSet, OUT EFI_HII_VALUE *Result)
 
EFI_STATUS IfrMatch2 (IN HII_FORMSET *FormSet, IN EFI_GUID *SyntaxType, OUT EFI_HII_VALUE *Result)
 
EFI_STATUS IfrFind (IN HII_FORMSET *FormSet, IN UINT8 Format, OUT EFI_HII_VALUE *Result)
 
EFI_STATUS IfrMid (IN HII_FORMSET *FormSet, OUT EFI_HII_VALUE *Result)
 
EFI_STATUS IfrToken (IN HII_FORMSET *FormSet, OUT EFI_HII_VALUE *Result)
 
EFI_STATUS IfrSpan (IN HII_FORMSET *FormSet, IN UINT8 Flags, OUT EFI_HII_VALUE *Result)
 
HII_EXPRESSIONRuleIdToExpression (IN HII_FORM *Form, IN UINT8 RuleId)
 
EFI_STATUS InitializeUnicodeCollationProtocol (VOID)
 
BOOLEAN IsFormsetGuidInHiiHandle (IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid)
 
EFI_HII_HANDLE DevicePathToHiiHandle (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_GUID *FormsetGuid)
 
BOOLEAN GetQuestionValueFromForm (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_HII_HANDLE InputHiiHandle, IN EFI_GUID *FormSetGuid, IN EFI_QUESTION_ID QuestionId, OUT EFI_HII_VALUE *Value)
 
EFI_STATUS HiiStatementValueToHiiValue (IN HII_STATEMENT_VALUE *StatementValue, OUT EFI_HII_VALUE *HiiValue)
 
EFI_STATUS ReleaseHiiValue (IN EFI_HII_VALUE *HiiValue)
 
EFI_STATUS EvaluateHiiExpression (IN HII_FORMSET *FormSet, IN HII_FORM *Form, IN OUT HII_EXPRESSION *Expression)
 
VOID SetArrayData (IN VOID *Array, IN UINT8 Type, IN UINTN Index, IN UINT64 Value)
 
HII_QUESTION_OPTIONValueToOption (IN HII_STATEMENT *Question, IN HII_STATEMENT_VALUE *OptionValue)
 
CHAR16 * GetOffsetFromConfigResp (IN HII_STATEMENT *Question, IN CHAR16 *ConfigResp)
 
EFI_STATUS GetDefaultValueFromAltCfg (IN HII_FORMSET *FormSet, IN HII_FORM *Form, IN HII_STATEMENT *Question, OUT HII_STATEMENT_VALUE *DefaultValue)
 
INTN GetDefaultIdForCallBack (IN UINTN DefaultId)
 
EFI_STATUS GetQuestionDefault (IN HII_FORMSET *FormSet, IN HII_FORM *Form, IN HII_STATEMENT *Question, IN UINT16 DefaultId, OUT HII_STATEMENT_VALUE *DefaultValue)
 

Variables

CHAR16 * mUnknownString = L"!"
 
CHAR16 * gEmptyString = L""
 
EFI_HII_VALUEmExpressionEvaluationStack = NULL
 
EFI_HII_VALUEmExpressionEvaluationStackEnd = NULL
 
EFI_HII_VALUEmExpressionEvaluationStackPointer = NULL
 
UINTN mExpressionEvaluationStackOffset = 0
 
EFI_UNICODE_COLLATION_PROTOCOLmUnicodeCollation = NULL
 
EFI_USER_MANAGER_PROTOCOLmUserManager = NULL
 

Detailed Description

HII utility internal functions.

Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2021 Hewlett Packard Enterprise Development LP
Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HiiUtilityInternal.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 request.
RequestElementNew Request element.

Definition at line 976 of file HiiUtilityInternal.c.

◆ BufferToQuestionValue()

EFI_STATUS BufferToQuestionValue ( IN HII_STATEMENT Question,
IN CHAR16 *  Value,
OUT HII_STATEMENT_VALUE QuestionValue 
)

Convert the buffer value to HiiValue.

Parameters
[in]QuestionThe question.
[in]ValueUnicode buffer save the question value.
[out]QuestionValueThe Question Value retrieved from Buffer.
Return values
Statuswhether convert the value success.

Definition at line 178 of file HiiUtilityInternal.c.

◆ CheckUserPrivilege()

BOOLEAN CheckUserPrivilege ( IN EFI_GUID Guid)

Check if current user has the privilege specified by the permissions GUID.

Parameters
[in]GuidA GUID specifying setup access permissions.
Return values
TRUECurrent user has the privilege.
FALSECurrent user does not have the privilege.

If the system does not support user management, then it is assumed that all users have admin privilege and evaluation of each EFI_IFR_SECURITY op-code is always TRUE.

Enumerate all user information of the current user profile to look for any EFI_USER_INFO_ACCESS_SETUP record.

Check if current user has the privilege specified by the permissions GUID.

Definition at line 2122 of file HiiUtilityInternal.c.

◆ CompareHiiValue()

EFI_STATUS CompareHiiValue ( IN EFI_HII_VALUE Value1,
IN EFI_HII_VALUE Value2,
OUT INTN Result,
IN EFI_HII_HANDLE HiiHandle  OPTIONAL 
)

Compare two Hii value.

Parameters
[in]Value1Expression value to compare on left-hand.
[in]Value2Expression value to compare on right-hand.
[out]ResultReturn value after compare. retval 0 Two operators equal. return Positive value if Value1 is greater than Value2. retval Negative value if Value1 is less than Value2.
[in]HiiHandleOnly required for string compare.
Return values
otherCould not perform compare on two values.
EFI_SUCCESSCompare the value success.
EFI_INVALID_PARAMETERValue1, Value2 or Result is NULL.

Definition at line 2017 of file HiiUtilityInternal.c.

◆ ConfigRequestAdjust()

BOOLEAN ConfigRequestAdjust ( IN HII_FORMSET_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 1031 of file HiiUtilityInternal.c.

◆ ConfigRespToStorage()

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

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

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

Definition at line 679 of file HiiUtilityInternal.c.

◆ CreateFormSetFromHiiHandle()

EFI_STATUS CreateFormSetFromHiiHandle ( IN EFI_HII_HANDLE  Handle,
IN OUT EFI_GUID FormSetGuid,
OUT HII_FORMSET FormSet 
)

Initialize the internal data structure of a FormSet.

Parameters
[in]HandlePackageList Handle
[in,out]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).
[out]FormSetFormSet data structure.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_NOT_FOUNDThe specified FormSet could not be found.

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 30 of file HiiUtilityLib.c.

◆ DevicePathToHiiHandle()

EFI_HII_HANDLE DevicePathToHiiHandle ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
IN EFI_GUID FormsetGuid 
)

Find HII Handle in the HII database associated with given Device Path.

If DevicePath is NULL, then ASSERT.

Parameters
[in]DevicePathDevice Path associated with the HII package list handle.
[in]FormsetGuidThe formset guid for this formset.
Return values
HandleHII package list Handle associated with the Device Path.
NULLHii Package list handle is not found.

Definition at line 3625 of file HiiUtilityInternal.c.

◆ ElementValidation()

BOOLEAN ElementValidation ( IN HII_FORMSET_STORAGE Storage,
IN CHAR16 *  RequestElement 
)

Check if the requested element is in storage.

Parameters
StorageThe storage contains elements.
RequestElementThe element to be searched.

Definition at line 959 of file HiiUtilityInternal.c.

◆ EvaluateHiiExpression()

EFI_STATUS EvaluateHiiExpression ( IN HII_FORMSET FormSet,
IN HII_FORM Form,
IN OUT HII_EXPRESSION Expression 
)

Evaluate the result of a HII expression.

If Expression is NULL, then ASSERT.

Parameters
[in]FormSetFormSet associated with this expression.
[in]FormForm associated with this expression.
[in,out]ExpressionExpression to be evaluated.
Return values
EFI_SUCCESSThe expression evaluated successfully.
EFI_NOT_FOUNDThe Question which referenced by a QuestionId could not be found.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.
EFI_ACCESS_DENIEDThe pop operation underflowed the stack.
EFI_INVALID_PARAMETERSyntax error with the Expression.
EFI_INVALID_PARAMETERFormset, Form or Expression is NULL.

Definition at line 3912 of file HiiUtilityInternal.c.

◆ ExtendValueToU64()

VOID ExtendValueToU64 ( IN HII_STATEMENT_VALUE Value)

Zero extend integer/boolean/date/time to UINT64 for comparing.

Parameters
[in]ValueHII Value to be converted.

Definition at line 1294 of file HiiUtilityInternal.c.

◆ GetBitsQuestionValue()

VOID GetBitsQuestionValue ( IN HII_STATEMENT Question,
IN UINT8 *  Buffer,
OUT HII_STATEMENT_VALUE QuestionValue 
)

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
[in]QuestionThe question refer to bit field.
[in]BufferPoint to the buffer which the question value get from.
[out]QuestionValueThe Question Value retrieved from Bits.

Definition at line 112 of file HiiUtilityInternal.c.

◆ GetBufferForValue()

UINT8 * GetBufferForValue ( IN EFI_HII_VALUE Value)

Return the buffer pointer for this value.

EFI_IFR_TYPE_REF, EFI_IFR_TYPE_DATE and EFI_IFR_TYPE_TIME are converted to EFI_IFR_TYPE_BUFFER when do the value compare.

Parameters
[in]ValueExpression value to compare on.
Return values
BufReturn the buffer pointer.

Definition at line 1882 of file HiiUtilityInternal.c.

◆ GetDefaultIdForCallBack()

INTN GetDefaultIdForCallBack ( IN UINTN  DefaultId)

Get default Id value used for browser.

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

Definition at line 5391 of file HiiUtilityInternal.c.

◆ GetDefaultValueFromAltCfg()

EFI_STATUS GetDefaultValueFromAltCfg ( IN HII_FORMSET FormSet,
IN HII_FORM Form,
IN HII_STATEMENT Question,
OUT HII_STATEMENT_VALUE DefaultValue 
)

Get Question default value from AltCfg string.

Parameters
[in]FormSetThe form set.
[in]FormThe form
[in]QuestionThe question.
[out]DefaultValueDefault value.
Return values
EFI_SUCCESSQuestion is reset to default value.

Definition at line 5336 of file HiiUtilityInternal.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
[in]HandlePackageList Handle
[in,out]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).
[out]BinaryLengthThe length of the FormSet IFR binary.
[out]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 781 of file HiiUtilityInternal.c.

◆ GetLengthForValue()

UINT16 GetLengthForValue ( IN EFI_HII_VALUE Value)

Return the buffer length for this value.

EFI_IFR_TYPE_REF, EFI_IFR_TYPE_DATE and EFI_IFR_TYPE_TIME are converted to EFI_IFR_TYPE_BUFFER when do the value compare.

Parameters
[in]ValueExpression value to compare on.
Return values
BufLenReturn the buffer length.

Definition at line 1920 of file HiiUtilityInternal.c.

◆ GetOffsetFromConfigResp()

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

Find the point in the ConfigResp string for this question.

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

Definition at line 5261 of file HiiUtilityInternal.c.

◆ GetQuestionDefault()

EFI_STATUS GetQuestionDefault ( IN HII_FORMSET FormSet,
IN HII_FORM Form,
IN HII_STATEMENT Question,
IN UINT16  DefaultId,
OUT HII_STATEMENT_VALUE DefaultValue 
)

Get default value of question.

Parameters
[in]FormSetThe form set.
[in]FormThe form.
[in]QuestionThe question.
[in]DefaultIdThe Class of the default.
[out]DefaultValueThe default value of given question.
Return values
EFI_SUCCESSQuestion is reset to default value.

Definition at line 5425 of file HiiUtilityInternal.c.

◆ GetQuestionValue()

EFI_STATUS GetQuestionValue ( IN HII_FORMSET FormSet,
IN HII_FORM Form,
IN OUT HII_STATEMENT Question,
IN GET_SET_QUESTION_VALUE_WITH  GetValueFrom 
)

Get Question's current Value.

Parameters
[in]FormSetFormSet data structure.
[in]FormForm data structure.
[in,out]QuestionQuestion to be initialized.
[in]GetValueFromWhere to get value, may from editbuffer, buffer or hii driver.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERFormset, Form or Question is NULL.

Definition at line 1460 of file HiiUtilityInternal.c.

◆ GetQuestionValueFromForm()

BOOLEAN GetQuestionValueFromForm ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
IN EFI_HII_HANDLE  InputHiiHandle,
IN EFI_GUID FormSetGuid,
IN EFI_QUESTION_ID  QuestionId,
OUT EFI_HII_VALUE Value 
)

Get question value from the predefined formset.

Parameters
[in]DevicePathThe driver's device path which produce the formset data.
[in]InputHiiHandleThe hii handle associate with the formset data.
[in]FormSetGuidThe formset guid which include the question.
[in]QuestionIdThe question id which need to get value from.
[out]ValueThe return data about question's value.
Return values
TRUEGet the question value success.
FALSEGet the question value failed.

Definition at line 3715 of file HiiUtilityInternal.c.

◆ GetTokenString()

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

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

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

Definition at line 313 of file HiiUtilityInternal.c.

◆ GetValueByName()

EFI_STATUS GetValueByName ( IN HII_FORMSET_STORAGE Storage,
IN CHAR16 *  Name,
IN OUT CHAR16 **  Value 
)

Get Value for given Name from a NameValue Storage.

Parameters
[in]StorageThe NameValue Storage.
[in]NameThe Name.
[in,out]ValueThe returned Value.
Return values
EFI_SUCCESSValue found for given Name.
EFI_NOT_FOUNDNo such Name found in NameValue storage.
EFI_INVALID_PARAMETERStorage or Value is NULL.

Definition at line 1417 of file HiiUtilityInternal.c.

◆ HiiStatementValueToHiiValue()

EFI_STATUS HiiStatementValueToHiiValue ( IN HII_STATEMENT_VALUE StatementValue,
OUT EFI_HII_VALUE HiiValue 
)

Covert HII_STATEMENT_VALUE to EFI_HII_VALUE.

The HiiValue->Buffer is allocated from EFI boot services memory. It is the responsibility of the caller to free the memory allocated.

Parameters
[in]StatementValueSource to be converted.
[out]HiiValueThe buffer that is converted from StatementValue
Return values
EFI_SUCCESSConvert successfully.
EFI_INVALID_PARAMETERStatementValue is NULL or HiiValue is NULL.

Definition at line 3842 of file HiiUtilityInternal.c.

◆ HiiStringToLowercase()

VOID EFIAPI HiiStringToLowercase ( IN EFI_STRING  ConfigString)

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

Parameters
[in]ConfigStringString to be converted

Definition at line 344 of file HiiUtilityInternal.c.

◆ HiiValueToUINT64()

UINT64 HiiValueToUINT64 ( IN EFI_HII_VALUE Value)

Get UINT64 type value.

Parameters
[in]ValueInput Hii value.
Return values
UINT64Return the UINT64 type value.

Definition at line 1955 of file HiiUtilityInternal.c.

◆ IfrCatenate()

EFI_STATUS IfrCatenate ( IN HII_FORMSET FormSet,
OUT EFI_HII_VALUE Result 
)

Evaluate opcode EFI_IFR_CATENATE.

Parameters
[in]FormSetFormset which contains this opcode.
[out]ResultEvaluation result for this opcode.
Return values
EFI_SUCCESSOpcode evaluation success.
OtherOpcode evaluation failed.

Definition at line 2606 of file HiiUtilityInternal.c.

◆ IfrFind()

EFI_STATUS IfrFind ( IN HII_FORMSET FormSet,
IN UINT8  Format,
OUT EFI_HII_VALUE Result 
)

Evaluate opcode EFI_IFR_FIND.

Parameters
[in]FormSetFormset which contains this opcode.
[in]FormatCase sensitive or insensitive.
[out]ResultEvaluation result for this opcode.
Return values
EFI_SUCCESSOpcode evaluation success.
OtherOpcode evaluation failed.

Definition at line 2984 of file HiiUtilityInternal.c.

◆ IfrMatch()

EFI_STATUS IfrMatch ( IN HII_FORMSET FormSet,
OUT EFI_HII_VALUE Result 
)

Evaluate opcode EFI_IFR_MATCH.

Parameters
[in]FormSetFormset which contains this opcode.
[out]ResultEvaluation result for this opcode.
Return values
EFI_SUCCESSOpcode evaluation success.
OtherOpcode evaluation failed.

Definition at line 2724 of file HiiUtilityInternal.c.

◆ IfrMatch2()

EFI_STATUS IfrMatch2 ( IN HII_FORMSET FormSet,
IN EFI_GUID SyntaxType,
OUT EFI_HII_VALUE Result 
)

Evaluate opcode EFI_IFR_MATCH2.

Parameters
[in]FormSetFormset which contains this opcode.
[in]SyntaxTypeSyntax type for match2.
[out]ResultEvaluation result for this opcode.
Return values
EFI_SUCCESSOpcode evaluation success.
OtherOpcode evaluation failed.

Definition at line 2798 of file HiiUtilityInternal.c.

◆ IfrMid()

EFI_STATUS IfrMid ( IN HII_FORMSET FormSet,
OUT EFI_HII_VALUE Result 
)

Evaluate opcode EFI_IFR_MID.

Parameters
[in]FormSetFormset which contains this opcode.
[out]ResultEvaluation result for this opcode.
Return values
EFI_SUCCESSOpcode evaluation success.
OtherOpcode evaluation failed.

Definition at line 3087 of file HiiUtilityInternal.c.

◆ IfrSpan()

EFI_STATUS IfrSpan ( IN HII_FORMSET FormSet,
IN UINT8  Flags,
OUT EFI_HII_VALUE Result 
)

Evaluate opcode EFI_IFR_SPAN.

Parameters
[in]FormSetFormset which contains this opcode.
[in]FlagsFIRST_MATCHING or FIRST_NON_MATCHING.
[out]ResultEvaluation result for this opcode.
Return values
EFI_SUCCESSOpcode evaluation success.
OtherOpcode evaluation failed.

Definition at line 3314 of file HiiUtilityInternal.c.

◆ IfrStrToUpper()

VOID IfrStrToUpper ( IN CHAR16 *  String)

Convert the input Unicode character to upper.

Parameters
[in]StringTh Unicode character to be converted.

Definition at line 1789 of file HiiUtilityInternal.c.

◆ IfrToken()

EFI_STATUS IfrToken ( IN HII_FORMSET FormSet,
OUT EFI_HII_VALUE Result 
)

Evaluate opcode EFI_IFR_TOKEN.

Parameters
[in]FormSetFormset which contains this opcode.
[out]ResultEvaluation result for this opcode.
Return values
EFI_SUCCESSOpcode evaluation success.
OtherOpcode evaluation failed.

Definition at line 3194 of file HiiUtilityInternal.c.

◆ IfrToString()

EFI_STATUS IfrToString ( IN HII_FORMSET FormSet,
IN UINT8  Format,
OUT EFI_HII_VALUE Result 
)

Evaluate opcode EFI_IFR_TO_STRING.

Parameters
[in]FormSetFormset which contains this opcode.
[in]FormatString format in EFI_IFR_TO_STRING.
[out]ResultEvaluation result for this opcode.
Return values
EFI_SUCCESSOpcode evaluation success.
OtherOpcode evaluation failed.

Definition at line 2417 of file HiiUtilityInternal.c.

◆ IfrToUint()

EFI_STATUS IfrToUint ( IN HII_FORMSET FormSet,
OUT EFI_HII_VALUE Result 
)

Evaluate opcode EFI_IFR_TO_UINT.

Parameters
[in]FormSetFormset which contains this opcode.
[out]ResultEvaluation result for this opcode.
Return values
EFI_SUCCESSOpcode evaluation success.
OtherOpcode evaluation failed.

Definition at line 2527 of file HiiUtilityInternal.c.

◆ InitializeFormSet()

VOID InitializeFormSet ( IN OUT HII_FORMSET FormSet)

Initialize a Formset and get current setting for Questions.

Parameters
[in,out]FormSetFormSet data structure.

Initialize a Formset and get current setting for Questions.

Parameters
FormSetFormSet data structure.

Definition at line 114 of file HiiUtilityLib.c.

◆ InitializeUnicodeCollationProtocol()

EFI_STATUS InitializeUnicodeCollationProtocol ( VOID  )

Locate the Unicode Collation Protocol interface for later use.

Return values
EFI_SUCCESSProtocol interface initialize success.
OtherProtocol interface initialize failed.

Definition at line 3472 of file HiiUtilityInternal.c.

◆ IsFormsetGuidInHiiHandle()

BOOLEAN IsFormsetGuidInHiiHandle ( IN EFI_HII_HANDLE  HiiHandle,
IN EFI_GUID FormSetGuid 
)

Check whether the formset guid is in this Hii package list.

Parameters
[in]HiiHandleThe HiiHandle for this HII package list.
[in]FormSetGuidThe formset guid for the request formset.
Return values
TRUEFind the formset guid.
FALSENot found the formset guid.

Definition at line 3506 of file HiiUtilityInternal.c.

◆ IsHiiValueTrue()

BOOLEAN IsHiiValueTrue ( IN EFI_HII_VALUE Result)

Evaluate if the result is a non-zero value.

Parameters
[in]ResultThe result to be evaluated.
Return values
TRUEIt is a non-zero value.
FALSEIt is a zero value.

Definition at line 375 of file HiiUtilityInternal.c.

◆ IsTypeInBuffer()

BOOLEAN IsTypeInBuffer ( IN EFI_HII_VALUE Value)

Check whether this value type can be transfer to EFI_IFR_TYPE_BUFFER type.

EFI_IFR_TYPE_REF, EFI_IFR_TYPE_DATE and EFI_IFR_TYPE_TIME are converted to EFI_IFR_TYPE_BUFFER when do the value compare.

Parameters
[in]ValueExpression value to compare on.
Return values
TRUEThis value type can be transferred to EFI_IFR_TYPE_BUFFER type.
FALSEThis value type can't be transferred to EFI_IFR_TYPE_BUFFER type.

Definition at line 1819 of file HiiUtilityInternal.c.

◆ IsTypeInUINT64()

BOOLEAN IsTypeInUINT64 ( IN EFI_HII_VALUE Value)

Check whether this value type can be transfer to EFI_IFR_TYPE_UINT64

Parameters
[in]ValueExpression value to compare on.
Return values
TRUEThis value type can be transferred to EFI_IFR_TYPE_BUFFER type.
FALSEThis value type can't be transferred to EFI_IFR_TYPE_BUFFER type.

Definition at line 1849 of file HiiUtilityInternal.c.

◆ LoadFormSetStorage()

VOID LoadFormSetStorage ( IN HII_FORMSET FormSet,
IN HII_FORMSET_STORAGE Storage 
)

Fill storage with settings requested from Configuration Driver.

Parameters
[in]FormSetFormSet data structure.
[in]StorageBuffer Storage.

Definition at line 1161 of file HiiUtilityInternal.c.

◆ NewHiiString()

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

Set a new string to string package.

Parameters
[in]StringA pointer to the Null-terminated Unicode string to add or update in the String Package associated with HiiHandle.
[in]HiiHandleA handle that was previously registered in the HII Database.
Returns
the Id for this new string.

Definition at line 413 of file HiiUtilityInternal.c.

◆ NewStringCat()

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

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

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

Definition at line 534 of file HiiUtilityInternal.c.

◆ NewStringCopy()

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

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

Parameters
[in,out]DestLocation to copy string
[in]SrcString to copy

Definition at line 36 of file HiiUtilityInternal.c.

◆ NoSubmitCheck()

EFI_STATUS NoSubmitCheck ( IN HII_FORMSET FormSet,
IN OUT HII_FORM **  CurrentForm,
OUT HII_STATEMENT **  Statement 
)

Perform NoSubmit check for each Form in FormSet.

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

Definition at line 482 of file HiiUtilityInternal.c.

◆ PopExpression()

EFI_STATUS PopExpression ( OUT EFI_HII_VALUE Value)

Pop an Expression value from the stack.

Parameters
[out]ValueExpression value to pop.
Return values
EFI_SUCCESSThe value was popped onto the stack.
EFI_ACCESS_DENIEDThe pop operation underflowed the stack
EFI_INVALID_PARAMETERValue is NULL.

Definition at line 2359 of file HiiUtilityInternal.c.

◆ PopStack()

EFI_STATUS PopStack ( IN EFI_HII_VALUE Stack,
IN OUT EFI_HII_VALUE **  StackPtr,
OUT EFI_HII_VALUE Data 
)

Pop an element from the stack.

Parameters
StackOn input: old stack
StackPtrOn input: old stack pointer; On output: new stack pointer
DataData to pop.
Return values
EFI_SUCCESSThe value was popped onto the stack.
EFI_ACCESS_DENIEDThe pop operation underflowed the stack

Definition at line 170 of file Expression.c.

◆ PushExpression()

EFI_STATUS PushExpression ( IN EFI_HII_VALUE Value)

Push an Expression value onto the Stack

Parameters
[in]ValueExpression value to push.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.
EFI_INVALID_PARAMETERValue is NULL.

Definition at line 2332 of file HiiUtilityInternal.c.

◆ PushStack()

EFI_STATUS PushStack ( IN OUT EFI_HII_VALUE **  Stack,
IN OUT EFI_HII_VALUE **  StackPtr,
IN OUT EFI_HII_VALUE **  StackEnd,
IN EFI_HII_VALUE Data 
)

Push an element onto the Boolean Stack.

Parameters
StackOn input: old stack; On output: new stack
StackPtrOn input: old stack pointer; On output: new stack pointer
StackEndOn input: old stack end; On output: new stack end
DataData to push.
Return values
EFI_SUCCESSPush stack success.

Definition at line 122 of file Expression.c.

◆ QuestionIdInForm()

HII_STATEMENT * QuestionIdInForm ( IN HII_FORM Form,
IN UINT16  QuestionId 
)

Search a Question in Form scope using its QuestionId.

Parameters
[in]FormThe form which contains this Question.
[in]QuestionIdId of this Question.
Return values
PointerThe Question.
NULLSpecified Question not found in the form.

Definition at line 2232 of file HiiUtilityInternal.c.

◆ QuestionIdInFormset()

HII_STATEMENT * QuestionIdInFormset ( IN HII_FORMSET FormSet,
IN HII_FORM Form,
IN UINT16  QuestionId 
)

Search a Question in Formset scope using its QuestionId.

Parameters
[in]FormSetThe formset which contains this form.
[in]FormThe form which contains this Question.
[in]QuestionIdId of this Question.
Return values
PointerThe Question.
NULLSpecified Question not found in the form.

Definition at line 2273 of file HiiUtilityInternal.c.

◆ ReleaseHiiValue()

EFI_STATUS ReleaseHiiValue ( IN EFI_HII_VALUE HiiValue)

Release the buffer in EFI_HII_VALUE if the buffer is not NULL.

Parameters
[in]HiiValueThe buffer to be released.
Return values
EFI_SUCCESSrelease HiiValue successfully.
EFI_INVALID_PARAMETERHiiValue is NULL.

Definition at line 3874 of file HiiUtilityInternal.c.

◆ RestoreExpressionEvaluationStackOffset()

VOID RestoreExpressionEvaluationStackOffset ( UINTN  StackOffset)

Restore stack offset based on input stack offset

Parameters
[in]StackOffsetOffset to stack start.

Definition at line 2398 of file HiiUtilityInternal.c.

◆ RuleIdToExpression()

HII_EXPRESSION * RuleIdToExpression ( IN HII_FORM Form,
IN UINT8  RuleId 
)

Get Expression given its RuleId.

Parameters
[in]FormThe form which contains this Expression.
[in]RuleIdId of this Expression.
Return values
PointerThe Expression.
NULLSpecified Expression not found in the form.

Definition at line 3438 of file HiiUtilityInternal.c.

◆ SaveExpressionEvaluationStackOffset()

UINTN SaveExpressionEvaluationStackOffset ( VOID  )

Get current stack offset from stack start.

Returns
Stack offset to stack start.

Definition at line 2380 of file HiiUtilityInternal.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
[in]ArrayThe data array.
[in]TypeType of the data in this array.
[in]IndexZero based index for data in this array.
[in]ValueThe value to be set.

Definition at line 5166 of file HiiUtilityInternal.c.

◆ SetBitsQuestionValue()

VOID SetBitsQuestionValue ( IN HII_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
[in]QuestionThe question refer to bit field.
[in,out]BufferPoint to the buffer which the question value set to.
[in]ValueThe bit field value need to set.

Definition at line 148 of file HiiUtilityInternal.c.

◆ SetValueByName()

EFI_STATUS SetValueByName ( IN HII_FORMSET_STORAGE Storage,
IN CHAR16 *  Name,
IN CHAR16 *  Value,
OUT HII_NAME_VALUE_NODE **  ReturnNode 
)

Set Value of given Name in a NameValue Storage.

Parameters
[in]StorageThe NameValue Storage.
[in]NameThe Name.
[in]ValueThe Value to set.
[out]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 61 of file HiiUtilityInternal.c.

◆ StorageToConfigResp()

EFI_STATUS StorageToConfigResp ( IN HII_FORMSET_STORAGE Storage,
IN CHAR16 **  ConfigResp,
IN CHAR16 *  ConfigRequest 
)

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

Parameters
[in]StorageThe Storage to be converted.
[in]ConfigRespThe returned <ConfigResp>.
[in]ConfigRequestThe ConfigRequest string.
Return values
EFI_SUCCESSConvert success.
EFI_INVALID_PARAMETERIncorrect storage type.

Definition at line 572 of file HiiUtilityInternal.c.

◆ ValidateNoSubmit()

EFI_STATUS ValidateNoSubmit ( IN HII_FORMSET FormSet,
IN HII_FORM Form,
IN HII_STATEMENT Question 
)

Perform nosubmitif check for a Form.

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

Definition at line 436 of file HiiUtilityInternal.c.

◆ ValueToOption()

HII_QUESTION_OPTION * ValueToOption ( IN HII_STATEMENT Question,
IN HII_STATEMENT_VALUE OptionValue 
)

Search an Option of a Question by its value.

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

Definition at line 5208 of file HiiUtilityInternal.c.

Variable Documentation

◆ gEmptyString

CHAR16* gEmptyString = L""

Definition at line 15 of file HiiUtilityInternal.c.

◆ mExpressionEvaluationStack

EFI_HII_VALUE* mExpressionEvaluationStack = NULL

Definition at line 17 of file HiiUtilityInternal.c.

◆ mExpressionEvaluationStackEnd

EFI_HII_VALUE* mExpressionEvaluationStackEnd = NULL

Definition at line 18 of file HiiUtilityInternal.c.

◆ mExpressionEvaluationStackOffset

UINTN mExpressionEvaluationStackOffset = 0

Definition at line 20 of file HiiUtilityInternal.c.

◆ mExpressionEvaluationStackPointer

EFI_HII_VALUE* mExpressionEvaluationStackPointer = NULL

Definition at line 19 of file HiiUtilityInternal.c.

◆ mUnicodeCollation

EFI_UNICODE_COLLATION_PROTOCOL* mUnicodeCollation = NULL

Definition at line 25 of file HiiUtilityInternal.c.

◆ mUnknownString

CHAR16* mUnknownString = L"!"

Definition at line 14 of file HiiUtilityInternal.c.

◆ mUserManager

Definition at line 26 of file HiiUtilityInternal.c.