This library class defines a set of interfaces to customize Ui module\r
\r
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under\r
-the terms and conditions of the BSD License that accompanies this distribution.\r
-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
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
#include <Uefi.h>\r
#define FRONT_PAGE_KEY_CONTINUE 0x1000\r
#define FRONT_PAGE_KEY_RESET 0x1001\r
#define FRONT_PAGE_KEY_LANGUAGE 0x1002\r
+#define FRONT_PAGE_KEY_DRIVER 0x2000\r
\r
typedef struct {\r
EFI_STRING_ID PromptId;\r
{\r
CHAR8 *LangCode;\r
CHAR8 *Lang;\r
+ UINTN LangSize;\r
CHAR8 *CurrentLang;\r
UINTN OptionCount;\r
CHAR16 *StringBuffer;\r
}\r
\r
if (EFI_ERROR (Status)) {\r
- StringBuffer = AllocatePool (AsciiStrSize (Lang) * sizeof (CHAR16));\r
+ LangSize = AsciiStrSize (Lang);\r
+ StringBuffer = AllocatePool (LangSize * sizeof (CHAR16));\r
ASSERT (StringBuffer != NULL);\r
- AsciiStrToUnicodeStr (Lang, StringBuffer);\r
+ AsciiStrToUnicodeStrS (Lang, StringBuffer, LangSize);\r
}\r
\r
ASSERT (StringBuffer != NULL);\r
\r
Count++;\r
if (Count >= CurrentSize) {\r
- DriverListPtr = AllocateCopyPool ((Count + UI_HII_DRIVER_LIST_SIZE) * sizeof (UI_HII_DRIVER_INSTANCE), gHiiDriverList);\r
+ DriverListPtr = ReallocatePool (\r
+ CurrentSize * sizeof (UI_HII_DRIVER_INSTANCE),\r
+ (Count + UI_HII_DRIVER_LIST_SIZE)\r
+ * sizeof (UI_HII_DRIVER_INSTANCE),\r
+ gHiiDriverList\r
+ );\r
ASSERT (DriverListPtr != NULL);\r
- FreePool (gHiiDriverList);\r
gHiiDriverList = DriverListPtr;\r
CurrentSize += UI_HII_DRIVER_LIST_SIZE;\r
}\r
gHiiDriverList[Index].PromptId,\r
gHiiDriverList[Index].HelpId,\r
0,\r
- 0,\r
+ (EFI_QUESTION_ID) (Index + FRONT_PAGE_KEY_DRIVER),\r
0,\r
&gHiiDriverList[Index].FormSetGuid,\r
gHiiDriverList[Index].DevicePathId\r