/** @file\r
Dynamically update the pages.\r
\r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2004 - 2011, 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
Option = (BDS_COMMON_OPTION *) AllocatePool (sizeof (BDS_COMMON_OPTION));\r
ASSERT (Option != NULL);\r
- Option->Description = FileContext->FileName;\r
+ Option->Description = (CHAR16 *) AllocateCopyPool (StrSize (FileContext->FileName), FileContext->FileName);\r
Option->DevicePath = FileContext->DevicePath;\r
Option->LoadOptionsSize = 0;\r
Option->LoadOptions = NULL;\r
UINTN Index;\r
UINTN Col;\r
UINTN Row;\r
- CHAR16 RowString[50];\r
CHAR16 ModeString[50];\r
- CHAR16 *pStr;\r
+ CHAR16 *PStr;\r
UINTN MaxMode;\r
UINTN ValidMode;\r
EFI_STRING_ID *ModeToken;\r
// Build mode string Column x Row\r
//\r
UnicodeValueToString (ModeString, 0, Col, 0);\r
- pStr = &ModeString[0];\r
- StrnCat (pStr, L" x ", StrLen(L" x "));\r
- UnicodeValueToString (RowString, 0, Row, 0);\r
- pStr = &ModeString[0];\r
- StrnCat (pStr, RowString, StrLen(RowString));\r
+ PStr = &ModeString[0];\r
+ StrnCat (PStr, L" x ", StrLen(L" x ") + 1);\r
+ PStr = PStr + StrLen (PStr);\r
+ UnicodeValueToString (PStr , 0, Row, 0);\r
\r
ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);\r
\r
\r
for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {\r
NewMenuEntry = BOpt_GetMenuEntry (OptionMenu, Index);\r
-\r
- if (Index == 0) {\r
- HiiCreateOneOfOptionOpCode (\r
- OptionsOpCodeHandle,\r
- NewMenuEntry->DisplayStringToken,\r
- EFI_IFR_OPTION_DEFAULT,\r
- EFI_IFR_NUMERIC_SIZE_1,\r
- (UINT8) ((BM_LEGACY_DEVICE_CONTEXT *) NewMenuEntry->VariableContext)->Index\r
- );\r
- }\r
-\r
+ //\r
+ // Create OneOf for each legacy device, select the first one by default\r
+ //\r
HiiCreateOneOfOptionOpCode (\r
OptionsOpCodeHandle,\r
NewMenuEntry->DisplayStringToken,\r
- 0,\r
+ (UINT8) ((Index == 0) ? EFI_IFR_OPTION_DEFAULT : 0),\r
EFI_IFR_NUMERIC_SIZE_1,\r
(UINT8) ((BM_LEGACY_DEVICE_CONTEXT *) NewMenuEntry->VariableContext)->Index\r
);\r