language variable, then use default setting that 'eng' as current\r
language setting.\r
\r
- @param Lang Pointer of system language\r
+ @param Lang Pointer of system language\r
\r
- @return whether sucess to get setting from variable\r
+ @return whether sucess to get setting from variable\r
**/\r
EFI_STATUS\r
GetCurrentLanguage (\r
- OUT CHAR16 *Lang\r
+ OUT CHAR16 *Lang\r
)\r
{\r
- EFI_STATUS Status;\r
- UINTN Size;\r
- UINTN Index;\r
- CHAR8 Language[4];\r
+ EFI_STATUS Status;\r
+ UINTN Size;\r
+ UINTN Index;\r
+ CHAR8 Language[4];\r
\r
//\r
// Getting the system language and placing it into our Global Data\r
}\r
\r
/**\r
- Add a string to the incoming buffer and return the token and offset data\r
+ Add a string to the incoming buffer and return the token and offset data.\r
\r
- @param StringBuffer The incoming buffer\r
- @param Language Currrent language\r
- @param String The string to be added\r
- @param StringToken The index where the string placed \r
+ @param StringBuffer The incoming buffer\r
+ @param Language Currrent language\r
+ @param String The string to be added\r
+ @param StringToken The index where the string placed \r
\r
@retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
@retval EFI_SUCCESS String successfully added to the incoming buffer\r
**/\r
EFI_STATUS\r
AddString (\r
- IN VOID *StringBuffer,\r
- IN CHAR16 *Language,\r
- IN CHAR16 *String,\r
- IN OUT STRING_REF *StringToken\r
+ IN VOID *StringBuffer,\r
+ IN CHAR16 *Language,\r
+ IN CHAR16 *String,\r
+ IN OUT STRING_REF *StringToken\r
)\r
{\r
- EFI_HII_STRING_PACK *StringPack;\r
- EFI_HII_STRING_PACK *StringPackBuffer;\r
- VOID *NewBuffer;\r
- RELOFST *PackSource;\r
- RELOFST *PackDestination;\r
- UINT8 *Source;\r
- UINT8 *Destination;\r
- UINTN Index;\r
- BOOLEAN Finished;\r
- UINTN SizeofLanguage;\r
- UINTN SizeofString;\r
+ EFI_HII_STRING_PACK *StringPack;\r
+ EFI_HII_STRING_PACK *StringPackBuffer;\r
+ VOID *NewBuffer;\r
+ RELOFST *PackSource;\r
+ RELOFST *PackDestination;\r
+ UINT8 *Source;\r
+ UINT8 *Destination;\r
+ UINTN Index;\r
+ BOOLEAN Finished;\r
+ UINTN SizeofLanguage;\r
+ UINTN SizeofString;\r
\r
StringPack = (EFI_HII_STRING_PACK *) StringBuffer;\r
Finished = FALSE;\r
}\r
\r
/**\r
- Add op-code data to the FormBuffer\r
+ Add op-code data to the FormBuffer.\r
\r
- @param FormBuffer Form buffer to be inserted to\r
- @param OpCodeData Op-code data to be inserted \r
+ @param FormBuffer Form buffer to be inserted to\r
+ @param OpCodeData Op-code data to be inserted \r
\r
- @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
- @retval EFI_SUCCESS Op-code data successfully inserted \r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+ @retval EFI_SUCCESS Op-code data successfully inserted \r
**/\r
EFI_STATUS\r
AddOpCode (\r
- IN VOID *FormBuffer,\r
- IN OUT VOID *OpCodeData\r
+ IN VOID *FormBuffer,\r
+ IN OUT VOID *OpCodeData\r
)\r
{\r
- EFI_HII_PACK_HEADER *NewBuffer;\r
- UINT8 *Source;\r
- UINT8 *Destination;\r
+ EFI_HII_PACK_HEADER *NewBuffer;\r
+ UINT8 *Source;\r
+ UINT8 *Destination;\r
\r
//\r
// Pre-allocate a buffer sufficient for us to work on.\r
}\r
\r
/**\r
- Get the HII protocol interface\r
+ Get the HII protocol interface.\r
\r
- @param Hii HII protocol interface\r
+ @param Hii HII protocol interface\r
\r
- @return the statue of locating HII protocol\r
+ @return the statue of locating HII protocol\r
**/\r
EFI_STATUS\r
GetHiiInterface (\r
- OUT EFI_HII_PROTOCOL **Hii\r
+ OUT EFI_HII_PROTOCOL **Hii\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
\r
//\r
// There should only be one HII protocol\r
}\r
\r
/**\r
- Extract information pertaining to the HiiHandle\r
+ Extract information pertaining to the HiiHandle.\r
\r
- @param HiiHandle Hii handle\r
- @param ImageLength For input, length of DefaultImage;\r
- For output, length of actually required\r
- @param DefaultImage Image buffer prepared by caller\r
- @param Guid Guid information about the form \r
+ @param HiiHandle Hii handle\r
+ @param ImageLength For input, length of DefaultImage;\r
+ For output, length of actually required\r
+ @param DefaultImage Image buffer prepared by caller\r
+ @param Guid Guid information about the form \r
\r
- @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
- @retval EFI_BUFFER_TOO_SMALL DefualtImage has no enough ImageLength\r
- @retval EFI_SUCCESS Successfully extract data from Hii database.\r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+ @retval EFI_BUFFER_TOO_SMALL DefualtImage has no enough ImageLength\r
+ @retval EFI_SUCCESS Successfully extract data from Hii database.\r
**/\r
EFI_STATUS\r
ExtractDataFromHiiHandle (\r
- IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,\r
- IN OUT UINT16 *ImageLength,\r
- OUT UINT8 *DefaultImage,\r
- OUT EFI_GUID *Guid\r
+ IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,\r
+ IN OUT UINT16 *ImageLength,\r
+ OUT UINT8 *DefaultImage,\r
+ OUT EFI_GUID *Guid\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_HII_PROTOCOL *Hii;\r
- UINTN DataLength;\r
- UINT8 *RawData;\r
- UINT8 *OldData;\r
- UINTN Index;\r
- UINTN Temp;\r
- UINTN SizeOfNvStore;\r
- UINTN CachedStart;\r
+ EFI_STATUS Status;\r
+ EFI_HII_PROTOCOL *Hii;\r
+ UINTN DataLength;\r
+ UINT8 *RawData;\r
+ UINT8 *OldData;\r
+ UINTN Index;\r
+ UINTN Temp;\r
+ UINTN SizeOfNvStore;\r
+ UINTN CachedStart;\r
\r
DataLength = DEFAULT_FORM_BUFFER_SIZE;\r
SizeOfNvStore = 0;\r
CachedStart = 0;\r
\r
Status = GetHiiInterface (&Hii);\r
-\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
// Get all the forms associated with this HiiHandle\r
//\r
Status = Hii->GetForms (Hii, HiiHandle, 0, &DataLength, RawData);\r
-\r
if (EFI_ERROR (Status)) {\r
gBS->FreePool (RawData);\r
\r
\r
for (Index = 0; RawData[Index] != FRAMEWORK_EFI_IFR_END_FORM_SET_OP;) {\r
switch (RawData[Index]) {\r
+ \r
case FRAMEWORK_EFI_IFR_FORM_SET_OP:\r
//\r
// Copy the GUID information from this handle\r
//\r
for (Index = 0; RawData[Index] != FRAMEWORK_EFI_IFR_END_FORM_SET_OP;) {\r
switch (RawData[Index]) {\r
+ \r
case FRAMEWORK_EFI_IFR_ONE_OF_OP:\r
CachedStart = ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;\r
break;\r
/**\r
Finds HII handle for given pack GUID previously registered with the HII.\r
\r
- @param HiiProtocol pointer to pointer to HII protocol interface.\r
- If NULL, the interface will be found but not returned.\r
- If it points to NULL, the interface will be found and\r
- written back to the pointer that is pointed to.\r
- @param Guid The GUID of the pack that registered with the HII.\r
+ @param HiiProtocol pointer to pointer to HII protocol interface.\r
+ If NULL, the interface will be found but not returned.\r
+ If it points to NULL, the interface will be found and\r
+ written back to the pointer that is pointed to.\r
+ @param Guid The GUID of the pack that registered with the HII.\r
\r
- @return Handle to the HII pack previously registered by the memory driver.\r
+ @return Handle to the HII pack previously registered by the memory driver.\r
**/\r
FRAMEWORK_EFI_HII_HANDLE \r
FindHiiHandle (\r
- IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL\r
- IN EFI_GUID *Guid\r
+ IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL\r
+ IN EFI_GUID *Guid\r
)\r
{\r
- EFI_STATUS Status;\r
-\r
- FRAMEWORK_EFI_HII_HANDLE *HiiHandleBuffer;\r
- FRAMEWORK_EFI_HII_HANDLE HiiHandle;\r
- UINT16 HiiHandleBufferLength;\r
- UINT32 NumberOfHiiHandles;\r
- EFI_GUID HiiGuid;\r
- EFI_HII_PROTOCOL *HiiProt;\r
- UINT32 Index;\r
- UINT16 Length;\r
+ EFI_STATUS Status;\r
+ FRAMEWORK_EFI_HII_HANDLE *HiiHandleBuffer;\r
+ FRAMEWORK_EFI_HII_HANDLE HiiHandle;\r
+ UINT16 HiiHandleBufferLength;\r
+ UINT32 NumberOfHiiHandles;\r
+ EFI_GUID HiiGuid;\r
+ EFI_HII_PROTOCOL *HiiProt;\r
+ UINT32 Index;\r
+ UINT16 Length;\r
\r
HiiHandle = 0;\r
if ((HiiProtocol != NULL) && (*HiiProtocol != NULL)) {\r
ExtractDataFromHiiHandle (HiiHandleBuffer[Index], &Length, NULL, &HiiGuid);\r
\r
if (CompareGuid (&HiiGuid, Guid)) {\r
-\r
HiiHandle = HiiHandleBuffer[Index];\r
break;\r
}\r
the reasonable parameters for that FormSet. Values for strings and passwords\r
are not verified due to their not having the equivalent of valid range settings.\r
\r
- @param HiiHandle Handle of the HII database entry to query\r
-\r
- @param Results If return Status is EFI_SUCCESS, Results provides valid data\r
+ @param HiiHandle Handle of the HII database entry to query\r
+ @param Results If return Status is EFI_SUCCESS, Results provides valid data\r
TRUE = NVRAM Data is within parameters\r
FALSE = NVRAM Data is NOT within parameters\r
- @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
- @retval EFI_SUCCESS Data successfully validated\r
+ \r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+ @retval EFI_SUCCESS Data successfully validated\r
**/\r
EFI_STATUS\r
ValidateDataFromHiiHandle (\r
- IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,\r
- OUT BOOLEAN *Results\r
+ IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,\r
+ OUT BOOLEAN *Results\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_HII_PROTOCOL *Hii;\r
- EFI_GUID Guid;\r
- UINT8 *RawData;\r
- UINT8 *OldData;\r
- UINTN RawDataLength;\r
- UINT8 *VariableData;\r
- UINTN Index;\r
- UINTN Temp;\r
- UINTN SizeOfNvStore;\r
- UINTN CachedStart;\r
- BOOLEAN GotMatch;\r
+ EFI_STATUS Status;\r
+ EFI_HII_PROTOCOL *Hii;\r
+ EFI_GUID Guid;\r
+ UINT8 *RawData;\r
+ UINT8 *OldData;\r
+ UINTN RawDataLength;\r
+ UINT8 *VariableData;\r
+ UINTN Index;\r
+ UINTN Temp;\r
+ UINTN SizeOfNvStore;\r
+ UINTN CachedStart;\r
+ BOOLEAN GotMatch;\r
\r
RawDataLength = DEFAULT_FORM_BUFFER_SIZE;\r
SizeOfNvStore = 0;\r
*Results = TRUE;\r
\r
Status = GetHiiInterface (&Hii);\r
-\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
// Get all the forms associated with this HiiHandle\r
//\r
Status = Hii->GetForms (Hii, HiiHandle, 0, &RawDataLength, RawData);\r
-\r
if (EFI_ERROR (Status)) {\r
gBS->FreePool (RawData);\r
\r
\r
for (Index = 0; RawData[Index] != FRAMEWORK_EFI_IFR_END_FORM_SET_OP;) {\r
switch (RawData[Index]) {\r
+ \r
case FRAMEWORK_EFI_IFR_FORM_SET_OP:\r
break;\r
\r
//\r
for (Index = 0; RawData[Index] != FRAMEWORK_EFI_IFR_END_FORM_SET_OP;) {\r
switch (RawData[Index]) {\r
+ \r
case FRAMEWORK_EFI_IFR_ONE_OF_OP:\r
//\r
// A one_of has no data, its the option that does - cache the storage Id\r