]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/BdsDxe/String.c
Remove the non-standard definition: GLYPH_WIDTH and GLYPH_HEIGHT. All reference to...
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / String.c
CommitLineData
fd6a62f3 1/** @file\r
2 String support\r
93e3992d 3\r
fd6a62f3 4Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
93e3992d 5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
fd6a62f3 13**/\r
93e3992d 14\r
15#include "Bds.h"\r
16#include "Language.h"\r
17#include "FrontPage.h"\r
18\r
19EFI_HII_HANDLE gStringPackHandle;\r
20\r
21EFI_GUID mBdsStringPackGuid = {\r
22 0x7bac95d3, 0xddf, 0x42f3, 0x9e, 0x24, 0x7c, 0x64, 0x49, 0x40, 0x37, 0x9a\r
23};\r
24\r
25EFI_STATUS\r
26InitializeStringSupport (\r
27 VOID\r
28 )\r
29/*++\r
30\r
31Routine Description:\r
32 Initialize HII global accessor for string support\r
33\r
34Arguments:\r
35 None\r
36\r
37Returns:\r
38 EFI_SUCCESS - String support initialize success.\r
39\r
40--*/\r
41{\r
42 EFI_STATUS Status;\r
43 EFI_HANDLE DriverHandle;\r
44 EFI_HII_PACKAGE_LIST_HEADER *PackageList;\r
45\r
46 Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &gHiiDatabase);\r
47 if (EFI_ERROR (Status)) {\r
48 return Status;\r
49 }\r
50\r
51 //\r
52 // Create driver handle used by HII database\r
53 //\r
54 Status = HiiLibCreateHiiDriverHandle (&DriverHandle);\r
55 if (EFI_ERROR (Status)) {\r
56 return Status;\r
57 }\r
58\r
062539cf 59 PackageList = HiiLibPreparePackageList (1, &mBdsStringPackGuid, &BdsDxeStrings);\r
93e3992d 60 ASSERT (PackageList != NULL);\r
61\r
62 Status = gHiiDatabase->NewPackageList (\r
63 gHiiDatabase,\r
64 PackageList,\r
65 DriverHandle,\r
66 &gStringPackHandle\r
67 );\r
68\r
69 FreePool (PackageList);\r
70 return Status;\r
71}\r
72\r
73CHAR16 *\r
74GetStringById (\r
75 IN EFI_STRING_ID Id\r
76 )\r
77/*++\r
78\r
79Routine Description:\r
80 Get string by string id from HII Interface\r
81\r
82Arguments:\r
83 Id - String ID.\r
84\r
85Returns:\r
86 CHAR16 * - String from ID.\r
87 NULL - If error occurs.\r
88\r
89--*/\r
90{\r
91 CHAR16 *String;\r
92\r
93 String = NULL;\r
9226efe5 94 HiiLibGetStringFromHandle (gStringPackHandle, Id, &String);\r
93e3992d 95\r
96 return String;\r
97}\r