]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
OvmfPkg EMU FVB: Add 2 functions to PlatformFvbLib
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / BootMaint / UpdatePage.c
index b6ea7ae8b20646de15868e00c16526b0d40f78c4..f83d166bb3bd6aa119ddcf707332df4fe4ce3583 100644 (file)
@@ -1,8 +1,8 @@
 /** @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
@@ -180,7 +180,7 @@ BootThisFile (
 \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
@@ -754,9 +754,8 @@ UpdateConModePage (
   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
@@ -812,11 +811,10 @@ UpdateConModePage (
     // 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
@@ -1312,21 +1310,13 @@ UpdateSetLegacyDeviceOrderPage (
 \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