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

Function ProcessEfiFile

BaseTools/Source/C/EfiRom/EfiRom.c:416–804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416static
417int
418ProcessEfiFile (
419 FILE *OutFptr,
420 FILE_LIST *InFile,
421 UINT16 VendId,
422 UINT16 DevId,
423 UINT32 *Size
424 )
425/*++
426
427Routine Description:
428
429 Process a PE32 EFI file.
430
431Arguments:
432
433 OutFptr - file pointer to output binary ROM image file we're creating
434 InFile - structure contains information on the PE32 file to process
435 VendId - vendor ID as required in the option ROM header
436 DevId - device ID as required in the option ROM header
437 Size - pointer to where to return the size added to the output file
438
439Returns:
440
441 0 - successful
442
443--*/
444{
445 UINT32 Status;
446 FILE *InFptr;
447 EFI_PCI_EXPANSION_ROM_HEADER RomHdr;
448 PCI_DATA_STRUCTURE PciDs23;
449 PCI_3_0_DATA_STRUCTURE PciDs30;
450 UINT32 FileSize;
451 UINT32 CompressedFileSize;
452 UINT8 *Buffer;
453 UINT8 *CompressedBuffer;
454 UINT8 *TempBufferPtr;
455 UINT32 TotalSize;
456 UINT32 HeaderSize;
457 UINT16 MachineType;
458 UINT16 SubSystem;
459 UINT32 HeaderPadBytes;
460 UINT32 PadBytesBeforeImage;
461 UINT32 PadBytesAfterImage;
462 UINT32 DevIdListSize;
463
464 //
465 // Try to open the input file
466 //
467 if ((InFptr = fopen (LongFilePath (InFile->FileName), "rb")) == NULL) {
468 Error (NULL, 0, 0001, "Open file error", "Error opening file: %s", InFile->FileName);
469 return STATUS_ERROR;
470 }
471 //
472 // Initialize our buffer pointers to null.
473 //

Callers 1

mainFunction · 0.85

Calls 12

fopenFunction · 0.85
CheckPE32FileFunction · 0.85
VerboseMsgFunction · 0.85
freadFunction · 0.85
EfiCompressFunction · 0.85
fwriteFunction · 0.85
fcloseFunction · 0.85
LongFilePathFunction · 0.50
ErrorFunction · 0.50
mallocFunction · 0.50
memsetFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected