| 1351 | } |
| 1352 | |
| 1353 | EFI_STATUS |
| 1354 | RebaseImageRead ( |
| 1355 | IN VOID *FileHandle, |
| 1356 | IN UINTN FileOffset, |
| 1357 | IN OUT UINT32 *ReadSize, |
| 1358 | OUT VOID *Buffer |
| 1359 | ) |
| 1360 | /*++ |
| 1361 | |
| 1362 | Routine Description: |
| 1363 | |
| 1364 | Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file |
| 1365 | |
| 1366 | Arguments: |
| 1367 | |
| 1368 | FileHandle - The handle to the PE/COFF file |
| 1369 | |
| 1370 | FileOffset - The offset, in bytes, into the file to read |
| 1371 | |
| 1372 | ReadSize - The number of bytes to read from the file starting at FileOffset |
| 1373 | |
| 1374 | Buffer - A pointer to the buffer to read the data into. |
| 1375 | |
| 1376 | Returns: |
| 1377 | |
| 1378 | EFI_SUCCESS - ReadSize bytes of data were read into Buffer from the PE/COFF file starting at FileOffset |
| 1379 | |
| 1380 | --*/ |
| 1381 | { |
| 1382 | CHAR8 *Destination8; |
| 1383 | CHAR8 *Source8; |
| 1384 | UINT32 Length; |
| 1385 | |
| 1386 | Destination8 = Buffer; |
| 1387 | Source8 = (CHAR8 *) ((UINTN) FileHandle + FileOffset); |
| 1388 | Length = *ReadSize; |
| 1389 | while (Length--) { |
| 1390 | *(Destination8++) = *(Source8++); |
| 1391 | } |
| 1392 | |
| 1393 | return EFI_SUCCESS; |
| 1394 | } |
| 1395 | |
| 1396 | EFI_STATUS |
| 1397 | SetAddressToSectionHeader ( |