OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
ReadFile.c File Reference
#include <Uefi.h>
#include <Guid/FileInfo.h>
#include <Protocol/SimpleFileSystem.h>
#include <Library/UefiLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/BaseOverflowLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/OcDevicePathLib.h>
#include <Library/OcFileLib.h>

Go to the source code of this file.

Functions

VOID * OcReadFile (IN CONST EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN CONST CHAR16 *FilePath, OUT UINT32 *FileSize OPTIONAL, IN CONST UINT32 MaxFileSize OPTIONAL)
 
EFI_STATUS OcReadFileSize (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN CONST CHAR16 *FilePath, OUT UINT32 *Size)
 
VOID * OcReadFileFromDirectory (IN CONST EFI_FILE_PROTOCOL *RootDirectory, IN CONST CHAR16 *FilePath, OUT UINT32 *FileSize OPTIONAL, IN UINT32 MaxFileSize OPTIONAL)
 

Detailed Description

Copyright (C) 2019, vit9696. All rights reserved.

All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file ReadFile.c.

Function Documentation

◆ OcReadFile()

VOID * OcReadFile ( IN CONST EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * FileSystem,
IN CONST CHAR16 * FilePath,
OUT UINT32 *FileSize OPTIONAL,
IN CONST UINT32 MaxFileSize OPTIONAL )

Read file from file system with implicit double (2 byte) null termination. Null termination does not affect the returned file size. Depending on the implementation 0 byte files may return null.

Parameters
[in]FileSystemA pointer to the file system protocol of the volume.
[in]FilePathThe full path to the file on the device.
[out]FileSizeThe size of the file read (optional).
[in]MaxFileSizeUpper file size bound (optional).
Return values
Apointer to a buffer containing file read or NULL.

Definition at line 33 of file ReadFile.c.

◆ OcReadFileFromDirectory()

VOID * OcReadFileFromDirectory ( IN CONST EFI_FILE_PROTOCOL * RootDirectory,
IN CONST CHAR16 * FilePath,
OUT UINT32 *FileSize OPTIONAL,
IN UINT32 MaxFileSize OPTIONAL )

Read file from file protocol with implicit double (2 byte) null termination. Null termination does not affect the returned file size. Depending on the implementation 0 byte files may return null.

Parameters
[in]RootDirectoryA pointer to the file protocol of the directory.
[in]FilePathThe full path to the file on the device.
[out]FileSizeThe size of the file read (optional).
[in]MaxFileSizeUpper file size bound (optional).
Return values
Apointer to a buffer containing file read or NULL.

Definition at line 155 of file ReadFile.c.

◆ OcReadFileSize()

EFI_STATUS OcReadFileSize ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * FileSystem,
IN CONST CHAR16 * FilePath,
OUT UINT32 * Size )

Determine file size if it is less than 4 GB.

Parameters
[in]FileSystemA pointer to the file system protocol of the volume.
[in]FilePathThe full path to the file on the device.
[out]Size32-bit file size.
Return values
EFI_SUCCESSon success.

Definition at line 110 of file ReadFile.c.