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