]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Universal/BdsDxe/String.c
Retire Extended HII library class.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / String.c
1 /** @file
2 String support
3
4 Copyright (c) 2004 - 2008, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "Bds.h"
16 #include "Language.h"
17 #include "FrontPage.h"
18
19 EFI_HII_HANDLE gStringPackHandle;
20
21 EFI_GUID mBdsStringPackGuid = {
22 0x7bac95d3, 0xddf, 0x42f3, {0x9e, 0x24, 0x7c, 0x64, 0x49, 0x40, 0x37, 0x9a}
23 };
24
25 /**
26 Initialize HII global accessor for string support
27
28 @retval EFI_SUCCESS String support initialize success.
29
30 **/
31 EFI_STATUS
32 InitializeStringSupport (
33 VOID
34 )
35 {
36 EFI_STATUS Status;
37 EFI_HII_PACKAGE_LIST_HEADER *PackageList;
38
39 Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &gHiiDatabase);
40 if (EFI_ERROR (Status)) {
41 return Status;
42 }
43
44 PackageList = HiiLibPreparePackageList (1, &mBdsStringPackGuid, &BdsDxeStrings);
45 ASSERT (PackageList != NULL);
46
47 Status = gHiiDatabase->NewPackageList (
48 gHiiDatabase,
49 PackageList,
50 mBdsImageHandle,
51 &gStringPackHandle
52 );
53
54 FreePool (PackageList);
55 return Status;
56 }
57
58 /**
59 Get string by string id from HII Interface
60
61
62 @param Id String ID.
63
64 @retval CHAR16 * String from ID.
65 @retval NULL If error occurs.
66
67 **/
68 CHAR16 *
69 GetStringById (
70 IN EFI_STRING_ID Id
71 )
72 {
73 CHAR16 *String;
74
75 String = NULL;
76 HiiLibGetStringFromHandle (gStringPackHandle, Id, &String);
77
78 return String;
79 }