+++ /dev/null
-/** @file\r
- This library contains functions to do IFR opcode creation and utility functions \r
- to help module to interact with a UEFI Form Browser.\r
-\r
- Copyright (c) 2007 - 2008, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef _IFR_SUPPORT_LIBRARY_H_\r
-#define _IFR_SUPPORT_LIBRARY_H_\r
-\r
-#pragma pack(1)\r
-typedef struct {\r
- EFI_STRING_ID StringToken;\r
- EFI_IFR_TYPE_VALUE Value;\r
- UINT8 Flags;\r
-} IFR_OPTION;\r
-#pragma pack()\r
-\r
-typedef struct {\r
- ///\r
- /// Buffer size allocated for Data.\r
- ///\r
- UINT32 BufferSize;\r
-\r
- ///\r
- /// Offset in Data to append the newly created opcode binary.\r
- /// It will be adjusted automatically in Create***OpCode(), and should be\r
- /// initialized to 0 before invocation of a serial of Create***OpCode()\r
- ///\r
- UINT32 Offset;\r
-\r
- ///\r
- /// The destination buffer for created op-codes\r
- ///\r
- UINT8 *Data;\r
-} EFI_HII_UPDATE_DATA;\r
-\r
-\r
-/**\r
- Create EFI_IFR_END_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateEndOpCode (\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_DEFAULT_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param Value Value for the default\r
- @param Type Type for the default\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- @retval EFI_INVALID_PARAMETER The type is not valid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateDefaultOpCode (\r
- IN EFI_IFR_TYPE_VALUE *Value,\r
- IN UINT8 Type,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_ACTION_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param QuestionId Question ID\r
- @param Prompt String ID for Prompt\r
- @param Help String ID for Help\r
- @param QuestionFlags Flags in Question Header\r
- @param QuestionConfig String ID for configuration\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateActionOpCode (\r
- IN EFI_QUESTION_ID QuestionId,\r
- IN EFI_STRING_ID Prompt,\r
- IN EFI_STRING_ID Help,\r
- IN UINT8 QuestionFlags,\r
- IN EFI_STRING_ID QuestionConfig,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_SUBTITLE_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param Prompt String ID for Prompt\r
- @param Help String ID for Help\r
- @param Flags Subtitle opcode flags\r
- @param Scope Subtitle Scope bit\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- \r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateSubTitleOpCode (\r
- IN EFI_STRING_ID Prompt,\r
- IN EFI_STRING_ID Help,\r
- IN UINT8 Flags,\r
- IN UINT8 Scope,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_TEXT_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param Prompt String ID for Prompt\r
- @param Help String ID for Help\r
- @param TextTwo String ID for text two\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateTextOpCode (\r
- IN EFI_STRING_ID Prompt,\r
- IN EFI_STRING_ID Help,\r
- IN EFI_STRING_ID TextTwo,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_REF_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param FormId Destination Form ID\r
- @param Prompt String ID for Prompt\r
- @param Help String ID for Help\r
- @param QuestionFlags Flags in Question Header\r
- @param QuestionId Question ID\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateGotoOpCode (\r
- IN EFI_FORM_ID FormId,\r
- IN EFI_STRING_ID Prompt,\r
- IN EFI_STRING_ID Help,\r
- IN UINT8 QuestionFlags,\r
- IN EFI_QUESTION_ID QuestionId,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_ONE_OF_OPTION_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param OptionCount The number of options.\r
- @param OptionsList The list of Options.\r
- @param Type The data type.\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- @retval EFI_INVALID_PARAMETER If OptionCount is not zero but OptionsList is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateOneOfOptionOpCode (\r
- IN UINTN OptionCount,\r
- IN IFR_OPTION *OptionsList,\r
- IN UINT8 Type,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_ONE_OF_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param QuestionId Question ID\r
- @param VarStoreId Storage ID\r
- @param VarOffset Offset in Storage\r
- @param Prompt String ID for Prompt\r
- @param Help String ID for Help\r
- @param QuestionFlags Flags in Question Header\r
- @param OneOfFlags Flags for oneof opcode\r
- @param OptionsList List of options\r
- @param OptionCount Number of options in option list\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateOneOfOpCode (\r
- IN EFI_QUESTION_ID QuestionId,\r
- IN EFI_VARSTORE_ID VarStoreId,\r
- IN UINT16 VarOffset,\r
- IN EFI_STRING_ID Prompt,\r
- IN EFI_STRING_ID Help,\r
- IN UINT8 QuestionFlags,\r
- IN UINT8 OneOfFlags,\r
- IN IFR_OPTION *OptionsList,\r
- IN UINTN OptionCount,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_ORDERED_LIST_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param QuestionId Question ID\r
- @param VarStoreId Storage ID\r
- @param VarOffset Offset in Storage\r
- @param Prompt String ID for Prompt\r
- @param Help String ID for Help\r
- @param QuestionFlags Flags in Question Header\r
- @param OrderedListFlags Flags for ordered list opcode\r
- @param DataType Type for option value\r
- @param MaxContainers Maximum count for options in this ordered list\r
- @param OptionsList List of options\r
- @param OptionCount Number of options in option list\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateOrderedListOpCode (\r
- IN EFI_QUESTION_ID QuestionId,\r
- IN EFI_VARSTORE_ID VarStoreId,\r
- IN UINT16 VarOffset,\r
- IN EFI_STRING_ID Prompt,\r
- IN EFI_STRING_ID Help,\r
- IN UINT8 QuestionFlags,\r
- IN UINT8 OrderedListFlags,\r
- IN UINT8 DataType,\r
- IN UINT8 MaxContainers,\r
- IN IFR_OPTION *OptionsList,\r
- IN UINTN OptionCount,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_CHECKBOX_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param QuestionId Question ID\r
- @param VarStoreId Storage ID\r
- @param VarOffset Offset in Storage\r
- @param Prompt String ID for Prompt\r
- @param Help String ID for Help\r
- @param QuestionFlags Flags in Question Header\r
- @param CheckBoxFlags Flags for checkbox opcode\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateCheckBoxOpCode (\r
- IN EFI_QUESTION_ID QuestionId,\r
- IN EFI_VARSTORE_ID VarStoreId,\r
- IN UINT16 VarOffset,\r
- IN EFI_STRING_ID Prompt,\r
- IN EFI_STRING_ID Help,\r
- IN UINT8 QuestionFlags,\r
- IN UINT8 CheckBoxFlags,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_NUMERIC_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param QuestionId Question ID\r
- @param VarStoreId Storage ID\r
- @param VarOffset Offset in Storage\r
- @param Prompt String ID for Prompt\r
- @param Help String ID for Help\r
- @param QuestionFlags Flags in Question Header\r
- @param NumericFlags Flags for numeric opcode\r
- @param Minimum Numeric minimum value\r
- @param Maximum Numeric maximum value\r
- @param Step Numeric step for edit\r
- @param Default Numeric default value\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateNumericOpCode (\r
- IN EFI_QUESTION_ID QuestionId,\r
- IN EFI_VARSTORE_ID VarStoreId,\r
- IN UINT16 VarOffset,\r
- IN EFI_STRING_ID Prompt,\r
- IN EFI_STRING_ID Help,\r
- IN UINT8 QuestionFlags,\r
- IN UINT8 NumericFlags,\r
- IN UINT64 Minimum,\r
- IN UINT64 Maximum,\r
- IN UINT64 Step,\r
- IN UINT64 Default,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-\r
-/**\r
- Create EFI_IFR_STRING_OP opcode.\r
-\r
- If Data is NULL or Data->Data is NULL, then ASSERT.\r
-\r
- @param QuestionId Question ID\r
- @param VarStoreId Storage ID\r
- @param VarOffset Offset in Storage\r
- @param Prompt String ID for Prompt\r
- @param Help String ID for Help\r
- @param QuestionFlags Flags in Question Header\r
- @param StringFlags Flags for string opcode\r
- @param MinSize String minimum length\r
- @param MaxSize String maximum length\r
- @param Data Destination for the created opcode binary\r
-\r
- @retval EFI_SUCCESS Opcode is created successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
- @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CreateStringOpCode (\r
- IN EFI_QUESTION_ID QuestionId,\r
- IN EFI_VARSTORE_ID VarStoreId,\r
- IN UINT16 VarOffset,\r
- IN EFI_STRING_ID Prompt,\r
- IN EFI_STRING_ID Help,\r
- IN UINT8 QuestionFlags,\r
- IN UINT8 StringFlags,\r
- IN UINT8 MinSize,\r
- IN UINT8 MaxSize,\r
- IN OUT EFI_HII_UPDATE_DATA *Data\r
- )\r
-;\r
-/**\r
- Construct <ConfigAltResp> for a buffer storage.\r
-\r
- @param ConfigRequest The Config request string. If set to NULL, all the\r
- configurable elements will be extracted from BlockNameArray.\r
- @param Progress On return, points to a character in the Request.\r
- @param ConfigAltResp The returned <ConfigAltResp>.\r
- @param Guid GUID of the buffer storage.\r
- @param Name Name of the buffer storage.\r
- @param DriverHandle The DriverHandle which is used to invoke HiiDatabase\r
- protocol interface NewPackageList().\r
- @param BufferStorage Content of the buffer storage.\r
- @param BufferStorageSize Length in bytes of the buffer storage.\r
- @param BlockNameArray Array generated by VFR compiler.\r
- @param NumberAltCfg Number of Default value array generated by VFR compiler.\r
- The sequential input parameters will be number of\r
- AltCfgId and DefaultValueArray pairs. When set to 0,\r
- there will be no <AltResp>.\r
- @param ... Variable argument list. \r
- \r
- retval EFI_OUT_OF_RESOURCES Run out of memory resource.\r
- retval EFI_INVALID_PARAMETER ConfigAltResp is NULL.\r
- retval EFI_SUCCESS Operation successful.\r
-\r
-**/\r
-EFI_STATUS\r
-ConstructConfigAltResp (\r
- IN EFI_STRING ConfigRequest, OPTIONAL\r
- OUT EFI_STRING *Progress,\r
- OUT EFI_STRING *ConfigAltResp,\r
- IN EFI_GUID *Guid,\r
- IN CHAR16 *Name,\r
- IN EFI_HANDLE *DriverHandle,\r
- IN VOID *BufferStorage,\r
- IN UINTN BufferStorageSize,\r
- IN VOID *BlockNameArray, OPTIONAL\r
- IN UINTN NumberAltCfg,\r
- ...\r
-//IN UINT16 AltCfgId,\r
-//IN VOID *DefaultValueArray,\r
- )\r
-;\r
-\r
-/**\r
- Converts the unicode character of the string from uppercase to lowercase.\r
-\r
- @param Str String to be converted\r
-\r
- \r
-**/\r
-VOID\r
-EFIAPI\r
-ToLower (\r
- IN OUT CHAR16 *Str\r
- )\r
-;\r
-\r
-/**\r
- Converts binary buffer to a Unicode string. The byte buffer is in a reversed byte order \r
- compared with the byte order defined in BufToHexString().\r
-\r
- @param Str String for output\r
- @param Buffer Binary buffer.\r
- @param BufferSize Size of the buffer in bytes.\r
-\r
- @retval EFI_SUCCESS The function completed successfully.\r
- @retval EFI_OUT_OF_RESOURCES There is no enough available memory space.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-BufInReverseOrderToHexString (\r
- IN OUT CHAR16 *Str,\r
- IN UINT8 *Buffer,\r
- IN UINTN BufferSize\r
- )\r
-;\r
-\r
-/**\r
- Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().\r
-\r
- @param Buffer Pointer to buffer that receives the data.\r
- @param BufferSize Length in bytes of the buffer to hold converted\r
- data. If routine return with EFI_SUCCESS,\r
- containing length of converted data. If routine\r
- return with EFI_BUFFER_TOO_SMALL, containg length\r
- of buffer desired.\r
- @param Str String to be converted from.\r
-\r
- @retval EFI_SUCCESS The function completed successfully.\r
- @retval RETURN_BUFFER_TOO_SMALL The input BufferSize is too small to hold the output. BufferSize\r
- will be updated to the size required for the converstion.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-HexStringToBufInReverseOrder (\r
- IN OUT UINT8 *Buffer,\r
- IN OUT UINTN *BufferSize,\r
- IN CHAR16 *Str\r
- )\r
-;\r
-\r
-/**\r
- Convert binary representation Config string (e.g. "0041004200430044") to the\r
- original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.\r
- "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r
-\r
- @param UnicodeString Original Unicode string.\r
- @param StrBufferLen On input: Length in bytes of buffer to hold the Unicode string.\r
- Includes tailing '\0' character.\r
- On output:\r
- containing length of Unicode string buffer when returning EFI_SUCCESS;\r
- containg length of string buffer desired when returning EFI_BUFFER_TOO_SMALL.\r
- @param ConfigString Binary representation of Unicode String, <string> := (<HexCh>4)+\r
-\r
- @retval EFI_SUCCESS Operation completes successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The string buffer is too small.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-ConfigStringToUnicode (\r
- IN OUT CHAR16 *UnicodeString,\r
- IN OUT UINTN *StrBufferLen,\r
- IN CHAR16 *ConfigString\r
- )\r
-;\r
-\r
-/**\r
- Convert Unicode string to binary representation Config string, e.g.\r
- "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.\r
- "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r
-\r
- @param ConfigString Binary representation of Unicode String, <string> := (<HexCh>4)+\r
- @param StrBufferLen On input: Length in bytes of buffer to hold the Unicode string.\r
- Includes tailing '\0' character.\r
- On output:\r
- If return EFI_SUCCESS, containing length of Unicode string buffer.\r
- If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r
- @param UnicodeString Original Unicode string.\r
-\r
- @retval EFI_SUCCESS Operation completes successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The string buffer is too small.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnicodeToConfigString (\r
- IN OUT CHAR16 *ConfigString,\r
- IN OUT UINTN *StrBufferLen,\r
- IN CHAR16 *UnicodeString\r
- )\r
-;\r
-\r
-/**\r
- Construct <ConfigHdr> using routing information GUID/NAME/PATH.\r
-\r
- @param ConfigHdr Pointer to the ConfigHdr string.\r
- @param StrBufferLen On input: Length in bytes of buffer to hold the\r
- ConfigHdr string. Includes tailing '\0' character.\r
- On output: If return EFI_SUCCESS, containing\r
- length of ConfigHdr string buffer. If return\r
- EFI_BUFFER_TOO_SMALL, containg length of string\r
- buffer desired.\r
- @param Guid Routing information: GUID.\r
- @param Name Routing information: NAME.\r
- @param DriverHandle Driver handle which contains the routing\r
- information: PATH.\r
-\r
- @retval EFI_SUCCESS Operation completes successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The ConfigHdr string buffer is too small.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-ConstructConfigHdr (\r
- IN OUT CHAR16 *ConfigHdr,\r
- IN OUT UINTN *StrBufferLen,\r
- IN CONST EFI_GUID *Guid,\r
- IN CHAR16 *Name, OPTIONAL\r
- IN EFI_HANDLE *DriverHandle\r
- )\r
-\r
-;\r
-\r
-/**\r
- Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.\r
-\r
- @param ConfigString Either <ConfigRequest> or <ConfigResp>.\r
- @param StorageGuid GUID of the storage.\r
- @param StorageName Name of the stoarge.\r
-\r
- @retval TRUE Routing information is correct in ConfigString.\r
- @retval FALSE Routing information is incorrect in ConfigString.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-IsConfigHdrMatch (\r
- IN EFI_STRING ConfigString,\r
- IN EFI_GUID *StorageGuid, OPTIONAL\r
- IN CHAR16 *StorageName OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.\r
-\r
- @param String The string to be searched in.\r
- @param Offset Offset in BlockName.\r
- @param Width Width in BlockName.\r
-\r
- @retval TRUE Block name found.\r
- @retval FALSE Block name not found.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-FindBlockName (\r
- IN OUT CHAR16 *String,\r
- IN UINTN Offset,\r
- IN UINTN Width\r
- )\r
-;\r
-\r
-/**\r
- This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.\r
-\r
- @param VariableGuid An optional field to indicate the target variable\r
- GUID name to use.\r
- @param VariableName An optional field to indicate the target\r
- human-readable variable name.\r
- @param BufferSize On input: Length in bytes of buffer to hold\r
- retrived data. On output: If return\r
- EFI_BUFFER_TOO_SMALL, containg length of buffer\r
- desired.\r
- @param Buffer Buffer to hold retrived data.\r
-\r
- @retval EFI_SUCCESS Operation completes successfully.\r
- @retval EFI_BUFFER_TOO_SMALL The intput buffer is too small.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-GetBrowserData (\r
- IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
- IN CONST CHAR16 *VariableName, OPTIONAL\r
- IN OUT UINTN *BufferSize,\r
- IN OUT UINT8 *Buffer\r
- )\r
-;\r
-\r
-/**\r
- This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.\r
-\r
- @param VariableGuid An optional field to indicate the target variable\r
- GUID name to use.\r
- @param VariableName An optional field to indicate the target\r
- human-readable variable name.\r
- @param BufferSize Length in bytes of buffer to hold retrived data.\r
- @param Buffer Buffer to hold retrived data.\r
- @param RequestElement An optional field to specify which part of the\r
- buffer data will be send back to Browser. If NULL,\r
- the whole buffer of data will be committed to\r
- Browser. <RequestElement> ::=\r
- &OFFSET=<Number>&WIDTH=<Number>*\r
-\r
- @retval EFI_SUCCESS Operation completes successfully.\r
- @retval Other Updating Browser uncommitted data failed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SetBrowserData (\r
- IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
- IN CONST CHAR16 *VariableName, OPTIONAL\r
- IN UINTN BufferSize,\r
- IN CONST UINT8 *Buffer,\r
- IN CONST CHAR16 *RequestElement OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Draw a dialog and return the selected key.\r
-\r
- @param NumberOfLines The number of lines for the dialog box\r
- @param KeyValue The EFI_KEY value returned if HotKey is TRUE..\r
- @param String Pointer to the first string in the list\r
- @param ... A series of (quantity == NumberOfLines - 1) text\r
- strings which will be used to construct the dialog\r
- box\r
-\r
- @retval EFI_SUCCESS Displayed dialog and received user interaction\r
- @retval EFI_INVALID_PARAMETER One of the parameters was invalid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-IfrLibCreatePopUp (\r
- IN UINTN NumberOfLines,\r
- OUT EFI_INPUT_KEY *KeyValue,\r
- IN CHAR16 *String,\r
- ...\r
- )\r
-;\r
-\r
-/**\r
- Draw a dialog and return the selected key using Variable Argument List.\r
-\r
- @param NumberOfLines The number of lines for the dialog box\r
- @param KeyValue The EFI_KEY value returned if HotKey is TRUE..\r
- @param String The first String to be displayed in the Pop-Up.\r
- @param Args VA_LIST marker for the variable argument list.\r
- A series of (quantity == NumberOfLines - 1) text\r
- strings which will be used to construct the dialog\r
- box\r
-\r
- @retval EFI_SUCCESS Displayed dialog and received user interaction\r
- @retval EFI_INVALID_PARAMETER One of the parameters was invalid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-IfrLibCreatePopUp2 (\r
- IN UINTN NumberOfLines,\r
- OUT EFI_INPUT_KEY *KeyValue,\r
- IN CHAR16 *String,\r
- IN VA_LIST Args\r
- )\r
-;\r
-\r
-/**\r
- Test if a Unicode character is a hexadecimal digit. If true, the input\r
- Unicode character is converted to a byte. \r
-\r
- This function tests if a Unicode character is a hexadecimal digit. If true, the input\r
- Unicode character is converted to a byte. For example, Unicode character\r
- L'A' will be converted to 0x0A. \r
-\r
- If Digit is NULL, then ASSERT.\r
-\r
- @param Digit The output hexadecimal digit.\r
-\r
- @param Char The input Unicode character.\r
-\r
- @retval TRUE Char is in the range of Hexadecimal number. Digit is updated\r
- to the byte value of the number.\r
- @retval FALSE Char is not in the range of Hexadecimal number. Digit is keep\r
- intact.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-IsHexDigit (\r
- OUT UINT8 *Digit,\r
- IN CHAR16 Char\r
- )\r
-;\r
-\r
-\r
-/** \r
- Convert binary buffer to a Unicode String in a specified sequence. \r
-\r
- This function converts bytes in the memory block pointed by Buffer to a Unicode String Str. \r
- Each byte will be represented by two Unicode characters. For example, byte 0xA1 will \r
- be converted into two Unicode character L'A' and L'1'. In the output String, the Unicode Character \r
- for the Most Significant Nibble will be put before the Unicode Character for the Least Significant\r
- Nibble. The output string for the buffer containing a single byte 0xA1 will be L"A1". \r
- For a buffer with multiple bytes, the Unicode character produced by the first byte will be put into the \r
- the last character in the output string. The one next to first byte will be put into the\r
- character before the last character. This rules applies to the rest of the bytes. The Unicode\r
- character by the last byte will be put into the first character in the output string. For example,\r
- the input buffer for a 64-bits unsigned integer 0x12345678abcdef1234 will be converted to\r
- a Unicode string equal to L"12345678abcdef1234".\r
-\r
- @param String On input, String is pointed to the buffer allocated for the convertion.\r
- @param StringLen The Length of String buffer to hold the output String. The length must include the tailing '\0' character.\r
- The StringLen required to convert a N bytes Buffer will be a least equal to or greater \r
- than 2*N + 1.\r
- @param Buffer The pointer to a input buffer.\r
- @param BufferSizeInBytes Length in bytes of the input buffer.\r
- \r
-\r
- @retval EFI_SUCCESS The convertion is successful. All bytes in Buffer has been convert to the corresponding\r
- Unicode character and placed into the right place in String.\r
- @retval EFI_BUFFER_TOO_SMALL StringSizeInBytes is smaller than 2 * N + 1the number of bytes required to\r
- complete the convertion. \r
-**/\r
-RETURN_STATUS\r
-EFIAPI\r
-BufToHexString (\r
- IN OUT CHAR16 *String,\r
- IN OUT UINTN *StringLen,\r
- IN CONST UINT8 *Buffer,\r
- IN UINTN BufferSizeInBytes\r
- )\r
-;\r
-\r
-\r
-/**\r
- Convert a Unicode string consisting of hexadecimal characters to a output byte buffer.\r
-\r
- This function converts a Unicode string consisting of characters in the range of Hexadecimal\r
- character (L'0' to L'9', L'A' to L'F' and L'a' to L'f') to a output byte buffer. The function will stop\r
- at the first non-hexadecimal character or the NULL character. The convertion process can be\r
- simply viewed as the reverse operations defined by BufToHexString. Two Unicode characters will be \r
- converted into one byte. The first Unicode character represents the Most Significant Nibble and the\r
- second Unicode character represents the Least Significant Nibble in the output byte. \r
- The first pair of Unicode characters represents the last byte in the output buffer. The second pair of Unicode \r
- characters represent the the byte preceding the last byte. This rule applies to the rest pairs of bytes. \r
- The last pair represent the first byte in the output buffer. \r
-\r
- For example, a Unciode String L"12345678" will be converted into a buffer wil the following bytes \r
- (first byte is the byte in the lowest memory address): "0x78, 0x56, 0x34, 0x12".\r
-\r
- If String has N valid hexadecimal characters for conversion, the caller must make sure Buffer is at least \r
- N/2 (if N is even) or (N+1)/2 (if N if odd) bytes. \r
-\r
- If either Buffer, BufferSizeInBytes or String is NULL, then ASSERT ().\r
-\r
- @param Buffer The output buffer allocated by the caller.\r
- @param BufferSizeInBytes On input, the size in bytes of Buffer. On output, it is updated to \r
- contain the size of the Buffer which is actually used for the converstion.\r
- For Unicode string with 2*N hexadecimal characters (not including the \r
- tailing NULL character), N bytes of Buffer will be used for the output.\r
- @param String The input hexadecimal string.\r
- @param ConvertedStrLen The number of hexadecimal characters used to produce content in output\r
- buffer Buffer.\r
-\r
- @retval RETURN_BUFFER_TOO_SMALL The input BufferSizeInBytes is too small to hold the output. BufferSizeInBytes\r
- will be updated to the size required for the converstion.\r
- @retval RETURN_SUCCESS The convertion is successful or the first Unicode character from String\r
- is hexadecimal. If ConvertedStrLen is not NULL, it is updated\r
- to the number of hexadecimal character used for the converstion.\r
-**/\r
-RETURN_STATUS\r
-EFIAPI\r
-HexStringToBuf (\r
- OUT UINT8 *Buffer, \r
- IN OUT UINTN *BufferSizeInBytes,\r
- IN CONST CHAR16 *String,\r
- OUT UINTN *ConvertedStrLen OPTIONAL\r
- )\r
-;\r
-\r
-#endif\r