OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
PolicyManagement.c File Reference
#include "BootManagementInternal.h"
#include <Guid/AppleApfsInfo.h>
#include <Guid/AppleBless.h>
#include <Guid/AppleHfsInfo.h>
#include <Guid/AppleVariable.h>
#include <Guid/Gpt.h>
#include <Guid/FileInfo.h>
#include <Guid/GlobalVariable.h>
#include <Guid/OcVariable.h>
#include <Protocol/AppleBootPolicy.h>
#include <Protocol/ApfsEfiBootRecordInfo.h>
#include <Protocol/SimpleFileSystem.h>
#include <Protocol/SimpleTextOut.h>
#include <Protocol/LoadedImage.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcDevicePathLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcStringLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>

Go to the source code of this file.

Functions

UINT32 OcGetDevicePolicyType (IN EFI_HANDLE Handle, OUT BOOLEAN *External OPTIONAL)
 
UINT32 OcGetFileSystemPolicyType (IN EFI_HANDLE Handle)
 
EFI_STATUS InternalCheckScanPolicy (IN EFI_HANDLE Handle, IN UINT32 Policy, OUT BOOLEAN *External OPTIONAL)
 
OC_BOOT_ENTRY_TYPE OcGetBootDevicePathType (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT BOOLEAN *IsFolder OPTIONAL, OUT BOOLEAN *IsGeneric OPTIONAL)
 
EFI_LOADED_IMAGE_PROTOCOL * OcGetAppleBootLoadedImage (IN EFI_HANDLE ImageHandle)
 

Variables

EFI_GUID mMsftBasicDataPartitionTypeGuid
 
EFI_GUID mMsftReservedPartitionTypeGuid
 
EFI_GUID mMsftRecoveryPartitionTypeGuid
 
EFI_GUID mLinuxRootX86PartitionTypeGuid
 
EFI_GUID mLinuxRootX8664PartitionTypeGuid
 
EFI_GUID mLinuxFileSystemPartitionTypeGuid
 
EFI_GUID mXBootLdrPartitionTypeGuid
 

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 PolicyManagement.c.

Function Documentation

◆ InternalCheckScanPolicy()

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

Definition at line 299 of file PolicyManagement.c.

◆ OcGetAppleBootLoadedImage()

EFI_LOADED_IMAGE_PROTOCOL * OcGetAppleBootLoadedImage ( IN EFI_HANDLE ImageHandle)

Get loaded image protocol for Apple bootloader.

Parameters
[in]ImageHandleImage handle.
Return values
loadedimage protocol or NULL for non Apple images.

Definition at line 441 of file PolicyManagement.c.

◆ OcGetBootDevicePathType()

OC_BOOT_ENTRY_TYPE OcGetBootDevicePathType ( IN EFI_DEVICE_PATH_PROTOCOL * DevicePath,
OUT BOOLEAN *IsFolder OPTIONAL,
OUT BOOLEAN *IsGeneric OPTIONAL )

Check if supplied device path contains known names (e.g. Apple bootloader).

Parameters
[in]DevicePathDevice path.
[out]IsFolderDevice path represents directory, optional.
[out]IsGenericDevice path represents generic booter, optional.
Return values
entrytype for potentially known bootloaders.
OC_BOOT_UNKNOWNfor unknown bootloaders.

Definition at line 330 of file PolicyManagement.c.

◆ OcGetDevicePolicyType()

UINT32 OcGetDevicePolicyType ( IN EFI_HANDLE Handle,
OUT BOOLEAN *External OPTIONAL )

Get device scan policy type.

Parameters
[in]HandleDevice/partition handle.
[out]ExternalCheck whether device is external.
Return values
requiredpolicy or 0 on mismatch.

Definition at line 45 of file PolicyManagement.c.

◆ OcGetFileSystemPolicyType()

UINT32 OcGetFileSystemPolicyType ( IN EFI_HANDLE Handle)

Get file system scan policy type.

Parameters
[in]HandlePartition handle.
Return values
requiredpolicy or 0 on mismatch.

Definition at line 247 of file PolicyManagement.c.

Variable Documentation

◆ mLinuxFileSystemPartitionTypeGuid

EFI_GUID mLinuxFileSystemPartitionTypeGuid
Initial value:
= {
0x0FC63DAF, 0x8483, 0x4772, { 0x8E, 0x79, 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4 }
}

Definition at line 234 of file PolicyManagement.c.

◆ mLinuxRootX8664PartitionTypeGuid

EFI_GUID mLinuxRootX8664PartitionTypeGuid
Initial value:
= {
0x4F68BCE3, 0xE8CD, 0x4DB1, { 0x96, 0xE7, 0xFB, 0xCA, 0xF9, 0x84, 0xB7, 0x09 }
}

Definition at line 230 of file PolicyManagement.c.

◆ mLinuxRootX86PartitionTypeGuid

EFI_GUID mLinuxRootX86PartitionTypeGuid
Initial value:
= {
0x44479540, 0xF297, 0x41B2, { 0x9A, 0xF7, 0xD1, 0x31, 0xD5, 0xF0, 0x45, 0x8A }
}

Linux partitions. https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs https://systemd.io/DISCOVERABLE_PARTITIONS/

Definition at line 226 of file PolicyManagement.c.

◆ mMsftBasicDataPartitionTypeGuid

EFI_GUID mMsftBasicDataPartitionTypeGuid
Initial value:
= {
0xEBD0A0A2, 0xB9E5, 0x4433, { 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7 }
}

Microsoft partitions. https://docs.microsoft.com/ru-ru/windows/win32/api/vds/ns-vds-create_partition_parameters

Definition at line 209 of file PolicyManagement.c.

◆ mMsftRecoveryPartitionTypeGuid

EFI_GUID mMsftRecoveryPartitionTypeGuid
Initial value:
= {
0xDE94BBA4, 0x06D1, 0x4D40, { 0xA1, 0x6A, 0xBF, 0xD5, 0x01, 0x79, 0xD6, 0xAC }
}

Definition at line 217 of file PolicyManagement.c.

◆ mMsftReservedPartitionTypeGuid

EFI_GUID mMsftReservedPartitionTypeGuid
Initial value:
= {
0xE3C9E316, 0x0B5C, 0x4DB8, { 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE }
}

Definition at line 213 of file PolicyManagement.c.

◆ mXBootLdrPartitionTypeGuid

EFI_GUID mXBootLdrPartitionTypeGuid
Initial value:
= {
0xBC13C2FF, 0x59E6, 0x4262, { 0xA3, 0x52, 0xB2, 0x75, 0xFD, 0x6F, 0x71, 0x72 }
}

Extended Boot Loader Partition (XBOOTLDR). https://systemd.io/BOOT_LOADER_SPECIFICATION/

Definition at line 242 of file PolicyManagement.c.