MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / FrontPageCallback

Function FrontPageCallback

CloverEFI/OsxBdsDxe/FrontPage.c:173–285  ·  view source on GitHub ↗

This function processes the results of changes in configuration. @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. @param Action Specifies the type of action taken by the browser. @param QuestionId A unique value which is sent to the original exporting driver so that it can identify the type of data to expect. @param Type

Source from the content-addressed store, hash-verified

171
172**/
173EFI_STATUS
174EFIAPI
175FrontPageCallback (
176 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
177 IN EFI_BROWSER_ACTION Action,
178 IN EFI_QUESTION_ID QuestionId,
179 IN UINT8 Type,
180 IN EFI_IFR_TYPE_VALUE *Value,
181 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
182 )
183{
184 CHAR8 *LangCode;
185 CHAR8 *Lang;
186 UINTN Index;
187
188 if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
189 //
190 // All other action return unsupported.
191 //
192 return EFI_UNSUPPORTED;
193 }
194
195 gCallbackKey = QuestionId;
196
197 if (Action == EFI_BROWSER_ACTION_CHANGED) {
198 if ((Value == NULL) || (ActionRequest == NULL)) {
199 return EFI_INVALID_PARAMETER;
200 }
201
202 switch (QuestionId) {
203 case FRONT_PAGE_KEY_CONTINUE:
204 //
205 // This is the continue - clear the screen and return an error to get out of FrontPage loop
206 //
207 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
208 break;
209
210 case FRONT_PAGE_KEY_LANGUAGE:
211 //
212 // Allocate working buffer for RFC 4646 language in supported LanguageString.
213 //
214 Lang = AllocatePool (AsciiStrSize (mLanguageString));
215 ASSERT (Lang != NULL);
216
217 Index = 0;
218 LangCode = mLanguageString;
219 while (*LangCode != 0) {
220 GetNextLanguage (&LangCode, Lang);
221
222 if (Index == Value->u8) {
223 break;
224 }
225
226 Index++;
227 }
228
229 if (Index == Value->u8) {
230 BdsDxeSetVariableAndReportStatusCodeOnError (

Callers

nothing calls this directly

Calls 5

AsciiStrSizeFunction · 0.85
GetNextLanguageFunction · 0.70
AllocatePoolFunction · 0.50
FreePoolFunction · 0.50

Tested by

no test coverage detected