OpenCore
1.0.4
OpenCore Bootloader
|
#include <Uefi.h>
#include <Guid/FileInfo.h>
#include <Protocol/SimpleFileSystem.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcDevicePathLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcStorageLib.h>
#include <Library/UefiBootServicesTableLib.h>
Go to the source code of this file.
Macros | |
#define | INTERNAL_STORAGE_GUID { 0x33B5C65A, 0x5B82, 0x403D, {0x87, 0xA5, 0xD4, 0x67, 0x62, 0x50, 0xEC, 0x59} } |
#define | INTERNAL_STORAGE_FILE_GUID { 0x1237EC17, 0xD3CE, 0x401D, {0xA8, 0x41, 0xB1, 0xD8, 0x18, 0xF8, 0xAF, 0x1A} } |
Typedefs | ||
struct { | ||
VENDOR_DEFINED_DEVICE_PATH Vendor | ||
EFI_DEVICE_PATH_PROTOCOL End | ||
} | DUMMY_BOOT_DEVICE_PATH | |
struct { | ||
VENDOR_DEFINED_DEVICE_PATH Vendor | ||
VENDOR_DEFINED_DEVICE_PATH VendorFile | ||
EFI_DEVICE_PATH_PROTOCOL End | ||
} | DUMMY_BOOT_DEVICE_FILE_PATH | |
Functions | |
STATIC EFI_STATUS | OcStorageInitializeVault (IN OUT OC_STORAGE_CONTEXT *Context, IN VOID *Vault OPTIONAL, IN UINT32 VaultSize, IN OC_RSA_PUBLIC_KEY *StorageKey OPTIONAL, IN VOID *Signature OPTIONAL, IN UINT32 SignatureSize OPTIONAL) |
STATIC UINT8 * | OcStorageGetDigest (IN OUT OC_STORAGE_CONTEXT *Context, IN CONST CHAR16 *Filename) |
EFI_STATUS | OcStorageInitFromFs (OUT OC_STORAGE_CONTEXT *Context, IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN EFI_HANDLE StorageHandle OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *StoragePath OPTIONAL, IN CONST CHAR16 *StorageRoot, IN OC_RSA_PUBLIC_KEY *StorageKey OPTIONAL) |
VOID | OcStorageFree (IN OUT OC_STORAGE_CONTEXT *Context) |
BOOLEAN | OcStorageExistsFileUnicode (IN OC_STORAGE_CONTEXT *Context, IN CONST CHAR16 *FilePath) |
VOID * | OcStorageReadFileUnicode (IN OC_STORAGE_CONTEXT *Context, IN CONST CHAR16 *FilePath, OUT UINT32 *FileSize OPTIONAL) |
EFI_STATUS | OcStorageGetInfo (IN OC_STORAGE_CONTEXT *Context, IN CONST CHAR16 *FilePath, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath OPTIONAL, OUT EFI_HANDLE *StorageHandle OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **StoragePath OPTIONAL, IN BOOLEAN RealPath) |
Variables | |
STATIC DUMMY_BOOT_DEVICE_PATH | mDummyBootDevicePath |
STATIC DUMMY_BOOT_DEVICE_FILE_PATH | mDummyBootDeviceFilePath |
STATIC OC_SCHEMA | mVaultFilesSchema = OC_SCHEMA_DATAF (NULL, UINT8[SHA256_DIGEST_SIZE]) |
STATIC OC_SCHEMA | mVaultNodesSchema [] |
STATIC OC_SCHEMA_INFO | mVaultSchema |
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 OcStorageLib.c.
#define INTERNAL_STORAGE_FILE_GUID { 0x1237EC17, 0xD3CE, 0x401D, {0xA8, 0x41, 0xB1, 0xD8, 0x18, 0xF8, 0xAF, 0x1A} } |
Definition at line 55 of file OcStorageLib.c.
#define INTERNAL_STORAGE_GUID { 0x33B5C65A, 0x5B82, 0x403D, {0x87, 0xA5, 0xD4, 0x67, 0x62, 0x50, 0xEC, 0x59} } |
Definition at line 52 of file OcStorageLib.c.
typedef PACKED struct { ... } DUMMY_BOOT_DEVICE_FILE_PATH |
typedef PACKED struct { ... } DUMMY_BOOT_DEVICE_PATH |
BOOLEAN OcStorageExistsFileUnicode | ( | IN OC_STORAGE_CONTEXT * | Context, |
IN CONST CHAR16 * | FilePath ) |
Check whether file exists.
[in] | Context | Storage context. |
[in] | FilePath | The full path to the file on the device. |
TRUE | if file is present in vault or ondisk. |
Definition at line 340 of file OcStorageLib.c.
VOID OcStorageFree | ( | IN OUT OC_STORAGE_CONTEXT * | Context | ) |
Free storage context resources.
[in,out] | Context | Storage context. |
Definition at line 315 of file OcStorageLib.c.
STATIC UINT8 * OcStorageGetDigest | ( | IN OUT OC_STORAGE_CONTEXT * | Context, |
IN CONST CHAR16 * | Filename ) |
Definition at line 177 of file OcStorageLib.c.
EFI_STATUS OcStorageGetInfo | ( | IN OC_STORAGE_CONTEXT * | Context, |
IN CONST CHAR16 * | FilePath, | ||
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath | OPTIONAL, | ||
OUT EFI_HANDLE *StorageHandle | OPTIONAL, | ||
OUT EFI_DEVICE_PATH_PROTOCOL **StoragePath | OPTIONAL, | ||
IN BOOLEAN | RealPath ) |
Definition at line 468 of file OcStorageLib.c.
EFI_STATUS OcStorageInitFromFs | ( | OUT OC_STORAGE_CONTEXT * | Context, |
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * | FileSystem, | ||
IN EFI_HANDLE StorageHandle | OPTIONAL, | ||
IN EFI_DEVICE_PATH_PROTOCOL *StoragePath | OPTIONAL, | ||
IN CONST CHAR16 * | StorageRoot, | ||
IN OC_RSA_PUBLIC_KEY *StorageKey | OPTIONAL ) |
Create storage context from UEFI file system at specified path.
[out] | Context | Resulting storage context. |
[in] | FileSystem | Storage file system. |
[in] | StorageHandle | Storage handle, optional. |
[in] | StoragePath | Actual storage device path, optional. |
[in] | StorageRoot | Storage file system root (e.g. L"\\"). |
[in] | StorageKey | Storage signature verification key, optional. |
EFI_SUCCESS | on success. |
Definition at line 215 of file OcStorageLib.c.
STATIC EFI_STATUS OcStorageInitializeVault | ( | IN OUT OC_STORAGE_CONTEXT * | Context, |
IN VOID *Vault | OPTIONAL, | ||
IN UINT32 | VaultSize, | ||
IN OC_RSA_PUBLIC_KEY *StorageKey | OPTIONAL, | ||
IN VOID *Signature | OPTIONAL, | ||
IN UINT32 SignatureSize | OPTIONAL ) |
Definition at line 124 of file OcStorageLib.c.
VOID * OcStorageReadFileUnicode | ( | IN OC_STORAGE_CONTEXT * | Context, |
IN CONST CHAR16 * | FilePath, | ||
OUT UINT32 *FileSize | OPTIONAL ) |
Read file from storage 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. If storage context was created with valid storage key, then signature checking will be performed
[in] | Context | Storage context. |
[in] | FilePath | The full path to the file on the device. |
[out] | FileSize | The size of the file read (optional). |
A | pointer to a buffer containing file read or NULL. |
Definition at line 383 of file OcStorageLib.c.
EFI_DEVICE_PATH_PROTOCOL End |
Definition at line 37 of file OcStorageLib.c.
STATIC DUMMY_BOOT_DEVICE_FILE_PATH mDummyBootDeviceFilePath |
Definition at line 78 of file OcStorageLib.c.
STATIC DUMMY_BOOT_DEVICE_PATH mDummyBootDevicePath |
Definition at line 60 of file OcStorageLib.c.
STATIC OC_SCHEMA mVaultFilesSchema = OC_SCHEMA_DATAF (NULL, UINT8[SHA256_DIGEST_SIZE]) |
Definition at line 104 of file OcStorageLib.c.
STATIC OC_SCHEMA mVaultNodesSchema[] |
WARNING: Field list must be alpabetically ordered here!
Definition at line 111 of file OcStorageLib.c.
STATIC OC_SCHEMA_INFO mVaultSchema |
Definition at line 118 of file OcStorageLib.c.
VENDOR_DEFINED_DEVICE_PATH Vendor |
Definition at line 36 of file OcStorageLib.c.
VENDOR_DEFINED_DEVICE_PATH VendorFile |
Definition at line 42 of file OcStorageLib.c.