]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
MdeModulePkg RamDiskDxe: Do not save 'Size' numeric value by varstore
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / RamDiskDxe / RamDiskImpl.c
1 /** @file
2 HII Config Access protocol implementation of RamDiskDxe driver.
3
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 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 "RamDiskImpl.h"
16
17 CHAR16 mRamDiskStorageName[] = L"RAM_DISK_CONFIGURATION";
18
19 RAM_DISK_CONFIG_PRIVATE_DATA mRamDiskConfigPrivateDataTemplate = {
20 RAM_DISK_CONFIG_PRIVATE_DATA_SIGNATURE,
21 {
22 EFI_PAGE_SIZE
23 },
24 {
25 RamDiskExtractConfig,
26 RamDiskRouteConfig,
27 RamDiskCallback
28 }
29 };
30
31 HII_VENDOR_DEVICE_PATH mRamDiskHiiVendorDevicePath = {
32 {
33 {
34 HARDWARE_DEVICE_PATH,
35 HW_VENDOR_DP,
36 {
37 (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
38 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
39 }
40 },
41 RAM_DISK_FORM_SET_GUID
42 },
43 {
44 END_DEVICE_PATH_TYPE,
45 END_ENTIRE_DEVICE_PATH_SUBTYPE,
46 {
47 (UINT8) (END_DEVICE_PATH_LENGTH),
48 (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
49 }
50 }
51 };
52
53
54 /**
55 This function publish the RAM disk configuration Form.
56
57 @param[in, out] ConfigPrivateData
58 Points to RAM disk configuration private data.
59
60 @retval EFI_SUCCESS HII Form is installed successfully.
61 @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.
62 @retval Others Other errors as indicated.
63
64 **/
65 EFI_STATUS
66 InstallRamDiskConfigForm (
67 IN OUT RAM_DISK_CONFIG_PRIVATE_DATA *ConfigPrivateData
68 )
69 {
70 EFI_STATUS Status;
71 EFI_HII_HANDLE HiiHandle;
72 EFI_HANDLE DriverHandle;
73 EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
74
75 DriverHandle = NULL;
76 ConfigAccess = &ConfigPrivateData->ConfigAccess;
77 Status = gBS->InstallMultipleProtocolInterfaces (
78 &DriverHandle,
79 &gEfiDevicePathProtocolGuid,
80 &mRamDiskHiiVendorDevicePath,
81 &gEfiHiiConfigAccessProtocolGuid,
82 ConfigAccess,
83 NULL
84 );
85 if (EFI_ERROR (Status)) {
86 return Status;
87 }
88
89 ConfigPrivateData->DriverHandle = DriverHandle;
90
91 //
92 // Publish the HII package list
93 //
94 HiiHandle = HiiAddPackages (
95 &gRamDiskFormSetGuid,
96 DriverHandle,
97 RamDiskDxeStrings,
98 RamDiskHiiBin,
99 NULL
100 );
101 if (HiiHandle == NULL) {
102 gBS->UninstallMultipleProtocolInterfaces (
103 DriverHandle,
104 &gEfiDevicePathProtocolGuid,
105 &mRamDiskHiiVendorDevicePath,
106 &gEfiHiiConfigAccessProtocolGuid,
107 ConfigAccess,
108 NULL
109 );
110 return EFI_OUT_OF_RESOURCES;
111 }
112
113 ConfigPrivateData->HiiHandle = HiiHandle;
114
115 return EFI_SUCCESS;
116 }
117
118
119 /**
120 This function removes RAM disk configuration Form.
121
122 @param[in, out] ConfigPrivateData
123 Points to RAM disk configuration private data.
124
125 **/
126 VOID
127 UninstallRamDiskConfigForm (
128 IN OUT RAM_DISK_CONFIG_PRIVATE_DATA *ConfigPrivateData
129 )
130 {
131 //
132 // Uninstall HII package list
133 //
134 if (ConfigPrivateData->HiiHandle != NULL) {
135 HiiRemovePackages (ConfigPrivateData->HiiHandle);
136 ConfigPrivateData->HiiHandle = NULL;
137 }
138
139 //
140 // Uninstall HII Config Access Protocol
141 //
142 if (ConfigPrivateData->DriverHandle != NULL) {
143 gBS->UninstallMultipleProtocolInterfaces (
144 ConfigPrivateData->DriverHandle,
145 &gEfiDevicePathProtocolGuid,
146 &mRamDiskHiiVendorDevicePath,
147 &gEfiHiiConfigAccessProtocolGuid,
148 &ConfigPrivateData->ConfigAccess,
149 NULL
150 );
151 ConfigPrivateData->DriverHandle = NULL;
152 }
153
154 FreePool (ConfigPrivateData);
155 }
156
157
158 /**
159 Unregister all registered RAM disks.
160
161 **/
162 VOID
163 UnregisterAllRamDisks (
164 VOID
165 )
166 {
167 LIST_ENTRY *Entry;
168 LIST_ENTRY *NextEntry;
169 RAM_DISK_PRIVATE_DATA *PrivateData;
170
171 if (!IsListEmpty(&RegisteredRamDisks)) {
172 EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) {
173 PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
174
175 gBS->UninstallMultipleProtocolInterfaces (
176 PrivateData->Handle,
177 &gEfiBlockIoProtocolGuid,
178 &PrivateData->BlockIo,
179 &gEfiBlockIo2ProtocolGuid,
180 &PrivateData->BlockIo2,
181 &gEfiDevicePathProtocolGuid,
182 (EFI_DEVICE_PATH_PROTOCOL *) PrivateData->DevicePath,
183 NULL
184 );
185
186 RemoveEntryList (&PrivateData->ThisInstance);
187
188 if (RamDiskCreateHii == PrivateData->CreateMethod) {
189 //
190 // If a RAM disk is created within HII, then the RamDiskDxe driver
191 // driver is responsible for freeing the allocated memory for the
192 // RAM disk.
193 //
194 FreePool ((VOID *)(UINTN) PrivateData->StartingAddr);
195 }
196
197 FreePool (PrivateData->DevicePath);
198 FreePool (PrivateData);
199 }
200 }
201 }
202
203
204 /**
205 This function allows a caller to extract the current configuration for one
206 or more named elements from the target driver.
207
208 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
209 @param[in] Request A null-terminated Unicode string in
210 <ConfigRequest> format.
211 @param[out] Progress On return, points to a character in the Request
212 string. Points to the string's null terminator if
213 request was successful. Points to the most recent
214 '&' before the first failing name/value pair (or
215 the beginning of the string if the failure is in
216 the first name/value pair) if the request was not
217 successful.
218 @param[out] Results A null-terminated Unicode string in
219 <ConfigAltResp> format which has all values filled
220 in for the names in the Request string. String to
221 be allocated by the called function.
222
223 @retval EFI_SUCCESS The Results is filled with the requested
224 values.
225 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
226 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
227 @retval EFI_NOT_FOUND Routing data doesn't match any storage in
228 this driver.
229
230 **/
231 EFI_STATUS
232 EFIAPI
233 RamDiskExtractConfig (
234 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
235 IN CONST EFI_STRING Request,
236 OUT EFI_STRING *Progress,
237 OUT EFI_STRING *Results
238 )
239 {
240 if (Progress == NULL || Results == NULL) {
241 return EFI_INVALID_PARAMETER;
242 }
243 *Progress = Request;
244 return EFI_NOT_FOUND;
245 }
246
247
248 /**
249 This function processes the results of changes in configuration.
250
251 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
252 @param[in] Configuration A null-terminated Unicode string in <ConfigResp>
253 format.
254 @param[out] Progress A pointer to a string filled in with the offset of
255 the most recent '&' before the first failing
256 name/value pair (or the beginning of the string if
257 the failure is in the first name/value pair) or
258 the terminating NULL if all was successful.
259
260 @retval EFI_SUCCESS The Results is processed successfully.
261 @retval EFI_INVALID_PARAMETER Configuration is NULL.
262 @retval EFI_NOT_FOUND Routing data doesn't match any storage in
263 this driver.
264
265 **/
266 EFI_STATUS
267 EFIAPI
268 RamDiskRouteConfig (
269 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
270 IN CONST EFI_STRING Configuration,
271 OUT EFI_STRING *Progress
272 )
273 {
274 if (Configuration == NULL || Progress == NULL) {
275 return EFI_INVALID_PARAMETER;
276 }
277
278 return EFI_NOT_FOUND;
279 }
280
281
282 /**
283 Allocate memory and register the RAM disk created within RamDiskDxe
284 driver HII.
285
286 @param[in] Size If creating raw, size of the RAM disk to create.
287 If creating from file, zero.
288 @param[in] FileHandle If creating raw, NULL. If creating from file, the
289 file handle.
290
291 @retval EFI_SUCCESS RAM disk is created and registered.
292 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to match the
293 size required.
294
295 **/
296 EFI_STATUS
297 HiiCreateRamDisk (
298 IN UINT64 Size,
299 IN EFI_FILE_HANDLE FileHandle
300 )
301 {
302 EFI_STATUS Status;
303 UINTN BufferSize;
304 UINT64 StartingAddr;
305 EFI_INPUT_KEY Key;
306 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
307 RAM_DISK_PRIVATE_DATA *PrivateData;
308 EFI_FILE_INFO *FileInformation;
309
310 FileInformation = NULL;
311
312 if (FileHandle != NULL) {
313 //
314 // Create from file.
315 //
316 FileInformation = FileInfo (FileHandle);
317 if (NULL == FileInformation) {
318 do {
319 CreatePopUp (
320 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
321 &Key,
322 L"",
323 L"Not enough memory to get the file information!",
324 L"Press ENTER to continue ...",
325 L"",
326 NULL
327 );
328 } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
329
330 return EFI_OUT_OF_RESOURCES;
331 }
332
333 //
334 // Update the size of RAM disk according to the file size.
335 //
336 Size = FileInformation->FileSize;
337 }
338
339 if (Size > (UINTN) -1) {
340 do {
341 CreatePopUp (
342 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
343 &Key,
344 L"",
345 L"The given RAM disk size is too large!",
346 L"Press ENTER to continue ...",
347 L"",
348 NULL
349 );
350 } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
351
352 return EFI_OUT_OF_RESOURCES;
353 }
354
355 StartingAddr = (UINTN) AllocatePool ((UINTN) Size);
356 if (0 == StartingAddr) {
357 do {
358 CreatePopUp (
359 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
360 &Key,
361 L"",
362 L"Not enough memory to create the RAM disk!",
363 L"Press ENTER to continue ...",
364 L"",
365 NULL
366 );
367 } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
368
369 return EFI_OUT_OF_RESOURCES;
370 }
371
372 if (FileHandle != NULL) {
373 //
374 // Copy the file content to the RAM disk.
375 //
376 BufferSize = (UINTN) Size;
377 FileHandle->Read (
378 FileHandle,
379 &BufferSize,
380 (VOID *)(UINTN) StartingAddr
381 );
382 if (BufferSize != FileInformation->FileSize) {
383 do {
384 CreatePopUp (
385 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
386 &Key,
387 L"",
388 L"File content read error!",
389 L"Press ENTER to continue ...",
390 L"",
391 NULL
392 );
393 } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
394
395 return EFI_DEVICE_ERROR;
396 }
397 }
398
399 //
400 // Register the newly created RAM disk.
401 //
402 Status = RamDiskRegister (
403 StartingAddr,
404 Size,
405 &gEfiVirtualDiskGuid,
406 NULL,
407 &DevicePath
408 );
409 if (EFI_ERROR (Status)) {
410 do {
411 CreatePopUp (
412 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
413 &Key,
414 L"",
415 L"Fail to register the newly created RAM disk!",
416 L"Press ENTER to continue ...",
417 L"",
418 NULL
419 );
420 } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
421
422 return Status;
423 }
424
425 //
426 // If RAM disk is created within HII, memory should be freed when the
427 // RAM disk is unregisterd.
428 //
429 PrivateData = RAM_DISK_PRIVATE_FROM_THIS (RegisteredRamDisks.BackLink);
430 PrivateData->CreateMethod = RamDiskCreateHii;
431
432 return EFI_SUCCESS;
433 }
434
435
436 /**
437 This function updates the registered RAM disks list on the main form.
438
439 @param[in, out] ConfigPrivate
440 Private data for configurating hii data for RAM
441 disks.
442
443 **/
444 VOID
445 UpdateMainForm (
446 IN OUT RAM_DISK_CONFIG_PRIVATE_DATA *ConfigPrivate
447 )
448 {
449 VOID *StartOpCodeHandle;
450 VOID *EndOpCodeHandle;
451 EFI_IFR_GUID_LABEL *StartLabel;
452 EFI_IFR_GUID_LABEL *EndLabel;
453 LIST_ENTRY *Entry;
454 UINTN Index;
455 RAM_DISK_PRIVATE_DATA *PrivateData;
456 CHAR16 *String;
457 CHAR16 RamDiskStr[128];
458 EFI_STRING_ID StringId;
459
460 //
461 // Init OpCode Handle
462 //
463 StartOpCodeHandle = HiiAllocateOpCodeHandle ();
464 ASSERT (StartOpCodeHandle != NULL);
465
466 EndOpCodeHandle = HiiAllocateOpCodeHandle ();
467 ASSERT (EndOpCodeHandle != NULL);
468
469 //
470 // Create Hii Extend Label OpCode as the start opcode
471 //
472 StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (
473 StartOpCodeHandle,
474 &gEfiIfrTianoGuid,
475 NULL,
476 sizeof (EFI_IFR_GUID_LABEL)
477 );
478 StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
479 StartLabel->Number = MAIN_LABEL_LIST_START;
480
481 //
482 // Create Hii Extend Label OpCode as the end opcode
483 //
484 EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (
485 EndOpCodeHandle,
486 &gEfiIfrTianoGuid,
487 NULL,
488 sizeof (EFI_IFR_GUID_LABEL)
489 );
490 EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
491 EndLabel->Number = MAIN_LABEL_LIST_END;
492
493 Index = 0;
494 EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) {
495 PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
496 PrivateData->CheckBoxId = (EFI_QUESTION_ID)
497 (MAIN_CHECKBOX_QUESTION_ID_START + Index);
498 //
499 // CheckBox is unchecked by default.
500 //
501 PrivateData->CheckBoxChecked = FALSE;
502 String = RamDiskStr;
503
504 UnicodeSPrint (
505 String,
506 sizeof (RamDiskStr),
507 L" RAM Disk %d: [0x%lx, 0x%lx]\n",
508 Index,
509 PrivateData->StartingAddr,
510 PrivateData->StartingAddr + PrivateData->Size - 1
511 );
512
513 StringId = HiiSetString (ConfigPrivate->HiiHandle, 0, RamDiskStr, NULL);
514 ASSERT (StringId != 0);
515
516 HiiCreateCheckBoxOpCode (
517 StartOpCodeHandle,
518 PrivateData->CheckBoxId,
519 0,
520 0,
521 StringId,
522 STRING_TOKEN (STR_RAM_DISK_LIST_HELP),
523 EFI_IFR_FLAG_CALLBACK,
524 0,
525 NULL
526 );
527
528 Index++;
529 }
530
531 HiiUpdateForm (
532 ConfigPrivate->HiiHandle,
533 &gRamDiskFormSetGuid,
534 MAIN_FORM_ID,
535 StartOpCodeHandle,
536 EndOpCodeHandle
537 );
538
539 HiiFreeOpCodeHandle (StartOpCodeHandle);
540 HiiFreeOpCodeHandle (EndOpCodeHandle);
541 }
542
543
544 /**
545 This function processes the results of changes in configuration.
546
547 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
548 @param[in] Action Specifies the type of action taken by the browser.
549 @param[in] QuestionId A unique value which is sent to the original
550 exporting driver so that it can identify the type
551 of data to expect.
552 @param[in] Type The type of value for the question.
553 @param[in] Value A pointer to the data being sent to the original
554 exporting driver.
555 @param[out] ActionRequest On return, points to the action requested by the
556 callback function.
557
558 @retval EFI_SUCCESS The callback successfully handled the action.
559 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
560 variable and its data.
561 @retval EFI_DEVICE_ERROR The variable could not be saved.
562 @retval EFI_UNSUPPORTED The specified Action is not supported by the
563 callback.
564
565 **/
566 EFI_STATUS
567 EFIAPI
568 RamDiskCallback (
569 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
570 IN EFI_BROWSER_ACTION Action,
571 IN EFI_QUESTION_ID QuestionId,
572 IN UINT8 Type,
573 IN EFI_IFR_TYPE_VALUE *Value,
574 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
575 )
576 {
577 EFI_STATUS Status;
578 RAM_DISK_PRIVATE_DATA *PrivateData;
579 RAM_DISK_CONFIG_PRIVATE_DATA *ConfigPrivate;
580 EFI_DEVICE_PATH_PROTOCOL *FileDevPath;
581 EFI_FILE_HANDLE FileHandle;
582 LIST_ENTRY *Entry;
583 LIST_ENTRY *NextEntry;
584
585 if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
586 return EFI_INVALID_PARAMETER;
587 }
588
589 ConfigPrivate = RAM_DISK_CONFIG_PRIVATE_FROM_THIS (This);
590
591 if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
592 Status = EFI_UNSUPPORTED;
593 if (QuestionId == CREATE_RAW_SIZE_QUESTION_ID) {
594 Value->u64 = EFI_PAGE_SIZE;
595 ConfigPrivate->ConfigStore.Size = EFI_PAGE_SIZE;
596 Status = EFI_SUCCESS;
597 }
598 return Status;
599 }
600
601 if ((Action != EFI_BROWSER_ACTION_CHANGED) &&
602 (Action != EFI_BROWSER_ACTION_CHANGING) &&
603 (Action != EFI_BROWSER_ACTION_FORM_OPEN)) {
604 return EFI_UNSUPPORTED;
605 }
606
607 //
608 // Update the RAM disk list show at the main form first.
609 //
610 if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
611 Status = EFI_UNSUPPORTED;
612 if (QuestionId == MAIN_GOTO_FILE_EXPLORER_ID) {
613 UpdateMainForm (ConfigPrivate);
614 Status = EFI_SUCCESS;
615 }
616 return Status;
617 }
618
619 Status = EFI_SUCCESS;
620
621 if (Action == EFI_BROWSER_ACTION_CHANGING) {
622 switch (QuestionId) {
623 case MAIN_GOTO_FILE_EXPLORER_ID:
624 Status = ChooseFile (NULL, NULL, NULL, &FileDevPath);
625 if (EFI_ERROR (Status)) {
626 break;
627 }
628
629 if (FileDevPath != NULL) {
630 //
631 // Open the file.
632 //
633 Status = OpenFileByDevicePath (
634 &FileDevPath,
635 &FileHandle,
636 EFI_FILE_MODE_READ,
637 0
638 );
639 if (EFI_ERROR (Status)) {
640 break;
641 }
642
643 //
644 // Create from file, RAM disk size is zero. It will be updated
645 // according to the file size.
646 //
647 Status = HiiCreateRamDisk (0, FileHandle);
648 if (EFI_ERROR (Status)) {
649 break;
650 }
651
652 //
653 // Refresh the registered RAM disks list.
654 //
655 UpdateMainForm (ConfigPrivate);
656 }
657 break;
658
659 default:
660 break;
661 }
662 } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
663 switch (QuestionId) {
664 case MAIN_REMOVE_RD_QUESTION_ID:
665 //
666 // Remove the selected RAM disks
667 //
668 EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) {
669 PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
670 if (PrivateData->CheckBoxChecked) {
671 RamDiskUnregister (
672 (EFI_DEVICE_PATH_PROTOCOL *) PrivateData->DevicePath
673 );
674 }
675 }
676
677 UpdateMainForm (ConfigPrivate);
678
679 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
680 break;
681
682 case CREATE_RAW_SIZE_QUESTION_ID:
683 ConfigPrivate->ConfigStore.Size = Value->u64;
684 break;
685
686 case CREATE_RAW_SUBMIT_QUESTION_ID:
687 //
688 // Create raw, FileHandle is NULL.
689 //
690 Status = HiiCreateRamDisk (ConfigPrivate->ConfigStore.Size, NULL);
691 if (EFI_ERROR (Status)) {
692 break;
693 }
694
695 //
696 // Refresh the registered RAM disks list.
697 //
698 UpdateMainForm (ConfigPrivate);
699
700 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
701 break;
702
703 case CREATE_RAW_DISCARD_QUESTION_ID:
704 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
705 break;
706
707 default:
708 //
709 // QuestionIds for checkboxes
710 //
711 if ((QuestionId >= MAIN_CHECKBOX_QUESTION_ID_START) &&
712 (QuestionId < CREATE_RAW_RAM_DISK_FORM_ID)) {
713 EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) {
714 PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
715 if (PrivateData->CheckBoxId == QuestionId) {
716 PrivateData->CheckBoxChecked = (BOOLEAN) (Value->u8 != 0);
717 }
718 }
719 }
720 break;
721 }
722 }
723
724 return EFI_SUCCESS;
725 }