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)
| Parameter | Type | Description |
|---|
volumeIdentificator | Guid | The unique identifier (partition GUID) associated with the volume. |
fullPath | string | The platform-specific absolute path to the root of the volume. |
Properties
| Property | Type | Description |
|---|
Identificator | Guid | The partition’s unique GUID identifier, as assigned when the partition was created. |
FullPath | string | The platform-specific absolute path to the volume root. Format depends on the operating system — see Platform-Specific Path Formats below. |
The value stored in FullPath is determined at runtime by the active IFirmwareBackend and differs between platforms:
| Platform | Format | Notes |
|---|
| 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}/boot | The 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.
| Conversion | Result |
|---|
VolumePath → Guid | Returns Identificator |
VolumePath → string | Returns FullPath |
VolumePath → DirectoryInfo | Returns new DirectoryInfo(FullPath) |
Methods
| Method | Returns | Description |
|---|
ToString() | string | Returns 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
| Member | Value | Description |
|---|
Unknown | 0 | Architecture could not be determined or is not recognised. |
Ia32 | 0x14c | 32-bit Intel x86 (IA-32). |
x64 | 0x8664 | 64-bit AMD64 / Intel EM64T. |
Ia64 | 0x200 | Intel Itanium 64-bit (IA-64). |
Arm | 0x1c2 | 32-bit ARM (AArch32 / Thumb-2). |
AArch64 | 0xaa64 | 64-bit ARM (AArch64 / ARM64). |
RISC_V32 | 0x5032 | 32-bit RISC-V. |
RISC_V64 | 0x5064 | 64-bit RISC-V. |
RISC_V128 | 0x5128 | 128-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}");