Setvariable(), Betwee – Intel Extensible Firmware Interface User Manual

Page 199

Advertising
background image

Services

— Runtime Services

Version 1.10

12/01/02

6-7

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
vendor’s variable. Each

VariableName

is unique for each

VendorGuid

.

VariableName

must contain 1 or more

Unicode characters. If

VariableName

is an empty Unicode

string, then

EFI_INVALID_PARAMETER

is returned.

VendorGuid

A unique identifier for the vendor. Type

EFI_GUID

is defined

in the

InstallProtocolInterface()

function

description.

Attributes

Attributes bitmask to set for the variable. Refer to the

GetVariable()

function description.

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 firmware’s language code

Advertising