]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/BdsDxe/String.c
Clean up BdsDxe for Doxygen comments requirement.
[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
b30312ba 25/**\r
93e3992d 26 Initialize HII global accessor for string support\r
27\r
93e3992d 28\r
b30312ba 29 @param VOID\r
30\r
31 @retval EFI_SUCCESS String support initialize success.\r
93e3992d 32\r
b30312ba 33**/\r
34EFI_STATUS\r
35InitializeStringSupport (\r
36 VOID\r
37 )\r
93e3992d 38{\r
39 EFI_STATUS Status;\r
40 EFI_HANDLE DriverHandle;\r
41 EFI_HII_PACKAGE_LIST_HEADER *PackageList;\r
42\r
43 Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &gHiiDatabase);\r
44 if (EFI_ERROR (Status)) {\r
45 return Status;\r
46 }\r
47\r
48 //\r
49 // Create driver handle used by HII database\r
50 //\r
51 Status = HiiLibCreateHiiDriverHandle (&DriverHandle);\r
52 if (EFI_ERROR (Status)) {\r
53 return Status;\r
54 }\r
55\r
062539cf 56 PackageList = HiiLibPreparePackageList (1, &mBdsStringPackGuid, &BdsDxeStrings);\r
93e3992d 57 ASSERT (PackageList != NULL);\r
58\r
59 Status = gHiiDatabase->NewPackageList (\r
60 gHiiDatabase,\r
61 PackageList,\r
62 DriverHandle,\r
63 &gStringPackHandle\r
64 );\r
65\r
66 FreePool (PackageList);\r
67 return Status;\r
68}\r
69\r
b30312ba 70/**\r
93e3992d 71 Get string by string id from HII Interface\r
72\r
93e3992d 73\r
b30312ba 74 @param Id String ID.\r
75\r
76 @retval CHAR16 * String from ID.\r
77 @retval NULL If error occurs.\r
93e3992d 78\r
b30312ba 79**/\r
80CHAR16 *\r
81GetStringById (\r
82 IN EFI_STRING_ID Id\r
83 )\r
93e3992d 84{\r
85 CHAR16 *String;\r
86\r
87 String = NULL;\r
9226efe5 88 HiiLibGetStringFromHandle (gStringPackHandle, Id, &String);\r
93e3992d 89\r
90 return String;\r
91}\r