3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 // Include common header file for this module.
23 #include "CommonHeader.h"
31 IN OUT UINTN
*ReadSize
,
38 Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
42 FileHandle - The handle to the PE/COFF file
44 FileOffset - The offset, in bytes, into the file to read
46 ReadSize - The number of bytes to read from the file starting at FileOffset
48 Buffer - A pointer to the buffer to read the data into.
52 EFI_SUCCESS - ReadSize bytes of data were read into Buffer from the PE/COFF file starting at FileOffset
58 volatile UINTN Length
;
60 Destination8
= Buffer
;
61 Source8
= (CHAR8
*) ((UINTN
) FileHandle
+ FileOffset
);
64 *(Destination8
++) = *(Source8
++);
71 GetImageReadFunction (
72 IN PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
75 ImageContext
->ImageRead
= PeiImageRead
;