/*++\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Caution: This file is used for Duet platform only, do not use them in real platform.\r
+All variable code, variable metadata, and variable data used by Duet platform are on \r
+disk. They can be changed by user. BIOS is not able to protoect those.\r
+Duet trusts all meta data from disk. If variable code, variable metadata and variable\r
+data is modified in inproper way, the behavior is undefined.\r
+\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
return CopyMem (mGlobal->PlatformLang, Supported - CompareLength, CompareLength);\r
}\r
SubIndex++;\r
+\r
+ //\r
+ // Skip ';' characters in Supported\r
+ //\r
+ for (; *Supported != '\0' && *Supported == ';'; Supported++);\r
}\r
}\r
}\r
\r
**/\r
CHAR8 *\r
+EFIAPI\r
VariableGetBestLanguage (\r
IN CONST CHAR8 *SupportedLanguages, \r
IN BOOLEAN Iso639Language,\r
IN EFI_GUID *VendorGuid,\r
OUT UINT32 *Attributes OPTIONAL,\r
IN OUT UINTN *DataSize,\r
- OUT VOID *Data\r
+ OUT VOID *Data OPTIONAL\r
)\r
/*++\r
\r
Attributes OPTIONAL Attribute value of the variable found\r
DataSize Size of Data found. If size is less than the\r
data, this value contains the required size.\r
- Data Data pointer\r
+ Data The buffer to return the contents of the variable. May be NULL\r
+ with a zero DataSize in order to determine the size buffer needed.\r
\r
Returns:\r
\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+ if (VariableName[0] == 0) {\r
+ return EFI_NOT_FOUND;\r
+ }\r
+\r
//\r
// Find existing variable\r
//\r
// since the space occupied by variables not marked with\r
// VAR_ADDED is not allowed to be reclaimed in Runtime.\r
//\r
- if ((NextVariable->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {\r
+ if ((Variable->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {\r
HwErrVariableTotalSize += VariableSize;\r
} else {\r
CommonVariableTotalSize += VariableSize;\r
// the space not marked as VAR_ADDED is reclaimable now.\r
//\r
if ((Variable->State == VAR_ADDED) || (Variable->State == (VAR_ADDED & VAR_IN_DELETED_TRANSITION))) {\r
- if ((NextVariable->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {\r
+ if ((Variable->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {\r
HwErrVariableTotalSize += VariableSize;\r
} else {\r
CommonVariableTotalSize += VariableSize;\r