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

Function GetFileData

Library/OcFileLib/FileProtocol.c:26–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include <Library/UefiBootServicesTableLib.h>
25
26EFI_STATUS
27GetFileData (
28 IN EFI_FILE_PROTOCOL *File,
29 IN UINT32 Position,
30 IN UINT32 Size,
31 OUT UINT8 *Buffer
32 )
33{
34 EFI_STATUS Status;
35 UINTN ReadSize;
36
37 Status = File->SetPosition (File, Position);
38 if (EFI_ERROR(Status)) {
39 return Status;
40 }
41
42 ReadSize = Size;
43 Status = File->Read (File, &ReadSize, Buffer);
44 File->SetPosition (File, 0);
45 if (EFI_ERROR(Status)) {
46 return Status;
47 }
48
49 if (ReadSize != Size) {
50 return EFI_BAD_BUFFER_SIZE;
51 }
52
53 return EFI_SUCCESS;
54}
55
56EFI_STATUS
57GetFileSize (

Callers 4

InternalLoadDmgFunction · 0.85
IsOpenCoreBootloaderFunction · 0.85
ReadFileFunction · 0.85
OcStorageReadFileUnicodeFunction · 0.85

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected