UEFI firmware variables are small, named key-value records stored in NVRAM. Each variable belongs to a namespace identified by a vendor GUID, carries a set of attribute flags that control its lifetime and access, and holds a binary payload. The UEFI specification defines a set of globally-scoped variables (boot order, secure boot state, OS indications, and more) under the well-knownDocumentation 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.
GlobalVariable GUID. OEM vendors extend the same storage mechanism with their own GUIDs for platform-specific settings. The FirmwareEnvironment class and its pre-configured GlobalFirmwareEnvironment subclass give you typed, marshal-free access to all of these.
Using GlobalFirmwareEnvironment
FirmwareEnvironment.Global is a lazily initialised singleton of type GlobalFirmwareEnvironment. It is scoped to the standard UEFI global namespace (8BE4DF61-93CA-11D2-AA0D-00E098032B8C) and exposes commonly needed variables as strongly typed properties.
Reading Secure Boot state
SecureBoot is read-only — it is set by the firmware during boot and indicates whether Secure Boot enforcement is currently active:
Reading and writing the boot timeout
Timeout is the number of seconds the firmware waits before auto-selecting the first boot entry. It can be read and written:
Reading the BootOrder array
BootOrder exposes the ushort[] array of ordered boot indices. For most boot-management scenarios, prefer FirmwareBootService.LoadOrder (which wraps this in BootOptionIndex[]), but the raw array is useful for diagnostics:
OsIndications — reading and writing
OsIndications allows the OS to signal requests to the firmware across the next reboot. The flag is a ulong-backed [Flags] enum:
Trigger boot to firmware UI
FirmwareInterface.BootToUserInterface() is a convenience wrapper that checks capability support and sets the BOOT_TO_FW_UI bit in one call. The system will enter the firmware setup screen on the next reboot — the call does not restart the computer.
Custom vendor namespace
InstantiateFirmwareEnvironment directly with any GUID to access vendor-specific variables. The constructor takes a backend (use FirmwareInterface.CurrentBackend) and the target namespace GUID:
FirmwareVendors — known namespace GUIDs
FirmwareVendors is a static class that collects well-known vendor GUIDs as Guid fields:
| Field | GUID | Description |
|---|---|---|
GlobalVariable | 8BE4DF61-93CA-11D2-AA0D-00E098032B8C | Standard UEFI global namespace. Stores BootOrder, BootNext, Timeout, SecureBoot, SetupMode, etc. |
ImageSecurityDatabase | D719B2CB-3D3A-4596-A3BC-DAD00E67656F | Secure Boot key databases (db, dbx, dbt). |
HardwareErrorVariable | 414E6BDD-E47B-47CC-B244-BB610208F4EF | WHEA hardware error records (HwErrRec####). |
CapsuleReport | 39B68C46-F7FB-441B-B6D1-E15C1B773062 | Firmware update capsule result variables. |
MicrosoftVendor | 77FA9ABD-0359-4D32-BD60-28F4E78F784B | Microsoft-specific variables such as CurrentPolicy, BitLocker state, early-boot telemetry. |
LenovoVendor | C020489E-6DB2-4EF2-9AA5-CA06FC11D36A | Lenovo / ThinkPad BIOS settings accessible via WMI-to-UEFI bridge. |
DellVendor | 4BCFDDBD-65F0-4FC7-BF96-981FBB0EBFF4 | Dell-specific variables for keyboard backlight, power profiles, CBOM. |
HpVendor | 577FA4AD-1A3E-4BCE-A268-3F173B00DBEC | HP SureStart, security settings, and hardware tokens. |
AsusVendor | 20C731A8-79C0-4E80-AFDE-0C3DEB22CDAE | ASUS ROG / Prime memory timings, Aura LED, and overclocking profiles. |
AppleVendor | 7C436110-AB2A-4BBB-A880-FE41995C9F82 | Apple Mac EFI variables such as StartupMute, Bluetooth peripheral pairings, and efi-boot-device. |
VariableAttributes
Every firmware variable is stored with a bitmask ofVariableAttributes that controls its lifetime and who can read or write it. The most common combination for OS-facing variables is NON_VOLATILE | BOOTSERVICE_ACCESS | RUNTIME_ACCESS.
| Flag | Value | Meaning |
|---|---|---|
NON_VOLATILE | 0x01 | Persists across power cycles. Omit for variables that only exist during a single boot session. |
BOOTSERVICE_ACCESS | 0x02 | Readable and writable during EFI boot services (before ExitBootServices()). All standard variables carry this flag. |
RUNTIME_ACCESS | 0x04 | Readable and writable at OS runtime after ExitBootServices(). Required for variables that the OS or applications need to access. |
AUTHENTICATED_WRITE_ACCESS | 0x10 | Writes must be accompanied by a valid authentication descriptor. Used for Secure Boot key management. |
Reading a struct variable
FirmwareEnvironment.ReadVariable<T> marshals the raw bytes of an NVRAM variable into any unmanaged struct:
Writing a string variable
FirmwareEnvironment.WriteStringVariable serialises a .NET string as a null-terminated UTF-16LE string (the encoding expected by UEFI):