OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
BootManagementInternal.h File Reference
#include <Uefi.h>
#include <Library/OcAppleDiskImageLib.h>
#include <Library/OcBootManagementLib.h>
#include <Protocol/AppleBootPolicy.h>
#include <Protocol/DevicePath.h>
#include <Protocol/SimpleFileSystem.h>

Go to the source code of this file.

Data Structures

struct  INTERNAL_DMG_LOAD_CONTEXT
 
struct  INTERNAL_DEV_PATH_SCAN_INFO
 

Macros

#define OC_CUSTOM_FS_HANDLE   ((EFI_HANDLE)(UINTN) 0x2007C5F5U)
 
#define OC_CUSTOM_BOOT_DEVICE_PATH_GUID
 
#define OC_ENTRY_PROTOCOL_DEVICE_PATH_GUID
 
#define SIZE_OF_OC_CUSTOM_BOOT_DEVICE_PATH    (sizeof (VENDOR_DEVICE_PATH) + SIZE_OF_FILEPATH_DEVICE_PATH)
 
#define SIZE_OF_OC_ENTRY_PROTOCOL_DEVICE_PATH    (sizeof (VENDOR_DEVICE_PATH) + sizeof (EFI_GUID) + SIZE_OF_FILEPATH_DEVICE_PATH)
 
#define OC_APPLE_VERSION_MAX_SIZE   (16)
 

Typedefs

struct { 
 
   VENDOR_DEVICE_PATH   Hdr 
 
   FILEPATH_DEVICE_PATH   EntryName 
 
OC_CUSTOM_BOOT_DEVICE_PATH 
 
struct { 
 
   VENDOR_DEVICE_PATH   Hdr 
 
   EFI_GUID   Partuuid 
 
   FILEPATH_DEVICE_PATH   EntryName 
 
OC_ENTRY_PROTOCOL_DEVICE_PATH 
 
struct { 
 
   VENDOR_DEVICE_PATH   Header 
 
   EFI_DEVICE_PATH_PROTOCOL   EntryName 
 
OC_CUSTOM_BOOT_DEVICE_PATH_DECL 
 
struct { 
 
   VENDOR_DEVICE_PATH   Header 
 
   EFI_GUID   Partuuid 
 
   EFI_DEVICE_PATH_PROTOCOL   EntryName 
 
OC_ENTRY_PROTOCOL_DEVICE_PATH_DECL 
 

Enumerations

enum  INTERNAL_ENTRY_VISIBILITY { BootEntryNormal , BootEntryAuxiliary , BootEntryDisabled }
 

Functions

EFI_STATUS InternalCheckScanPolicy (IN EFI_HANDLE Handle, IN UINT32 Policy, OUT BOOLEAN *External OPTIONAL)
 
EFI_DEVICE_PATH_PROTOCOL * InternalLoadDmg (IN OUT INTERNAL_DMG_LOAD_CONTEXT *Context, IN OC_DMG_LOADING_SUPPORT DmgLoading, IN OC_APPLE_DISK_IMAGE_PRELOAD_CONTEXT *DmgPreloadContext)
 
VOID InternalUnloadDmg (IN INTERNAL_DMG_LOAD_CONTEXT *DmgLoadContext)
 
CHAR16 * InternalGetAppleDiskLabel (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN CONST CHAR16 *BootDirectoryName, IN CONST CHAR16 *LabelFilename)
 
CHAR8 * InternalGetContentFlavour (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN CONST CHAR16 *BootDirectoryName)
 
EFI_STATUS InternalGetAppleImage (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN CONST CHAR16 *DirectoryName, IN CONST CHAR16 *LabelFilename, OUT VOID **ImageData, OUT UINT32 *DataSize)
 
EFI_STATUS InternalGetRecoveryOsBooter (IN EFI_HANDLE Device, OUT EFI_DEVICE_PATH_PROTOCOL **FilePath, IN BOOLEAN Basic)
 
EFI_STATUS InternalLoadBootEntry (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, IN EFI_HANDLE ParentHandle, OUT EFI_HANDLE *EntryHandle, OUT INTERNAL_DMG_LOAD_CONTEXT *DmgLoadContext, OUT VOID **CustomFreeContext)
 
UINT16 * InternalGetBootOrderForBooting (IN EFI_GUID *BootVariableGuid, IN BOOLEAN BlacklistAppleUpdate, OUT UINTN *BootOrderCount, IN BOOLEAN UseBootNextOnly)
 
VOID InternalDebugBootEnvironment (IN CONST UINT16 *BootOrder, IN EFI_GUID *BootGuid, IN UINTN BootOrderCount)
 
EFI_DEVICE_PATH_PROTOCOL * InternalGetBootOptionPath (IN EFI_LOAD_OPTION *LoadOption, IN UINTN LoadOptionSize)
 
EFI_STATUS InternalAddBootEntryFromCustomEntry (IN OUT OC_BOOT_CONTEXT *BootContext, IN OUT OC_BOOT_FILESYSTEM *FileSystem, IN OC_PICKER_ENTRY *CustomEntry, IN BOOLEAN IsBootEntryProtocol)
 
EFI_STATUS InternalDescribeBootEntry (IN OC_BOOT_CONTEXT *BootContext, IN OUT OC_BOOT_ENTRY *BootEntry)
 
BOOLEAN InternalIsAppleLegacyLoadApp (IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
OC_BOOT_FILESYSTEMInternalFileSystemForHandle (IN OC_BOOT_CONTEXT *BootContext, IN EFI_HANDLE FileSystemHandle, IN BOOLEAN LazyScan, OUT BOOLEAN *AlreadySeen OPTIONAL)
 
CONST OC_CUSTOM_BOOT_DEVICE_PATHInternalGetOcCustomDevPath (IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
CONST OC_ENTRY_PROTOCOL_DEVICE_PATHInternalGetOcEntryProtocolDevPath (IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
EFI_STATUS InternalRunRequestPrivilege (IN OC_PICKER_CONTEXT *PickerContext, IN OC_PRIVILEGE_LEVEL Level)
 

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 BootManagementInternal.h.

Macro Definition Documentation

◆ OC_APPLE_VERSION_MAX_SIZE

#define OC_APPLE_VERSION_MAX_SIZE   (16)

Definition at line 99 of file BootManagementInternal.h.

◆ OC_CUSTOM_BOOT_DEVICE_PATH_GUID

#define OC_CUSTOM_BOOT_DEVICE_PATH_GUID
Value:
{ 0xd6f263f9, 0x0b19, 0x4670, \
{ 0xb0, 0xa4, 0x9d, 0x95, 0x9f, 0x58, 0xdf, 0x65 } }

Identifies the DevicePath structure for OpenCore custom entries.

Definition at line 32 of file BootManagementInternal.h.

◆ OC_CUSTOM_FS_HANDLE

#define OC_CUSTOM_FS_HANDLE   ((EFI_HANDLE)(UINTN) 0x2007C5F5U)

Definition at line 27 of file BootManagementInternal.h.

◆ OC_ENTRY_PROTOCOL_DEVICE_PATH_GUID

#define OC_ENTRY_PROTOCOL_DEVICE_PATH_GUID
Value:
{ 0x669bf063, 0x78c1, 0x4c29, \
{ 0x93, 0x34, 0x2f, 0xf0, 0x15, 0xfe, 0xa2, 0xfe } }

Identifies the DevicePath structure for Boot Entry Brotocol custom entries.

Definition at line 39 of file BootManagementInternal.h.

◆ SIZE_OF_OC_CUSTOM_BOOT_DEVICE_PATH

#define SIZE_OF_OC_CUSTOM_BOOT_DEVICE_PATH    (sizeof (VENDOR_DEVICE_PATH) + SIZE_OF_FILEPATH_DEVICE_PATH)

The size of a OC_CUSTOM_BOOT_DEVICE_PATH structure excluding the name.

Definition at line 87 of file BootManagementInternal.h.

◆ SIZE_OF_OC_ENTRY_PROTOCOL_DEVICE_PATH

#define SIZE_OF_OC_ENTRY_PROTOCOL_DEVICE_PATH    (sizeof (VENDOR_DEVICE_PATH) + sizeof (EFI_GUID) + SIZE_OF_FILEPATH_DEVICE_PATH)

The size of a OC_ENTRY_PROTOCOL_DEVICE_PATH structure excluding the name.

Definition at line 93 of file BootManagementInternal.h.

Typedef Documentation

◆ [struct]

typedef PACKED struct { ... } OC_CUSTOM_BOOT_DEVICE_PATH

DevicePath to describe OpenCore custom entries.

◆ [struct]

typedef PACKED struct { ... } OC_CUSTOM_BOOT_DEVICE_PATH_DECL

◆ [struct]

typedef PACKED struct { ... } OC_ENTRY_PROTOCOL_DEVICE_PATH

DevicePath to describe Boot Entry Protocol custom entries. Include partuuid of boot drive in VenHw custom memory.

◆ [struct]

typedef PACKED struct { ... } OC_ENTRY_PROTOCOL_DEVICE_PATH_DECL

Enumeration Type Documentation

◆ INTERNAL_ENTRY_VISIBILITY

Entry visibility parameters set by .contentVisibility file. Hidden entries are not added to the list.

Enumerator
BootEntryNormal 
BootEntryAuxiliary 
BootEntryDisabled 

Definition at line 121 of file BootManagementInternal.h.

Function Documentation

◆ InternalAddBootEntryFromCustomEntry()

EFI_STATUS InternalAddBootEntryFromCustomEntry ( IN OUT OC_BOOT_CONTEXT * BootContext,
IN OUT OC_BOOT_FILESYSTEM * FileSystem,
IN OC_PICKER_ENTRY * CustomEntry,
IN BOOLEAN IsBootEntryProtocol )

Create bootable entry from custom entry.

Parameters
[in,out]BootContextContext of filesystems.
[in,out]FileSystemFilesystem to add custom entry.
[in]CustomEntryCustom entry.
[in]IsBootEntryProtocolIs entry from OC_BOOT_ENTRY_PROTOCOL.
Return values
EFI_SUCCESSon success.

Create bootable entry from custom entry.

Parameters
[in,out]BootContextContext of filesystems.
[in,out]FileSystemFilesystem to add custom entry.
[in]CustomEntryCustom entry.
Return values
EFI_SUCCESSon success.

Definition at line 642 of file BootEntryManagement.c.

◆ InternalCheckScanPolicy()

EFI_STATUS InternalCheckScanPolicy ( IN EFI_HANDLE Handle,
IN UINT32 Policy,
OUT BOOLEAN *External OPTIONAL )

Definition at line 299 of file PolicyManagement.c.

◆ InternalDebugBootEnvironment()

VOID InternalDebugBootEnvironment ( IN CONST UINT16 * BootOrder,
IN EFI_GUID * BootGuid,
IN UINTN BootOrderCount )

Definition at line 186 of file DefaultEntryChoice.c.

◆ InternalDescribeBootEntry()

EFI_STATUS InternalDescribeBootEntry ( IN OC_BOOT_CONTEXT * BootContext,
IN OUT OC_BOOT_ENTRY * BootEntry )

Describe boot entry contents by setting fields other than DevicePath.

Parameters
[in]BootContextBoot context.
[in,out]BootEntryLocated boot entry.
Return values
EFI_SUCCESSThe entry point is described successfully.

Definition at line 692 of file BootEntryInfo.c.

◆ InternalFileSystemForHandle()

OC_BOOT_FILESYSTEM * InternalFileSystemForHandle ( IN OC_BOOT_CONTEXT * BootContext,
IN EFI_HANDLE FileSystemHandle,
IN BOOLEAN LazyScan,
OUT BOOLEAN *AlreadySeen OPTIONAL )

Finds filesystem for discovered filesystem handle. This solves the problem of checking scan policy multiple times as well as the problem of finding the filesystem to add entries too.

Parameters
[in]BootContextContext of filesystems.
[in]FileSystemHandlePartition handle.
[in]LazyScanLazy filesystem scanning.
[out]AlreadySeenSet to TRUE if file system was already present in context.
Return values
discoveredfilesystem (legit). @retcal NULL when booting is not allowed from this filesystem.

Definition at line 1894 of file BootEntryManagement.c.

◆ InternalGetAppleDiskLabel()

CHAR16 * InternalGetAppleDiskLabel ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * FileSystem,
IN CONST CHAR16 * BootDirectoryName,
IN CONST CHAR16 * LabelFilename )

Definition at line 86 of file BootEntryInfo.c.

◆ InternalGetAppleImage()

EFI_STATUS InternalGetAppleImage ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * FileSystem,
IN CONST CHAR16 * DirectoryName,
IN CONST CHAR16 * LabelFilename,
OUT VOID ** ImageData,
OUT UINT32 * DataSize )

◆ InternalGetBootOptionPath()

EFI_DEVICE_PATH_PROTOCOL * InternalGetBootOptionPath ( IN EFI_LOAD_OPTION * LoadOption,
IN UINTN LoadOptionSize )

Definition at line 141 of file DefaultEntryChoice.c.

◆ InternalGetBootOrderForBooting()

UINT16 * InternalGetBootOrderForBooting ( IN EFI_GUID * BootVariableGuid,
IN BOOLEAN BlacklistAppleUpdate,
OUT UINTN * BootOrderCount,
IN BOOLEAN UseBootNextOnly )

Definition at line 721 of file DefaultEntryChoice.c.

◆ InternalGetContentFlavour()

CHAR8 * InternalGetContentFlavour ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * FileSystem,
IN CONST CHAR16 * BootDirectoryName )

Definition at line 122 of file BootEntryInfo.c.

◆ InternalGetOcCustomDevPath()

CONST OC_CUSTOM_BOOT_DEVICE_PATH * InternalGetOcCustomDevPath ( IN CONST EFI_DEVICE_PATH_PROTOCOL * DevicePath)

Determines whether DevicePath is an OpenCore custom boot entry.

Returns
The OpenCore custom boot entry, or NULL.

Definition at line 75 of file DefaultEntryChoice.c.

◆ InternalGetOcEntryProtocolDevPath()

CONST OC_ENTRY_PROTOCOL_DEVICE_PATH * InternalGetOcEntryProtocolDevPath ( IN CONST EFI_DEVICE_PATH_PROTOCOL * DevicePath)

Determines whether DevicePath is a Boot Entry Protocol custom boot entry.

Returns
The Boot Entry Protocol custom boot entry, or NULL.

Definition at line 108 of file DefaultEntryChoice.c.

◆ InternalGetRecoveryOsBooter()

EFI_STATUS InternalGetRecoveryOsBooter ( IN EFI_HANDLE Device,
OUT EFI_DEVICE_PATH_PROTOCOL ** FilePath,
IN BOOLEAN Basic )

Definition at line 263 of file BootEntryInfo.c.

◆ InternalIsAppleLegacyLoadApp()

BOOLEAN InternalIsAppleLegacyLoadApp ( IN CONST EFI_DEVICE_PATH_PROTOCOL * DevicePath)

Definition at line 552 of file DefaultEntryChoice.c.

◆ InternalLoadBootEntry()

EFI_STATUS InternalLoadBootEntry ( IN OC_PICKER_CONTEXT * Context,
IN OC_BOOT_ENTRY * BootEntry,
IN EFI_HANDLE ParentHandle,
OUT EFI_HANDLE * EntryHandle,
OUT INTERNAL_DMG_LOAD_CONTEXT * DmgLoadContext,
OUT VOID ** CustomFreeContext )

Definition at line 1527 of file DefaultEntryChoice.c.

◆ InternalLoadDmg()

EFI_DEVICE_PATH_PROTOCOL * InternalLoadDmg ( IN OUT INTERNAL_DMG_LOAD_CONTEXT * Context,
IN OC_DMG_LOADING_SUPPORT DmgLoading,
IN OC_APPLE_DISK_IMAGE_PRELOAD_CONTEXT * DmgPreloadContext )

Definition at line 319 of file DmgBootSupport.c.

◆ InternalRunRequestPrivilege()

EFI_STATUS InternalRunRequestPrivilege ( IN OC_PICKER_CONTEXT * PickerContext,
IN OC_PRIVILEGE_LEVEL Level )

Definition at line 219 of file OcBootManagementLib.c.

◆ InternalUnloadDmg()

VOID InternalUnloadDmg ( IN INTERNAL_DMG_LOAD_CONTEXT * DmgLoadContext)

Definition at line 525 of file DmgBootSupport.c.

Variable Documentation

◆ EntryName

EFI_DEVICE_PATH_PROTOCOL EntryName

Definition at line 50 of file BootManagementInternal.h.

◆ Hdr

VENDOR_DEVICE_PATH Hdr

Definition at line 49 of file BootManagementInternal.h.

◆ Header

VENDOR_DEVICE_PATH Header

Definition at line 69 of file BootManagementInternal.h.

◆ Partuuid

EFI_GUID Partuuid

Definition at line 59 of file BootManagementInternal.h.