| 414 | } |
| 415 | |
| 416 | static |
| 417 | int |
| 418 | ProcessEfiFile ( |
| 419 | FILE *OutFptr, |
| 420 | FILE_LIST *InFile, |
| 421 | UINT16 VendId, |
| 422 | UINT16 DevId, |
| 423 | UINT32 *Size |
| 424 | ) |
| 425 | /*++ |
| 426 | |
| 427 | Routine Description: |
| 428 | |
| 429 | Process a PE32 EFI file. |
| 430 | |
| 431 | Arguments: |
| 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 | |
| 439 | Returns: |
| 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 | // |
no test coverage detected