/** @file\r
FrontPage routines to handle the callbacks and browser calls\r
\r
-Copyright (c) 2004 - 2009, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+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
@retval EFI_SUCCESS The Results is filled with the requested values.\r
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
- @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.\r
+ @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r
@retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r
\r
**/\r
OUT EFI_STRING *Results\r
)\r
{\r
- if (Request == NULL || Progress == NULL || Results == NULL) {\r
+ if (Progress == NULL || Results == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
*Progress = Request;\r
CHAR8 *PlatformSupportedLanguages;\r
CHAR8 *BestLanguage;\r
\r
+ if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) {\r
+ //\r
+ // Do nothing for UEFI OPEN/CLOSE Action\r
+ //\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
if ((Value == NULL) || (ActionRequest == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
if (FirstFlag) {\r
StringBuffer = HiiGetString (HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, Lang);\r
- ASSERT_EFI_ERROR (StringBuffer != NULL);\r
+ ASSERT (StringBuffer != NULL);\r
\r
//\r
// Save the string Id for each language\r
&ActionRequest\r
);\r
//\r
- // Check whether user change any option setting which needs a reset to be effective\r
+ // Check whether user change any option setting which needs a reset to be effective\r
//\r
if (ActionRequest == EFI_BROWSER_ACTION_REQUEST_RESET) {\r
EnableResetRequired ();\r
OUT CHAR16 **String\r
)\r
{\r
- UINT8 StrNum;\r
- UINTN CurrentStrLen;\r
- CHAR8* CharInStr;\r
- EFI_STATUS Status;\r
+ UINTN StrSize;\r
\r
- StrNum = 0;\r
- Status = EFI_NOT_FOUND;\r
- CharInStr = OptionalStrStart;\r
+ if (Index == 0) {\r
+ *String = AllocateZeroPool (sizeof (CHAR16));\r
+ return EFI_SUCCESS;\r
+ }\r
\r
- if (Index != 1) {\r
- CurrentStrLen = 0;\r
+ StrSize = 0;\r
+ do {\r
+ Index--;\r
+ OptionalStrStart += StrSize;\r
+ StrSize = AsciiStrSize (OptionalStrStart);\r
+ } while (OptionalStrStart[StrSize] != 0 && Index != 0);\r
+\r
+ if ((Index != 0) || (StrSize == 1)) {\r
//\r
- // look for the two consecutive zeros, check the string limit by the way.\r
+ // Meet the end of strings set but Index is non-zero, or\r
+ // Find an empty string\r
//\r
- while (*CharInStr != 0 || *(CharInStr+1) != 0) { \r
- if (*CharInStr == 0) {\r
- StrNum += 1;\r
- CharInStr++;\r
- }\r
- \r
- if (StrNum == Index) {\r
- Status = EFI_SUCCESS;\r
- break;\r
- }\r
- \r
- CurrentStrLen = AsciiStrLen(CharInStr);\r
- \r
- //\r
- // forward the pointer\r
- //\r
- OptionalStrStart = CharInStr;\r
- CharInStr += CurrentStrLen;\r
- }\r
- \r
- if (EFI_ERROR (Status)) {\r
- *String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));\r
- return Status;\r
- }\r
+ *String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));\r
} else {\r
- CurrentStrLen = AsciiStrLen(CharInStr);\r
+ *String = AllocatePool (StrSize * sizeof (CHAR16));\r
+ AsciiStrToUnicodeStr (OptionalStrStart, *String);\r
}\r
\r
- *String = AllocatePool((CurrentStrLen + 1)*sizeof(CHAR16));\r
- AsciiStrToUnicodeStr(OptionalStrStart, *String);\r
-\r
return EFI_SUCCESS;\r
}\r
\r
if (Record->Type == EFI_SMBIOS_TYPE_BIOS_INFORMATION) {\r
Type0Record = (SMBIOS_TABLE_TYPE0 *) Record;\r
StrIndex = Type0Record->BiosVersion;\r
- GetOptionalStringByIndex ((CHAR8*)(Type0Record+1), StrIndex, &NewString);\r
+ GetOptionalStringByIndex ((CHAR8*)((UINT8*)Type0Record + Type0Record->Hdr.Length), StrIndex, &NewString);\r
TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_BIOS_VERSION);\r
HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);\r
FreePool (NewString);\r
if (Record->Type == EFI_SMBIOS_TYPE_SYSTEM_INFORMATION) {\r
Type1Record = (SMBIOS_TABLE_TYPE1 *) Record;\r
StrIndex = Type1Record->ProductName;\r
- GetOptionalStringByIndex ((CHAR8*)(Type1Record+1), StrIndex, &NewString);\r
+ GetOptionalStringByIndex ((CHAR8*)((UINT8*)Type1Record + Type1Record->Hdr.Length), StrIndex, &NewString);\r
TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_COMPUTER_MODEL);\r
HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);\r
FreePool (NewString);\r
if (Record->Type == EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION) {\r
Type4Record = (SMBIOS_TABLE_TYPE4 *) Record;\r
StrIndex = Type4Record->ProcessorVersion;\r
- GetOptionalStringByIndex ((CHAR8*)(Type4Record+1), StrIndex, &NewString);\r
+ GetOptionalStringByIndex ((CHAR8*)((UINT8*)Type4Record + Type4Record->Hdr.Length), StrIndex, &NewString);\r
TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_CPU_MODEL);\r
HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);\r
FreePool (NewString);\r
@param TimeoutDefault The fault time out value before the system continue to boot.\r
\r
@retval EFI_SUCCESS User pressed some key except "Enter"\r
- @retval EFI_TIME_OUT Timout expired or user press "Enter"\r
+ @retval EFI_TIME_OUT Timeout expired or user press "Enter"\r
\r
**/\r
EFI_STATUS\r
@param TimeoutDefault The fault time out value before the system\r
continue to boot.\r
@param ConnectAllHappened The indicater to check if the connect all have\r
- already happended.\r
+ already happened.\r
\r
**/\r
VOID\r
\r
//\r
// If gCallbackKey is greater than 1 and less or equal to 5,\r
- // it will lauch configuration utilities.\r
+ // it will launch configuration utilities.\r
// 2 = set language\r
// 3 = boot manager\r
// 4 = device manager\r
- // 5 = boot maintainenance manager\r
+ // 5 = boot maintenance manager\r
//\r
if (gCallbackKey != 0) {\r
REPORT_STATUS_CODE (\r
// Display the Device Manager\r
//\r
do {\r
- CallDeviceManager();\r
+ CallDeviceManager ();\r
} while (gCallbackKey == FRONT_PAGE_KEY_DEVICE_MANAGER);\r
break;\r
\r