OpenCore
1.0.4
OpenCore Bootloader
|
#include <Uefi.h>
#include <Protocol/SimpleFileSystem.h>
#include <Guid/FileInfo.h>
Go to the source code of this file.
Functions | |
EFI_STATUS | CreateVirtualFile (IN CHAR16 *FileName, IN VOID *FileBuffer, IN UINT64 FileSize, IN CONST EFI_TIME *ModificationTime OPTIONAL, OUT EFI_FILE_PROTOCOL **File) |
EFI_STATUS | CreateVirtualFileFileNameCopy (IN CONST CHAR16 *FileName, IN VOID *FileBuffer, IN UINT64 FileSize, IN CONST EFI_TIME *ModificationTime OPTIONAL, OUT EFI_FILE_PROTOCOL **File) |
EFI_STATUS | CreateRealFile (IN EFI_FILE_PROTOCOL *OriginalFile OPTIONAL, IN EFI_FILE_OPEN OpenCallback OPTIONAL, IN BOOLEAN CloseOnFailure, OUT EFI_FILE_PROTOCOL **File) |
EFI_STATUS | VirtualDirCreateOverlay (IN CHAR16 *FileName, IN CONST EFI_TIME *ModificationTime OPTIONAL, IN EFI_FILE_PROTOCOL *UnderlyingFile OPTIONAL, OUT EFI_FILE_PROTOCOL **File) |
EFI_STATUS | VirtualDirCreateOverlayFileNameCopy (IN CONST CHAR16 *FileName, IN CONST EFI_TIME *ModificationTime OPTIONAL, IN EFI_FILE_PROTOCOL *UnderlyingFile OPTIONAL, OUT EFI_FILE_PROTOCOL **File) |
EFI_STATUS | VirtualDirAddEntry (IN EFI_FILE_PROTOCOL *This, IN EFI_FILE_INFO *FileInfo) |
VOID | VirtualDirFree (IN EFI_FILE_PROTOCOL *This) |
EFI_STATUS | CreateVirtualFs (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *OriginalFileSystem, IN EFI_FILE_OPEN OpenCallback, OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **NewFileSystem) |
EFI_STATUS | EnableVirtualFs (IN OUT EFI_BOOT_SERVICES *BootServices, IN EFI_FILE_OPEN OpenCallback) |
EFI_STATUS | DisableVirtualFs (IN OUT EFI_BOOT_SERVICES *BootServices) |
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 OcVirtualFsLib.h.
EFI_STATUS CreateRealFile | ( | IN EFI_FILE_PROTOCOL *OriginalFile | OPTIONAL, |
IN EFI_FILE_OPEN OpenCallback | OPTIONAL, | ||
IN BOOLEAN | CloseOnFailure, | ||
OUT EFI_FILE_PROTOCOL ** | File ) |
Creates virtual file system instance around any file. CreateRealFile or CreateVirtualFile must be called from any registered OpenCallback.
[in] | OriginalFile | Pointer to the original file. |
[in] | OpenCallback | File open callback. |
[in] | CloseOnFailure | Close the original file on failure. |
[out] | File | Resulting file protocol. |
Definition at line 694 of file VirtualFile.c.
EFI_STATUS CreateVirtualFile | ( | IN CHAR16 * | FileName, |
IN VOID * | FileBuffer, | ||
IN UINT64 | FileSize, | ||
IN CONST EFI_TIME *ModificationTime | OPTIONAL, | ||
OUT EFI_FILE_PROTOCOL ** | File ) |
Creates read-only EFI_FILE_PROTOCOL instance over a buffer allocated from pool. On success FileName and FileData ownership is transferred to the resulting EFI_FILE_PROTOCOL, which frees them with FreePool upon closing EFI_FILE_PROTOCOL. All other fields are copied.
Resulting EFI_FILE_PROTOCOL has 2nd revision, but may be downgraded to 1st by updating the corresponding field.
[in] | FileName | Pointer to the file's name. |
[in] | FileBuffer | Pointer to the file's data. |
[in] | FileSize | File size of FileData. |
[in] | ModificationTime | File modification date, optional. |
[out] | File | Resulting file protocol. |
Definition at line 610 of file VirtualFile.c.
EFI_STATUS CreateVirtualFileFileNameCopy | ( | IN CONST CHAR16 * | FileName, |
IN VOID * | FileBuffer, | ||
IN UINT64 | FileSize, | ||
IN CONST EFI_TIME *ModificationTime | OPTIONAL, | ||
OUT EFI_FILE_PROTOCOL ** | File ) |
Creates read-only EFI_FILE_PROTOCOL instance over a buffer allocated from pool. On success FileData ownership is transferred to the resulting EFI_FILE_PROTOCOL, which frees them with FreePool upon closing EFI_FILE_PROTOCOL. All other fields are copied.
Resulting EFI_FILE_PROTOCOL has 2nd revision, but may be downgraded to 1st by updating the corresponding field.
[in] | FileName | Pointer to the file's name. |
[in] | FileBuffer | Pointer to the file's data. |
[in] | FileSize | File size of FileData. |
[in] | ModificationTime | File modification date, optional. |
[out] | File | Resulting file protocol. |
Definition at line 650 of file VirtualFile.c.
EFI_STATUS CreateVirtualFs | ( | IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * | OriginalFileSystem, |
IN EFI_FILE_OPEN | OpenCallback, | ||
OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL ** | NewFileSystem ) |
Create virtual file system by wrapping OriginalFileSystem into NewFileSystem with specified callback. Cacheable.
[in] | OriginalFileSystem | Source file system. |
[in] | OpenCallback | File open callback. |
[out] | NewFileSystem | Wrapped file system. |
Definition at line 71 of file VirtualVolume.c.
EFI_STATUS DisableVirtualFs | ( | IN OUT EFI_BOOT_SERVICES * | BootServices | ) |
Enables virtual file system access for given BootServices.
[in,out] | BootServices | Hooked EFI_BOOT_SERVICES. |
Definition at line 125 of file VirtualFs.c.
EFI_STATUS EnableVirtualFs | ( | IN OUT EFI_BOOT_SERVICES * | BootServices, |
IN EFI_FILE_OPEN | OpenCallback ) |
Enables virtual file system access for given BootServices with callback on file open.
[in,out] | BootServices | Hooked EFI_BOOT_SERVICES. |
[in] | OpenCallback | File open callback. |
Definition at line 99 of file VirtualFs.c.
EFI_STATUS VirtualDirAddEntry | ( | IN EFI_FILE_PROTOCOL * | This, |
IN EFI_FILE_INFO * | FileInfo ) |
Adds an EFI_FILE_INFO instance to the virtual directory as a file entry. Ownership of the EFI_FILE_INFO is transferred to the EFI_FILE_PROTOCOL, which is freed with FreePool upon closing EFI_FILE_PROTOCOL.
[in] | This | File protocol pointer. |
[in] | FileInfo | EFI_FILE_INFO instance pointer. |
Definition at line 561 of file VirtualDir.c.
EFI_STATUS VirtualDirCreateOverlay | ( | IN CHAR16 * | FileName, |
IN CONST EFI_TIME *ModificationTime | OPTIONAL, | ||
IN EFI_FILE_PROTOCOL *UnderlyingFile | OPTIONAL, | ||
OUT EFI_FILE_PROTOCOL ** | File ) |
Creates read-only EFI_FILE_PROTOCOL virtual directory instance, optionally as an overlay over an existing EFI_FILE_PROTOCOL instance. On success ownership of FileName and UnderlyingFile is transferred to the resulting EFI_FILE_PROTOCOL, which frees them with FreePool upon closing EFI_FILE_PROTOCOL. All other fields are copied.
Resulting EFI_FILE_PROTOCOL has 2nd revision, but may be downgraded to 1st by updating the corresponding field.
[in] | FileName | Pointer to the file's name. |
[in] | ModificationTime | File modification date, optional. |
[in] | UnderlyingFile | The underlying file protocol, optional. |
[out] | File | Resulting file protocol. |
Definition at line 496 of file VirtualDir.c.
EFI_STATUS VirtualDirCreateOverlayFileNameCopy | ( | IN CONST CHAR16 * | FileName, |
IN CONST EFI_TIME *ModificationTime | OPTIONAL, | ||
IN EFI_FILE_PROTOCOL *UnderlyingFile | OPTIONAL, | ||
OUT EFI_FILE_PROTOCOL ** | File ) |
Creates read-only EFI_FILE_PROTOCOL virtual directory instance, optionally as an overlay over an existing EFI_FILE_PROTOCOL instance. On success, ownership of UnderlyingFile is transferred to the resulting EFI_FILE_PROTOCOL, which frees them with FreePool upon closing EFI_FILE_PROTOCOL. All other fields are copied.
Resulting EFI_FILE_PROTOCOL has 2nd revision, but may be downgraded to 1st by updating the corresponding field.
[in] | FileName | Pointer to the file's name. |
[in] | ModificationTime | File modification date, optional. |
[in] | UnderlyingFile | The underlying file protocol, optional. |
[out] | File | Resulting file protocol. |
Definition at line 531 of file VirtualDir.c.
VOID VirtualDirFree | ( | IN EFI_FILE_PROTOCOL * | This | ) |
Frees the EFI_FILE_PROTOCOL virtual directory instance without closing the underlying EFI_FILE_PROTOCOL, if any.
[in] | This | File protocol pointer. |
Definition at line 587 of file VirtualDir.c.