]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
Fix a type in the directory name. Compatiblity -> Compatibility.
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FrameworkHiiToUefiHiiThunk / HiiDatabase.c
1 /**@file
2
3 Framework to UEFI 2.1 HII Thunk
4
5 Copyright (c) 2003, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #include "HiiDatabase.h"
17
18
19 EFI_HII_THUNK_PRIVATE_DATA HiiThunkPrivateDataTempate = {
20 {//Signature
21 EFI_HII_THUNK_DRIVER_DATA_SIGNATURE
22 },
23 {//Handle
24 (EFI_HANDLE) NULL
25 },
26 { //Hii
27 HiiNewPack,
28 HiiRemovePack,
29 HiiFindHandles,
30 HiiExportDatabase,
31
32 HiiTestString,
33 HiiGetGlyph,
34 HiiGlyphToBlt,
35
36 HiiNewString,
37 HiiGetPrimaryLanguages,
38 HiiGetSecondaryLanguages,
39 HiiGetString,
40 HiiResetStrings,
41 HiiGetLine,
42 HiiGetForms,
43 HiiGetDefaultImage,
44 HiiUpdateForm,
45
46 HiiGetKeyboardLayout
47 },
48 { //StaticHiiHandle
49 //The FRAMEWORK_EFI_HII_HANDLE starts from 1
50 // and increase upwords untill reach 2^(sizeof (FRAMEWORK_EFI_HII_HANDLE)) - 1.
51 // The code will assert to prevent overflow.
52 (FRAMEWORK_EFI_HII_HANDLE) 1
53 },
54 {
55 NULL, NULL //HiiHandleLinkList
56 },
57 };
58
59 EFI_HII_DATABASE_PROTOCOL *mUefiHiiDatabaseProtocol;
60 EFI_HII_FONT_PROTOCOL *mUefiHiiFontProtocol;
61 EFI_HII_IMAGE_PROTOCOL *mUefiHiiImageProtocol;
62 EFI_HII_STRING_PROTOCOL *mUefiStringProtocol;
63
64 EFI_STATUS
65 EFIAPI
66 InitializeHiiDatabase (
67 IN EFI_HANDLE ImageHandle,
68 IN EFI_SYSTEM_TABLE *SystemTable
69 )
70 /*++
71
72 Routine Description:
73 Initialize HII Database
74
75 Arguments:
76 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
77
78 Returns:
79 EFI_SUCCESS - Setup loaded.
80 other - Setup Error
81
82 --*/
83 {
84 EFI_HII_THUNK_PRIVATE_DATA *HiiData;
85 EFI_HANDLE Handle;
86 EFI_STATUS Status;
87
88 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiProtocolGuid);
89
90 HiiData = AllocateCopyPool (sizeof (EFI_HII_THUNK_PRIVATE_DATA), &HiiThunkPrivateDataTempate);
91 ASSERT (HiiData != NULL);
92 InitializeListHead (&HiiData->HiiThunkHandleMappingDBListHead);
93
94 Status = gBS->LocateProtocol (
95 &gEfiHiiDatabaseProtocolGuid,
96 NULL,
97 (VOID **) &mUefiHiiDatabaseProtocol
98 );
99 ASSERT_EFI_ERROR (Status);
100
101 Status = gBS->LocateProtocol (
102 &gEfiHiiFontProtocolGuid,
103 NULL,
104 (VOID **) &mUefiHiiFontProtocol
105 );
106 ASSERT_EFI_ERROR (Status);
107
108 Status = gBS->LocateProtocol (
109 &gEfiHiiImageProtocolGuid,
110 NULL,
111 (VOID **) &mUefiHiiImageProtocol
112 );
113 ASSERT_EFI_ERROR (Status);
114
115 Status = gBS->LocateProtocol (
116 &gEfiHiiStringProtocolGuid,
117 NULL,
118 (VOID **) &mUefiStringProtocol
119 );
120 ASSERT_EFI_ERROR (Status);
121
122 //
123 // Install protocol interface
124 //
125 Handle = NULL;
126 Status = gBS->InstallProtocolInterface (
127 &HiiData->Handle,
128 &gEfiHiiProtocolGuid,
129 EFI_NATIVE_INTERFACE,
130 (VOID *) &HiiData->Hii
131 );
132 ASSERT_EFI_ERROR (Status);
133
134 return Status;
135 }
136
137 EFI_STATUS
138 EFIAPI
139 HiiFindHandles (
140 IN EFI_HII_PROTOCOL *This,
141 IN OUT UINT16 *HandleBufferLength,
142 OUT FRAMEWORK_EFI_HII_HANDLE Handle[1]
143 )
144 /*++
145
146 Routine Description:
147 Determines the handles that are currently active in the database.
148
149 Arguments:
150
151 Returns:
152
153 --*/
154 {
155 ASSERT (FALSE);
156 return EFI_SUCCESS;
157 }
158
159 EFI_STATUS
160 EFIAPI
161 HiiGetPrimaryLanguages (
162 IN EFI_HII_PROTOCOL *This,
163 IN FRAMEWORK_EFI_HII_HANDLE Handle,
164 OUT EFI_STRING *LanguageString
165 )
166 /*++
167
168 Routine Description:
169
170 This function allows a program to determine what the primary languages that are supported on a given handle.
171
172 Arguments:
173
174 Returns:
175
176 --*/
177 {
178 ASSERT (FALSE);
179 return EFI_SUCCESS;
180 }
181
182 EFI_STATUS
183 EFIAPI
184 HiiGetSecondaryLanguages (
185 IN EFI_HII_PROTOCOL *This,
186 IN FRAMEWORK_EFI_HII_HANDLE Handle,
187 IN CHAR16 *PrimaryLanguage,
188 OUT EFI_STRING *LanguageString
189 )
190 /*++
191
192 Routine Description:
193
194 This function allows a program to determine which secondary languages are supported
195 on a given handle for a given primary language.
196
197 Arguments:
198
199 Returns:
200
201 --*/
202 {
203 ASSERT (FALSE);
204 return EFI_SUCCESS;
205 }
206
207