Extensible Firmware Interface Specification
82 12/12/00 Version 1.02
3.5.3 SetVariable()
Summary
Sets the value of a variable.
Prototype
EFI_STATUS
SetVariable (
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
IN UINT32 Attributes,
IN UINTN DataSize,
IN VOID *Data
);
Parameters
VariableName A Null-terminated Unicode string that is the name of the
vendors variable. Each VariableName is unique for each
VendorGuid.
VendorGuid A unique identifier for the vendor. Type EFI_GUID is defined
in Section 3.3.1.
Attributes Attributes bitmask to set for the variable. See Section 3.5.1.
DataSize The size in bytes of the Data buffer. A size of zero causes the
variable to be deleted.
Data The contents for the variable.
Description
Variables are stored by the firmware and may maintain their values across power cycles. Each
vendor may create and manage its own variables without the risk of name conflicts by using a
unique VendorGuid.
Each variable has Attributes that define how the firmware stores and maintains the data value.
If the EFI_VARIABLE_NON_VOLATILE attribute is not set, the firmware stores the variable in
normal memory and it is not maintained across a power cycle. Such variables are used to pass
information from one component to another. An example of this is the firmwares language code
support variable. It is created at firmware initialization time for access by EFI components that
may need the information, but does not need to be backed up to non-volatile storage.