]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Compatibility/FvOnFv2Thunk/FvOnFv2Thunk.c
Add the missing check for NULL pointer before use it.
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FvOnFv2Thunk / FvOnFv2Thunk.c
1 /** @file
2 UEFI PI specification supersedes Inte's Framework Specification.
3 EFI_FIRMWARE_VOLUME_PROTOCOL defined in Intel Framework Pkg is replaced by
4 EFI_FIRMWARE_VOLUME2_PROTOCOL in MdePkg.
5 This module produces FV on top of FV2. This module is used on platform when both of
6 these two conditions are true:
7 1) Framework module consuming FV is present
8 2) And the platform only produces FV2
9
10 Copyright (c) 2006 - 2010 Intel Corporation. <BR>
11 All rights reserved. This program and the accompanying materials
12 are licensed and made available under the terms and conditions of the BSD License
13 which accompanies this distribution. The full text of the license may be found at
14 http://opensource.org/licenses/bsd-license.php
15
16 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
17 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Module Name:
19
20 **/
21
22 #include <PiDxe.h>
23 #include <Protocol/FirmwareVolume2.h>
24 #include <Protocol/FirmwareVolume.h>
25 #include <Library/BaseLib.h>
26 #include <Library/DebugLib.h>
27 #include <Library/UefiBootServicesTableLib.h>
28 #include <Library/UefiDriverEntryPoint.h>
29 #include <Library/UefiLib.h>
30 #include <Library/MemoryAllocationLib.h>
31
32 /**
33 Retrieves attributes, insures positive polarity of attribute bits, returns
34 resulting attributes in output parameter
35
36 @param This Calling context
37 @param Attributes output buffer which contains attributes
38
39 @retval EFI_INVALID_PARAMETER
40 @retval EFI_SUCCESS
41
42 **/
43 EFI_STATUS
44 EFIAPI
45 FvGetVolumeAttributes (
46 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
47 OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes
48 );
49
50 /**
51 Sets volume attributes
52
53 @param This Calling context
54 @param Attributes Buffer which contains attributes
55
56 @retval EFI_INVALID_PARAMETER
57 @retval EFI_DEVICE_ERROR
58 @retval EFI_SUCCESS
59
60 **/
61 EFI_STATUS
62 EFIAPI
63 FvSetVolumeAttributes (
64 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
65 IN OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes
66 );
67
68 /**
69 Read the requested file (NameGuid) and returns data in Buffer.
70
71 @param This Calling context
72 @param NameGuid Filename identifying which file to read
73 @param Buffer Pointer to pointer to buffer in which contents of file are returned.
74 <br>
75 If Buffer is NULL, only type, attributes, and size are returned as
76 there is no output buffer.
77 <br>
78 If Buffer != NULL and *Buffer == NULL, the output buffer is allocated
79 from BS pool by ReadFile
80 <br>
81 If Buffer != NULL and *Buffer != NULL, the output buffer has been
82 allocated by the caller and is being passed in.
83 @param BufferSize Indicates the buffer size passed in, and on output the size
84 required to complete the read
85 @param FoundType Indicates the type of the file who's data is returned
86 @param FileAttributes Indicates the attributes of the file who's data is resturned
87 @param AuthenticationStatus Indicates the authentication status of the data
88
89 @retval EFI_SUCCESS
90 @retval EFI_WARN_BUFFER_TOO_SMALL
91 @retval EFI_NOT_FOUND
92 @retval EFI_DEVICE_ERROR
93 @retval EFI_ACCESS_DENIED
94
95 **/
96 EFI_STATUS
97 EFIAPI
98 FvReadFile (
99 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
100 IN EFI_GUID *NameGuid,
101 IN OUT VOID **Buffer,
102 IN OUT UINTN *BufferSize,
103 OUT EFI_FV_FILETYPE *FoundType,
104 OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,
105 OUT UINT32 *AuthenticationStatus
106 );
107
108 /**
109 Read the requested section from the specified file and returns data in Buffer.
110
111 @param This Calling context
112 @param NameGuid Filename identifying the file from which to read
113 @param SectionType Indicates what section type to retrieve
114 @param SectionInstance Indicates which instance of SectionType to retrieve
115 @param Buffer Pointer to pointer to buffer in which contents of file are returned.
116 <br>
117 If Buffer is NULL, only type, attributes, and size are returned as
118 there is no output buffer.
119 <br>
120 If Buffer != NULL and *Buffer == NULL, the output buffer is allocated
121 from BS pool by ReadFile
122 <br>
123 If Buffer != NULL and *Buffer != NULL, the output buffer has been
124 allocated by the caller and is being passed in.
125 @param BufferSize Indicates the buffer size passed in, and on output the size
126 required to complete the read
127 @param AuthenticationStatus Indicates the authentication status of the data
128
129 @retval EFI_SUCCESS
130 @retval EFI_WARN_BUFFER_TOO_SMALL
131 @retval EFI_OUT_OF_RESOURCES
132 @retval EFI_NOT_FOUND
133 @retval EFI_DEVICE_ERROR
134 @retval EFI_ACCESS_DENIED
135
136 **/
137 EFI_STATUS
138 EFIAPI
139 FvReadSection (
140 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
141 IN EFI_GUID *NameGuid,
142 IN EFI_SECTION_TYPE SectionType,
143 IN UINTN SectionInstance,
144 IN OUT VOID **Buffer,
145 IN OUT UINTN *BufferSize,
146 OUT UINT32 *AuthenticationStatus
147 );
148
149 /**
150 Write the supplied file (NameGuid) to the FV.
151
152 @param This Calling context
153 @param NumberOfFiles Indicates the number of file records pointed to by FileData
154 @param WritePolicy Indicates the level of reliability of the write with respect to
155 things like power failure events.
156 @param FileData A pointer to an array of EFI_FV_WRITE_FILE_DATA structures. Each
157 element in the array indicates a file to write, and there are
158 NumberOfFiles elements in the input array.
159
160 @retval EFI_SUCCESS
161 @retval EFI_OUT_OF_RESOURCES
162 @retval EFI_DEVICE_ERROR
163 @retval EFI_WRITE_PROTECTED
164 @retval EFI_NOT_FOUND
165 @retval EFI_INVALID_PARAMETER
166
167 **/
168 EFI_STATUS
169 EFIAPI
170 FvWriteFile (
171 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
172 IN UINT32 NumberOfFiles,
173 IN FRAMEWORK_EFI_FV_WRITE_POLICY WritePolicy,
174 IN FRAMEWORK_EFI_FV_WRITE_FILE_DATA *FileData
175 );
176
177 /**
178 Given the input key, search for the next matching file in the volume.
179
180 @param This Calling context
181 @param Key Pointer to a caller allocated buffer that contains an implementation
182 specific key that is used to track where to begin searching on
183 successive calls.
184 @param FileType Indicates the file type to filter for
185 @param NameGuid Guid filename of the file found
186 @param Attributes Attributes of the file found
187 @param Size Size in bytes of the file found
188
189 @retval EFI_SUCCESS
190 @retval EFI_NOT_FOUND
191 @retval EFI_DEVICE_ERROR
192 @retval EFI_ACCESS_DENIED
193
194 **/
195 EFI_STATUS
196 EFIAPI
197 FvGetNextFile (
198 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
199 IN OUT VOID *Key,
200 IN OUT EFI_FV_FILETYPE *FileType,
201 OUT EFI_GUID *NameGuid,
202 OUT EFI_FV_FILE_ATTRIBUTES *Attributes,
203 OUT UINTN *Size
204 );
205
206 #define FIRMWARE_VOLUME_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('f', 'v', 't', 'h')
207
208 typedef struct {
209 UINTN Signature;
210 EFI_FIRMWARE_VOLUME_PROTOCOL FirmwareVolume;
211 EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2;
212 } FIRMWARE_VOLUME_PRIVATE_DATA;
213
214 #define FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS(a) CR (a, FIRMWARE_VOLUME_PRIVATE_DATA, FirmwareVolume, FIRMWARE_VOLUME_PRIVATE_DATA_SIGNATURE)
215
216 //
217 // Firmware Volume Protocol template
218 //
219 EFI_EVENT mFvRegistration;
220
221 FIRMWARE_VOLUME_PRIVATE_DATA gFirmwareVolumePrivateDataTemplate = {
222 FIRMWARE_VOLUME_PRIVATE_DATA_SIGNATURE,
223 {
224 FvGetVolumeAttributes,
225 FvSetVolumeAttributes,
226 FvReadFile,
227 FvReadSection,
228 FvWriteFile,
229 FvGetNextFile,
230 0,
231 NULL
232 },
233 NULL
234 };
235
236 //
237 // Module globals
238 //
239
240 VOID
241 EFIAPI
242 FvNotificationEvent (
243 IN EFI_EVENT Event,
244 IN VOID *Context
245 )
246 {
247 EFI_STATUS Status;
248 UINTN BufferSize;
249 EFI_HANDLE Handle;
250 FIRMWARE_VOLUME_PRIVATE_DATA *Private;
251 EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume;
252
253 while (TRUE) {
254 BufferSize = sizeof (Handle);
255 Status = gBS->LocateHandle (
256 ByRegisterNotify,
257 &gEfiFirmwareVolume2ProtocolGuid,
258 mFvRegistration,
259 &BufferSize,
260 &Handle
261 );
262 if (EFI_ERROR (Status)) {
263 //
264 // Exit Path of While Loop....
265 //
266 break;
267 }
268
269 //
270 // Skip this handle if the Firmware Volume Protocol is already installed
271 //
272 Status = gBS->HandleProtocol (
273 Handle,
274 &gEfiFirmwareVolumeProtocolGuid,
275 (VOID **)&FirmwareVolume
276 );
277 if (!EFI_ERROR (Status)) {
278 continue;
279 }
280
281 //
282 // Allocate private data structure
283 //
284 Private = AllocateCopyPool (sizeof (FIRMWARE_VOLUME_PRIVATE_DATA), &gFirmwareVolumePrivateDataTemplate);
285 if (Private == NULL) {
286 continue;
287 }
288
289 //
290 // Retrieve the Firmware Volume2 Protocol
291 //
292 Status = gBS->HandleProtocol (
293 Handle,
294 &gEfiFirmwareVolume2ProtocolGuid,
295 (VOID **)&Private->FirmwareVolume2
296 );
297 ASSERT_EFI_ERROR (Status);
298
299 //
300 // Fill in rest of private data structure
301 //
302 Private->FirmwareVolume.KeySize = Private->FirmwareVolume2->KeySize;
303 Private->FirmwareVolume.ParentHandle = Private->FirmwareVolume2->ParentHandle;
304
305 //
306 // Install Firmware Volume Protocol onto same handle
307 //
308 Status = gBS->InstallMultipleProtocolInterfaces (
309 &Handle,
310 &gEfiFirmwareVolumeProtocolGuid,
311 &Private->FirmwareVolume,
312 NULL
313 );
314 ASSERT_EFI_ERROR (Status);
315 }
316 }
317
318
319 /**
320 The user Entry Point for DXE driver. The user code starts with this function
321 as the real entry point for the image goes into a library that calls this
322 function.
323
324 @param[in] ImageHandle The firmware allocated handle for the EFI image.
325 @param[in] SystemTable A pointer to the EFI System Table.
326
327 @retval EFI_SUCCESS The entry point is executed successfully.
328 @retval other Some error occurs when executing this entry point.
329
330 **/
331 EFI_STATUS
332 EFIAPI
333 InitializeFirmwareVolume2 (
334 IN EFI_HANDLE ImageHandle,
335 IN EFI_SYSTEM_TABLE *SystemTable
336 )
337 {
338 EfiCreateProtocolNotifyEvent (
339 &gEfiFirmwareVolume2ProtocolGuid,
340 TPL_CALLBACK,
341 FvNotificationEvent,
342 NULL,
343 &mFvRegistration
344 );
345 return EFI_SUCCESS;
346 }
347
348 /**
349 Convert FV attrbiutes to FV2 attributes.
350
351 @param Fv2Attributes FV2 attributes.
352
353 @return FV attributes.
354
355 **/
356 FRAMEWORK_EFI_FV_ATTRIBUTES
357 Fv2AttributesToFvAttributes (
358 IN EFI_FV_ATTRIBUTES Fv2Attributes
359 )
360 {
361 //
362 // Clear those filed that is not defined in Framework FV spec and Alignment conversion.
363 //
364 return (Fv2Attributes & 0x1ff) | ((UINTN) EFI_FV_ALIGNMENT_2 << RShiftU64((Fv2Attributes & EFI_FV2_ALIGNMENT), 16));
365 }
366
367 /**
368 Retrieves attributes, insures positive polarity of attribute bits, returns
369 resulting attributes in output parameter
370
371 @param This Calling context
372 @param Attributes output buffer which contains attributes
373
374 @retval EFI_INVALID_PARAMETER
375 @retval EFI_SUCCESS
376
377 **/
378 EFI_STATUS
379 EFIAPI
380 FvGetVolumeAttributes (
381 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
382 OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes
383 )
384 {
385 EFI_STATUS Status;
386 FIRMWARE_VOLUME_PRIVATE_DATA *Private;
387 EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2;
388
389 Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This);
390 FirmwareVolume2 = Private->FirmwareVolume2;
391
392 Status = FirmwareVolume2->GetVolumeAttributes (
393 FirmwareVolume2,
394 Attributes
395 );
396 if (!EFI_ERROR (Status)) {
397 *Attributes = Fv2AttributesToFvAttributes (*Attributes);
398 }
399 return Status;
400 }
401
402 /**
403 Sets volume attributes
404
405 @param This Calling context
406 @param Attributes Buffer which contains attributes
407
408 @retval EFI_INVALID_PARAMETER
409 @retval EFI_DEVICE_ERROR
410 @retval EFI_SUCCESS
411
412 **/
413 EFI_STATUS
414 EFIAPI
415 FvSetVolumeAttributes (
416 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
417 IN OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes
418 )
419 {
420 FIRMWARE_VOLUME_PRIVATE_DATA *Private;
421 EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2;
422 EFI_FV_ATTRIBUTES Fv2Attributes;
423 EFI_STATUS Status;
424
425 Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This);
426 FirmwareVolume2 = Private->FirmwareVolume2;
427
428 Fv2Attributes = (*Attributes & 0x1ff);
429 Status = FirmwareVolume2->SetVolumeAttributes (
430 FirmwareVolume2,
431 &Fv2Attributes
432 );
433
434 *Attributes = Fv2AttributesToFvAttributes (Fv2Attributes);
435
436 return Status;
437 }
438
439 /**
440 Read the requested file (NameGuid) and returns data in Buffer.
441
442 @param This Calling context
443 @param NameGuid Filename identifying which file to read
444 @param Buffer Pointer to pointer to buffer in which contents of file are returned.
445 <br>
446 If Buffer is NULL, only type, attributes, and size are returned as
447 there is no output buffer.
448 <br>
449 If Buffer != NULL and *Buffer == NULL, the output buffer is allocated
450 from BS pool by ReadFile
451 <br>
452 If Buffer != NULL and *Buffer != NULL, the output buffer has been
453 allocated by the caller and is being passed in.
454 @param BufferSize Indicates the buffer size passed in, and on output the size
455 required to complete the read
456 @param FoundType Indicates the type of the file who's data is returned
457 @param FileAttributes Indicates the attributes of the file who's data is resturned
458 @param AuthenticationStatus Indicates the authentication status of the data
459
460 @retval EFI_SUCCESS
461 @retval EFI_WARN_BUFFER_TOO_SMALL
462 @retval EFI_NOT_FOUND
463 @retval EFI_DEVICE_ERROR
464 @retval EFI_ACCESS_DENIED
465
466 **/
467 EFI_STATUS
468 EFIAPI
469 FvReadFile (
470 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
471 IN EFI_GUID *NameGuid,
472 IN OUT VOID **Buffer,
473 IN OUT UINTN *BufferSize,
474 OUT EFI_FV_FILETYPE *FoundType,
475 OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,
476 OUT UINT32 *AuthenticationStatus
477 )
478 {
479 FIRMWARE_VOLUME_PRIVATE_DATA *Private;
480 EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2;
481 EFI_STATUS Status;
482
483 Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This);
484 FirmwareVolume2 = Private->FirmwareVolume2;
485
486 Status = FirmwareVolume2->ReadFile (
487 FirmwareVolume2,
488 NameGuid,
489 Buffer,
490 BufferSize,
491 FoundType,
492 FileAttributes,
493 AuthenticationStatus
494 );
495
496 //
497 // For Framework FV attrbutes, only alignment fields are valid.
498 //
499 *FileAttributes = *FileAttributes & EFI_FV_FILE_ATTRIB_ALIGNMENT;
500
501 return Status;
502 }
503
504 /**
505 Read the requested section from the specified file and returns data in Buffer.
506
507 @param This Calling context
508 @param NameGuid Filename identifying the file from which to read
509 @param SectionType Indicates what section type to retrieve
510 @param SectionInstance Indicates which instance of SectionType to retrieve
511 @param Buffer Pointer to pointer to buffer in which contents of file are returned.
512 <br>
513 If Buffer is NULL, only type, attributes, and size are returned as
514 there is no output buffer.
515 <br>
516 If Buffer != NULL and *Buffer == NULL, the output buffer is allocated
517 from BS pool by ReadFile
518 <br>
519 If Buffer != NULL and *Buffer != NULL, the output buffer has been
520 allocated by the caller and is being passed in.
521 @param BufferSize Indicates the buffer size passed in, and on output the size
522 required to complete the read
523 @param AuthenticationStatus Indicates the authentication status of the data
524
525 @retval EFI_SUCCESS
526 @retval EFI_WARN_BUFFER_TOO_SMALL
527 @retval EFI_OUT_OF_RESOURCES
528 @retval EFI_NOT_FOUND
529 @retval EFI_DEVICE_ERROR
530 @retval EFI_ACCESS_DENIED
531
532 **/
533 EFI_STATUS
534 EFIAPI
535 FvReadSection (
536 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
537 IN EFI_GUID *NameGuid,
538 IN EFI_SECTION_TYPE SectionType,
539 IN UINTN SectionInstance,
540 IN OUT VOID **Buffer,
541 IN OUT UINTN *BufferSize,
542 OUT UINT32 *AuthenticationStatus
543 )
544 {
545 FIRMWARE_VOLUME_PRIVATE_DATA *Private;
546 EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2;
547
548 Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This);
549 FirmwareVolume2 = Private->FirmwareVolume2;
550
551 return FirmwareVolume2->ReadSection (
552 FirmwareVolume2,
553 NameGuid,
554 SectionType,
555 SectionInstance,
556 Buffer,
557 BufferSize,
558 AuthenticationStatus
559 );
560 }
561
562 /**
563 Write the supplied file (NameGuid) to the FV.
564
565 @param This Calling context
566 @param NumberOfFiles Indicates the number of file records pointed to by FileData
567 @param WritePolicy Indicates the level of reliability of the write with respect to
568 things like power failure events.
569 @param FileData A pointer to an array of EFI_FV_WRITE_FILE_DATA structures. Each
570 element in the array indicates a file to write, and there are
571 NumberOfFiles elements in the input array.
572
573 @retval EFI_SUCCESS
574 @retval EFI_OUT_OF_RESOURCES
575 @retval EFI_DEVICE_ERROR
576 @retval EFI_WRITE_PROTECTED
577 @retval EFI_NOT_FOUND
578 @retval EFI_INVALID_PARAMETER
579
580 **/
581 EFI_STATUS
582 EFIAPI
583 FvWriteFile (
584 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
585 IN UINT32 NumberOfFiles,
586 IN FRAMEWORK_EFI_FV_WRITE_POLICY WritePolicy,
587 IN FRAMEWORK_EFI_FV_WRITE_FILE_DATA *FileData
588 )
589 {
590 FIRMWARE_VOLUME_PRIVATE_DATA *Private;
591 EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2;
592 EFI_FV_WRITE_FILE_DATA *PiFileData;
593 EFI_STATUS Status;
594 UINTN Index;
595
596 Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This);
597 FirmwareVolume2 = Private->FirmwareVolume2;
598
599 PiFileData = AllocateCopyPool (sizeof (EFI_FV_WRITE_FILE_DATA), FileData);
600 ASSERT (PiFileData != NULL);
601
602 //
603 // Framework Spec assume firmware files are Memory-Mapped.
604 //
605 for (Index = 0; Index < NumberOfFiles; Index++) {
606 PiFileData[Index].FileAttributes |= EFI_FV_FILE_ATTRIB_MEMORY_MAPPED;
607 }
608
609 Status = FirmwareVolume2->WriteFile (
610 FirmwareVolume2,
611 NumberOfFiles,
612 WritePolicy,
613 (EFI_FV_WRITE_FILE_DATA *)FileData
614 );
615
616 FreePool (PiFileData);
617 return Status;
618 }
619
620 /**
621 Given the input key, search for the next matching file in the volume.
622
623 @param This Calling context
624 @param Key Pointer to a caller allocated buffer that contains an implementation
625 specific key that is used to track where to begin searching on
626 successive calls.
627 @param FileType Indicates the file type to filter for
628 @param NameGuid Guid filename of the file found
629 @param Attributes Attributes of the file found
630 @param Size Size in bytes of the file found
631
632 @retval EFI_SUCCESS
633 @retval EFI_NOT_FOUND
634 @retval EFI_DEVICE_ERROR
635 @retval EFI_ACCESS_DENIED
636
637 **/
638 EFI_STATUS
639 EFIAPI
640 FvGetNextFile (
641 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
642 IN OUT VOID *Key,
643 IN OUT EFI_FV_FILETYPE *FileType,
644 OUT EFI_GUID *NameGuid,
645 OUT EFI_FV_FILE_ATTRIBUTES *Attributes,
646 OUT UINTN *Size
647 )
648 {
649 FIRMWARE_VOLUME_PRIVATE_DATA *Private;
650 EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2;
651 EFI_STATUS Status;
652
653 Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This);
654 FirmwareVolume2 = Private->FirmwareVolume2;
655
656 Status = FirmwareVolume2->GetNextFile (
657 FirmwareVolume2,
658 Key,
659 FileType,
660 NameGuid,
661 Attributes,
662 Size
663 );
664
665 //
666 // For Framework FV attrbutes, only alignment fields are valid.
667 //
668 *Attributes = *Attributes & EFI_FV_FILE_ATTRIB_ALIGNMENT;
669
670 return Status;
671 }