Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Rikitav/Unified.Firmware/llms.txt

Use this file to discover all available pages before exploring further.

VolumePath is a strongly-typed value type that wraps a volume’s GUID identifier together with its platform-specific absolute path string. It eliminates the need to pass raw Guid and string pairs around separately and provides implicit conversions to the most common interop targets. The primary source of a VolumePath instance is EfiPartition.VolumePath, which is populated by IFirmwareBackend.FindEfiSystemPartition() at static-initialisation time.

Namespace

Unified.Firmware

Type

readonly record struct VolumePath

Constructor

public VolumePath(Guid volumeIdentificator, string fullPath)
ParameterTypeDescription
volumeIdentificatorGuidThe unique identifier (partition GUID) associated with the volume.
fullPathstringThe platform-specific absolute path to the root of the volume.

Properties

PropertyTypeDescription
IdentificatorGuidThe partition’s unique GUID identifier, as assigned when the partition was created.
FullPathstringThe platform-specific absolute path to the volume root. Format depends on the operating system — see Platform-Specific Path Formats below.

Platform-Specific Path Formats

The value stored in FullPath is determined at runtime by the active IFirmwareBackend and differs between platforms:
PlatformFormatNotes
Windows\\?\Volume{GUID}\Compatible with the Windows device namespace and can be passed directly to WinAPI functions that require a volume path or handle.
Linux/dev/{diskName}/bootThe absolute path to the directory where the EFI System Partition is mounted, typically under /boot/efi or similar.

Implicit Conversions

VolumePath defines three implicit conversions so it can be passed directly to APIs that expect a Guid, string, or DirectoryInfo without an explicit cast.
ConversionResult
VolumePathGuidReturns Identificator
VolumePathstringReturns FullPath
VolumePathDirectoryInfoReturns new DirectoryInfo(FullPath)

Methods

MethodReturnsDescription
ToString()stringReturns FullPath.

EfiPartition

EfiPartition is a static class in Unified.Firmware.SystemPartition that exposes the system EFI System Partition for the current machine. Its VolumePath property is the primary way to obtain a VolumePath instance in normal usage; the Identificator shortcut property delegates directly to VolumePath.Identificator.
// EfiPartition.TypeID is the well-known ESP partition type GUID
// (c12a7328-f81f-11d2-ba4b-00a0c93ec93b)
Guid espTypeId = EfiPartition.TypeID;

// EfiPartition.VolumePath resolves via IFirmwareBackend.FindEfiSystemPartition()
VolumePath esp = EfiPartition.VolumePath;

// Shortcut — equivalent to EfiPartition.VolumePath.Identificator
Guid espGuid = EfiPartition.Identificator;

FirmwareApplicationArchitecture Enum

FirmwareApplicationArchitecture is an enum in the Unified.Firmware.SystemPartition namespace that identifies the processor architecture of a PE32/PE32+ EFI executable. It is used by EfiExecutableInfo.Architecture and the EfiExecutableInfo constructors. Its values correspond to the PE Machine field defined in the PE/COFF specification. Namespace: Unified.Firmware.SystemPartition
Underlying type: ushort
MemberValueDescription
Unknown0Architecture could not be determined or is not recognised.
Ia320x14c32-bit Intel x86 (IA-32).
x640x866464-bit AMD64 / Intel EM64T.
Ia640x200Intel Itanium 64-bit (IA-64).
Arm0x1c232-bit ARM (AArch32 / Thumb-2).
AArch640xaa6464-bit ARM (AArch64 / ARM64).
RISC_V320x503232-bit RISC-V.
RISC_V640x506464-bit RISC-V.
RISC_V1280x5128128-bit RISC-V.

Code Examples

Combining a VolumePath with Path.Combine

Because VolumePath converts implicitly to string, it can be used wherever a path string is expected — including Path.Combine:
using System.IO;
using Unified.Firmware;
using Unified.Firmware.SystemPartition;

VolumePath esp = EfiPartition.VolumePath;

// Build a path to the EFI boot directory
string efiBootDir = Path.Combine(esp, "EFI", "Boot");
Console.WriteLine(efiBootDir);
// Windows: \\?\Volume{...}\EFI\Boot
// Linux:   /dev/sda1/boot/EFI/Boot

Using the DirectoryInfo Conversion

using System.IO;
using Unified.Firmware;
using Unified.Firmware.SystemPartition;

VolumePath esp = EfiPartition.VolumePath;

// Implicit conversion to DirectoryInfo
DirectoryInfo espDir = esp;

foreach (FileInfo file in espDir.GetFiles("*.efi", SearchOption.AllDirectories))
{
    Console.WriteLine(file.FullName);
}

Reading the Partition GUID

using System;
using Unified.Firmware;
using Unified.Firmware.SystemPartition;

VolumePath esp = EfiPartition.VolumePath;

// Implicit conversion to Guid
Guid partitionGuid = esp;
Console.WriteLine($"ESP partition GUID: {partitionGuid}");

// Or access the property directly
Console.WriteLine($"ESP partition GUID: {esp.Identificator}");

Build docs developers (and LLMs) love