15. gRT->GetVariable API를 사용하여 부팅 변수 가져오기 및 구문 분석
GetVariable()
Summary:
Returns the value of a variable.
Prototype:
typedef
EFI_STATUS
GetVariable (
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
OUT UINT32 *Attributes OPTIONAL,
IN OUT UINTN *DataSize,
OUT VOID *Data OPTIONAL
);
Parameters:
VariableName A Null-terminated string that is the name of the vendor’s variable.
VendorGuid A unique identifier for the vendor
Attributes If not NULL, a pointer to the memory location to return the
attributes bitmask for the variable.
If not NULL, then Attributes is set on output both when
EFI_SUCCESS and when EFI_BUFFER_TOO_SMALL is returned.
DataSize On input, the size in bytes of the return Data buffer.
On output the size of data returned in Data.
Data The buffer to return the contents of the variable. May be NULL
with a zero DataSize in order to determine the size buffer needed.
Description:
Each vendor may create and manage its own variables without the risk of name conflicts by using a
unique VendorGuid. When a variable is set its Attributes are supplied to indicate how the data variable
should be stored and maintained by the system. The attributes affect when the variable may be accessed
and volatility of the data
If the Data buffer is too small to hold the contents of the variable, the error EFI_BUFFER_TOO_SMALL is
returned and DataSize is set to the required buffer size to obtain the data.
Status Codes Returned:
EFI_SUCCESS The function completed successfully.
EFI_NOT_FOUND The variable was not found.
EFI_BUFFER_TOO_SMALL The DataSize is too small for the result. DataSize has been
updated with the size needed to complete the request. If
Attributes is not NULL, then the attributes bitmask for the
variable has been stored to the memory location pointed-to by
Attributes.
...
Last updated