mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
Add new interface GetVariable2 and GetEfiGlobalVariable2 to return more info. Also replace old interface with new one.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13375 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
650b87cc1b
commit
bf4a3dbd47
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
This file implements the protocol functions related to string package.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -349,7 +349,7 @@ HiiThunkGetString (
|
||||
//
|
||||
// Get the current platform language setting
|
||||
//
|
||||
PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");
|
||||
GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);
|
||||
|
||||
//
|
||||
// Get the best matching language from SupportedLanguages
|
||||
|
@ -1513,8 +1513,8 @@ BdsLibEnumerateAllBootOption (
|
||||
// device from the boot order variable
|
||||
//
|
||||
if (mEnumBootDevice) {
|
||||
LastLang = GetVariable (LAST_ENUM_LANGUAGE_VARIABLE_NAME, &gLastEnumLangGuid);
|
||||
PlatLang = GetEfiGlobalVariable (L"PlatformLang");
|
||||
GetVariable2 (LAST_ENUM_LANGUAGE_VARIABLE_NAME, &gLastEnumLangGuid, &LastLang, NULL);
|
||||
GetEfiGlobalVariable2 (L"PlatformLang", &PlatLang, NULL);
|
||||
ASSERT (PlatLang != NULL);
|
||||
if ((LastLang != NULL) && (AsciiStrCmp (LastLang, PlatLang) == 0)) {
|
||||
Status = BdsLibBuildOptionFromVar (BdsBootOptionList, L"BootOrder");
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The platform device manager reference implementation
|
||||
|
||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -2167,7 +2167,7 @@ DriverHealthSelectBestLanguage (
|
||||
CHAR8 *LanguageVariable;
|
||||
CHAR8 *BestLanguage;
|
||||
|
||||
LanguageVariable = GetEfiGlobalVariable (Iso639Language ? L"Lang" : L"PlatformLang");
|
||||
GetEfiGlobalVariable2 (Iso639Language ? L"Lang" : L"PlatformLang", &LanguageVariable, NULL);
|
||||
|
||||
BestLanguage = GetBestLanguage(
|
||||
SupportedLanguages,
|
||||
|
@ -232,7 +232,7 @@ FrontPageCallback (
|
||||
Index++;
|
||||
}
|
||||
|
||||
PlatformSupportedLanguages = GetEfiGlobalVariable (L"PlatformLangCodes");
|
||||
GetEfiGlobalVariable2 (L"PlatformLangCodes", &PlatformSupportedLanguages, NULL);
|
||||
if (PlatformSupportedLanguages == NULL) {
|
||||
PlatformSupportedLanguages = AllocateCopyPool (
|
||||
AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)),
|
||||
@ -430,7 +430,7 @@ InitializeFrontPage (
|
||||
Lang = AllocatePool (AsciiStrSize (LanguageString));
|
||||
ASSERT (Lang != NULL);
|
||||
|
||||
CurrentLang = GetEfiGlobalVariable (L"PlatformLang");
|
||||
GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);
|
||||
//
|
||||
// Select the best language in LanguageString as the default one.
|
||||
//
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
HII Library implementation that uses DXE protocols and services.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -250,7 +250,7 @@ HiiGetString (
|
||||
//
|
||||
// Get the current platform language setting
|
||||
//
|
||||
PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");
|
||||
GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);
|
||||
|
||||
//
|
||||
// If Languag is NULL, then set it to an empty string, so it will be
|
||||
|
@ -2,7 +2,7 @@
|
||||
Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and
|
||||
Simple Text Output Protocol upon Serial IO Protocol.
|
||||
|
||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -358,7 +358,7 @@ IsTerminalInConsoleVariable (
|
||||
//
|
||||
// Get global variable and its size according to the name given.
|
||||
//
|
||||
Variable = GetEfiGlobalVariable (VariableName);
|
||||
GetEfiGlobalVariable2 (VariableName, &Variable, NULL);
|
||||
if (Variable == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
@ -1431,7 +1431,7 @@ TerminalUpdateConsoleDevVariable (
|
||||
//
|
||||
// Get global variable and its size according to the name given.
|
||||
//
|
||||
Variable = GetEfiGlobalVariable (VariableName);
|
||||
GetEfiGlobalVariable2 (VariableName, &Variable, NULL);
|
||||
if (Variable == NULL) {
|
||||
return;
|
||||
}
|
||||
@ -1500,7 +1500,7 @@ TerminalRemoveConsoleDevVariable (
|
||||
//
|
||||
// Get global variable and its size according to the name given.
|
||||
//
|
||||
Variable = GetEfiGlobalVariable (VariableName);
|
||||
GetEfiGlobalVariable2 (VariableName, &Variable, NULL);
|
||||
if (Variable == NULL) {
|
||||
return ;
|
||||
}
|
||||
|
@ -2368,7 +2368,7 @@ HiiStringIdToImage (
|
||||
if (Language == NULL) {
|
||||
Language = "";
|
||||
}
|
||||
CurrentLanguage = GetEfiGlobalVariable (L"PlatformLang");
|
||||
GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLanguage, NULL);
|
||||
BestLanguage = GetBestLanguage (
|
||||
SupportedLanguages,
|
||||
FALSE,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Routines used to operate the Ip4 configure variable.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at<BR>
|
||||
@ -91,7 +91,7 @@ Ip4ConfigReadVariable (
|
||||
{
|
||||
NIC_IP4_CONFIG_INFO *NicConfig;
|
||||
|
||||
NicConfig = GetVariable (Instance->MacString, &gEfiNicIp4ConfigVariableGuid);
|
||||
GetVariable2 (Instance->MacString, &gEfiNicIp4ConfigVariableGuid, &NicConfig, NULL);
|
||||
if (NicConfig != NULL) {
|
||||
Ip4ConfigFixRouteTablePointer (&NicConfig->Ip4Info);
|
||||
}
|
||||
@ -255,7 +255,7 @@ Check:
|
||||
continue;
|
||||
}
|
||||
|
||||
NicConfig = GetVariable (VariableName, &gEfiNicIp4ConfigVariableGuid);
|
||||
GetVariable2 (VariableName, &gEfiNicIp4ConfigVariableGuid, &NicConfig, NULL);
|
||||
if (NicConfig == NULL) {
|
||||
break;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
4. It save all the mapping info in NV variables which will be consumed
|
||||
by platform override protocol driver to publish the platform override protocol.
|
||||
|
||||
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -185,7 +185,7 @@ GetComponentNameWorker (
|
||||
//
|
||||
// Find the best matching language.
|
||||
//
|
||||
Language = GetEfiGlobalVariable (VariableName);
|
||||
GetEfiGlobalVariable2 (VariableName, &Language, NULL);
|
||||
BestLanguage = GetBestLanguage (
|
||||
ComponentName->SupportedLanguages,
|
||||
(BOOLEAN) (ProtocolGuid == &gEfiComponentNameProtocolGuid),
|
||||
|
@ -12,7 +12,7 @@
|
||||
of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is
|
||||
defined, then debug and assert related macros wrapped by it are the NULL implementations.
|
||||
|
||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
the terms and conditions of the BSD License that accompanies this distribution.
|
||||
The full text of the license may be found at
|
||||
@ -629,8 +629,11 @@ FreeUnicodeStringTable (
|
||||
IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable
|
||||
);
|
||||
|
||||
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
||||
/**
|
||||
[ATTENTION] This function will be deprecated for security reason.
|
||||
|
||||
Returns a pointer to an allocated buffer that contains the contents of a
|
||||
variable retrieved through the UEFI Runtime Service GetVariable(). The
|
||||
returned buffer is allocated using AllocatePool(). The caller is responsible
|
||||
@ -655,6 +658,8 @@ GetVariable (
|
||||
);
|
||||
|
||||
/**
|
||||
[ATTENTION] This function will be deprecated for security reason.
|
||||
|
||||
Returns a pointer to an allocated buffer that contains the contents of a
|
||||
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
||||
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
||||
@ -675,8 +680,65 @@ EFIAPI
|
||||
GetEfiGlobalVariable (
|
||||
IN CONST CHAR16 *Name
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
Returns the status whether get the variable success. The function retrieves
|
||||
variable through the UEFI Runtime Service GetVariable(). The
|
||||
returned buffer is allocated using AllocatePool(). The caller is responsible
|
||||
for freeing this buffer with FreePool().
|
||||
|
||||
If Name is NULL, then ASSERT().
|
||||
If Guid is NULL, then ASSERT().
|
||||
If Value is NULL, then ASSERT().
|
||||
|
||||
@param[in] Name The pointer to a Null-terminated Unicode string.
|
||||
@param[in] Guid The pointer to an EFI_GUID structure
|
||||
@param[out] Value The buffer point saved the variable info.
|
||||
@param[out] Size The buffer size of the variable.
|
||||
|
||||
@return EFI_OUT_OF_RESOURCES Allocate buffer failed.
|
||||
@return EFI_SUCCESS Find the specified variable.
|
||||
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GetVariable2 (
|
||||
IN CONST CHAR16 *Name,
|
||||
IN CONST EFI_GUID *Guid,
|
||||
OUT VOID **Value,
|
||||
OUT UINTN *Size OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Returns a pointer to an allocated buffer that contains the contents of a
|
||||
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
||||
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
||||
The returned buffer is allocated using AllocatePool(). The caller is
|
||||
responsible for freeing this buffer with FreePool().
|
||||
|
||||
If Name is NULL, then ASSERT().
|
||||
If Value is NULL, then ASSERT().
|
||||
|
||||
@param[in] Name The pointer to a Null-terminated Unicode string.
|
||||
@param[out] Value The buffer point saved the variable info.
|
||||
@param[out] Size The buffer size of the variable.
|
||||
|
||||
@return EFI_OUT_OF_RESOURCES Allocate buffer failed.
|
||||
@return EFI_SUCCESS Find the specified variable.
|
||||
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GetEfiGlobalVariable2 (
|
||||
IN CONST CHAR16 *Name,
|
||||
OUT VOID **Value,
|
||||
OUT UINTN *Size OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Returns a pointer to an allocated buffer that contains the best matching language
|
||||
from a set of supported languages.
|
||||
|
@ -5,7 +5,7 @@
|
||||
EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers,
|
||||
and print messages on the console output and standard error devices.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -1212,7 +1212,11 @@ FreeUnicodeStringTable (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
||||
/**
|
||||
[ATTENTION] This function will be deprecated for security reason.
|
||||
|
||||
Returns a pointer to an allocated buffer that contains the contents of a
|
||||
variable retrieved through the UEFI Runtime Service GetVariable(). The
|
||||
returned buffer is allocated using AllocatePool(). The caller is responsible
|
||||
@ -1273,8 +1277,9 @@ GetVariable (
|
||||
return Value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
[ATTENTION] This function will be deprecated for security reason.
|
||||
|
||||
Returns a pointer to an allocated buffer that contains the contents of a
|
||||
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
||||
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
||||
@ -1298,7 +1303,110 @@ GetEfiGlobalVariable (
|
||||
{
|
||||
return GetVariable (Name, &gEfiGlobalVariableGuid);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Returns the status whether get the variable success. The function retrieves
|
||||
variable through the UEFI Runtime Service GetVariable(). The
|
||||
returned buffer is allocated using AllocatePool(). The caller is responsible
|
||||
for freeing this buffer with FreePool().
|
||||
|
||||
If Name is NULL, then ASSERT().
|
||||
If Guid is NULL, then ASSERT().
|
||||
If Value is NULL, then ASSERT().
|
||||
|
||||
@param[in] Name The pointer to a Null-terminated Unicode string.
|
||||
@param[in] Guid The pointer to an EFI_GUID structure
|
||||
@param[out] Value The buffer point saved the variable info.
|
||||
@param[out] Size The buffer size of the variable.
|
||||
|
||||
@return EFI_OUT_OF_RESOURCES Allocate buffer failed.
|
||||
@return EFI_SUCCESS Find the specified variable.
|
||||
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GetVariable2 (
|
||||
IN CONST CHAR16 *Name,
|
||||
IN CONST EFI_GUID *Guid,
|
||||
OUT VOID **Value,
|
||||
OUT UINTN *Size OPTIONAL
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN BufferSize;
|
||||
|
||||
ASSERT (Name != NULL && Guid != NULL && Value != NULL);
|
||||
|
||||
//
|
||||
// Try to get the variable size.
|
||||
//
|
||||
BufferSize = 0;
|
||||
*Value = NULL;
|
||||
if (Size != NULL) {
|
||||
*Size = 0;
|
||||
}
|
||||
|
||||
Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value);
|
||||
if (Status != EFI_BUFFER_TOO_SMALL) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate buffer to get the variable.
|
||||
//
|
||||
*Value = AllocatePool (BufferSize);
|
||||
ASSERT (*Value != NULL);
|
||||
if (*Value == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// Get the variable data.
|
||||
//
|
||||
Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value);
|
||||
if (EFI_ERROR (Status)) {
|
||||
FreePool(*Value);
|
||||
*Value = NULL;
|
||||
}
|
||||
|
||||
if (Size != NULL) {
|
||||
*Size = BufferSize;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a pointer to an allocated buffer that contains the contents of a
|
||||
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
||||
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
||||
The returned buffer is allocated using AllocatePool(). The caller is
|
||||
responsible for freeing this buffer with FreePool().
|
||||
|
||||
If Name is NULL, then ASSERT().
|
||||
If Value is NULL, then ASSERT().
|
||||
|
||||
@param[in] Name The pointer to a Null-terminated Unicode string.
|
||||
@param[out] Value The buffer point saved the variable info.
|
||||
@param[out] Size The buffer size of the variable.
|
||||
|
||||
@return EFI_OUT_OF_RESOURCES Allocate buffer failed.
|
||||
@return EFI_SUCCESS Find the specified variable.
|
||||
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GetEfiGlobalVariable2 (
|
||||
IN CONST CHAR16 *Name,
|
||||
OUT VOID **Value,
|
||||
OUT UINTN *Size OPTIONAL
|
||||
)
|
||||
{
|
||||
return GetVariable2 (Name, &gEfiGlobalVariableGuid, Value, Size);
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a pointer to an allocated buffer that contains the best matching language
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Dhcp6 support functions implementation.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
@ -41,7 +41,7 @@ Dhcp6GenerateClientId (
|
||||
// Attempt to get client Id from variable to keep it constant.
|
||||
// See details in section-9 of rfc-3315.
|
||||
//
|
||||
Duid = GetVariable (L"ClientId", &gEfiDhcp6ServiceBindingProtocolGuid);
|
||||
GetVariable2 (L"ClientId", &gEfiDhcp6ServiceBindingProtocolGuid, &Duid, NULL);
|
||||
if (Duid != NULL) {
|
||||
return Duid;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Miscellaneous routines for iSCSI driver.
|
||||
|
||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -1076,10 +1076,12 @@ IScsiGetConfigData (
|
||||
(UINTN) AttemptConfigOrder[Index]
|
||||
);
|
||||
|
||||
AttemptConfigData = (ISCSI_ATTEMPT_CONFIG_NVDATA *) GetVariable (
|
||||
mPrivate->PortString,
|
||||
&gEfiIScsiInitiatorNameProtocolGuid
|
||||
);
|
||||
GetVariable2 (
|
||||
mPrivate->PortString,
|
||||
&gEfiIScsiInitiatorNameProtocolGuid,
|
||||
&AttemptConfigData,
|
||||
NULL
|
||||
);
|
||||
|
||||
if (AttemptConfigData == NULL) {
|
||||
continue;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -43,7 +43,7 @@ CurrentLanguageMatch (
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentLang = GetEfiGlobalVariable (L"PlatformLang");
|
||||
GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);
|
||||
DefaultLang = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);
|
||||
BestLanguage = GetBestLanguage (
|
||||
Languages,
|
||||
|
@ -270,7 +270,7 @@ GetNameFromHandle (
|
||||
//
|
||||
// Get the current platform language setting
|
||||
//
|
||||
PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");
|
||||
GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);
|
||||
Status = ComponentName2->GetDriverName (
|
||||
ComponentName2,
|
||||
PlatformLanguage != NULL ? PlatformLanguage : "en-US",
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implement defer image load services for user identification in UEFI2.2.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -532,7 +532,7 @@ IsBootOption (
|
||||
// Try to find the DevicePath in BootOption
|
||||
//
|
||||
UnicodeSPrint (StrTemp, sizeof (StrTemp), L"Boot%04x", Index);
|
||||
OptionBuffer = GetEfiGlobalVariable (StrTemp);
|
||||
GetEfiGlobalVariable2 (StrTemp, &OptionBuffer, NULL);
|
||||
if (OptionBuffer == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1065,7 +1065,7 @@ VerifyCertUefiGuid (
|
||||
//
|
||||
// Get KEK database variable.
|
||||
//
|
||||
KekList = GetEfiGlobalVariable (EFI_KEY_EXCHANGE_KEY_NAME);
|
||||
GetEfiGlobalVariable2 (EFI_KEY_EXCHANGE_KEY_NAME, &KekList, NULL);
|
||||
if (KekList == NULL) {
|
||||
return EFI_SECURITY_VIOLATION;
|
||||
}
|
||||
@ -1260,7 +1260,7 @@ DxeImageVerificationHandler (
|
||||
return EFI_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
SecureBootEnable = GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid);
|
||||
GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);
|
||||
//
|
||||
// Skip verification if SecureBootEnable variable doesn't exist.
|
||||
//
|
||||
@ -1278,7 +1278,7 @@ DxeImageVerificationHandler (
|
||||
|
||||
FreePool (SecureBootEnable);
|
||||
|
||||
SetupMode = GetEfiGlobalVariable (EFI_SETUP_MODE_NAME);
|
||||
GetEfiGlobalVariable2 (EFI_SETUP_MODE_NAME, &SetupMode, NULL);
|
||||
|
||||
//
|
||||
// SetupMode doesn't exist means no AuthVar driver is dispatched,
|
||||
@ -1544,7 +1544,7 @@ VariableWriteCallBack (
|
||||
// If this library is built-in, it means firmware has capability to perform
|
||||
// driver signing verification.
|
||||
//
|
||||
SecureBootModePtr = GetEfiGlobalVariable (EFI_SECURE_BOOT_MODE_NAME);
|
||||
GetEfiGlobalVariable2 (EFI_SECURE_BOOT_MODE_NAME, &SecureBootModePtr, NULL);
|
||||
if (SecureBootModePtr == NULL) {
|
||||
SecureBootMode = SECURE_BOOT_MODE_DISABLE;
|
||||
//
|
||||
|
@ -410,7 +410,7 @@ DisplayLoadPermit(
|
||||
// Get driver device path.
|
||||
//
|
||||
UnicodeSPrint (VarName, sizeof (VarName), L"Driver%04x", Order[Index]);
|
||||
Var = GetEfiGlobalVariable (VarName);
|
||||
GetEfiGlobalVariable2 (VarName, &Var, NULL);
|
||||
if (Var == NULL) {
|
||||
continue;
|
||||
}
|
||||
@ -655,7 +655,7 @@ AddToForbidLoad (
|
||||
// Get loadable driver device path.
|
||||
//
|
||||
UnicodeSPrint (VarName, sizeof (VarName), L"Driver%04x", DriverIndex);
|
||||
Var = GetEfiGlobalVariable (VarName);
|
||||
GetEfiGlobalVariable2 (VarName, &Var, NULL);
|
||||
if (Var == NULL) {
|
||||
return;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ DeleteVariable (
|
||||
UINTN DataSize;
|
||||
UINT32 Attr;
|
||||
|
||||
Variable = GetVariable (VariableName, VendorGuid);
|
||||
GetVariable2 (VariableName, VendorGuid, &Variable, NULL);
|
||||
if (Variable == NULL) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@ -2064,7 +2064,7 @@ SecureBootExtractConfigFromVariable (
|
||||
//
|
||||
// Get the SecureBootEnable Variable
|
||||
//
|
||||
SecureBootEnable = GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid);
|
||||
GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);
|
||||
|
||||
//
|
||||
// If the SecureBootEnable Variable doesn't exist, hide the SecureBoot Enable/Disable
|
||||
@ -2088,7 +2088,7 @@ SecureBootExtractConfigFromVariable (
|
||||
//
|
||||
// If there is no PK then the Delete Pk button will be gray.
|
||||
//
|
||||
SetupMode = GetVariable (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid);
|
||||
GetVariable2 (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid, &SetupMode, NULL);
|
||||
if (SetupMode == NULL || (*SetupMode) == 1) {
|
||||
ConfigData->HasPk = FALSE;
|
||||
} else {
|
||||
@ -2098,7 +2098,7 @@ SecureBootExtractConfigFromVariable (
|
||||
//
|
||||
// Get the SecureBootMode from CustomMode variable.
|
||||
//
|
||||
SecureBootMode = GetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid);
|
||||
GetVariable2 (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &SecureBootMode, NULL);
|
||||
if (SecureBootMode == NULL) {
|
||||
ConfigData->SecureBootMode = STANDARD_SECURE_BOOT_MODE;
|
||||
} else {
|
||||
@ -2298,6 +2298,9 @@ SecureBootCallback (
|
||||
UINTN BufferSize;
|
||||
SECUREBOOT_CONFIGURATION *IfrNvData;
|
||||
UINT16 LabelId;
|
||||
UINT8 *SecureBootEnable;
|
||||
|
||||
SecureBootEnable = NULL;
|
||||
|
||||
if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@ -2326,7 +2329,8 @@ SecureBootCallback (
|
||||
|
||||
switch (QuestionId) {
|
||||
case KEY_SECURE_BOOT_ENABLE:
|
||||
if (NULL != GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid)) {
|
||||
GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);
|
||||
if (NULL != SecureBootEnable) {
|
||||
if (EFI_ERROR (SaveSecureBootVariable (Value->u8))) {
|
||||
CreatePopUp (
|
||||
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
||||
@ -2513,7 +2517,8 @@ SecureBootCallback (
|
||||
break;
|
||||
|
||||
case KEY_SECURE_BOOT_MODE:
|
||||
if (NULL != GetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid)) {
|
||||
GetVariable2 (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &SecureBootEnable, NULL);
|
||||
if (NULL != SecureBootEnable) {
|
||||
Status = gRT->SetVariable (
|
||||
EFI_CUSTOM_MODE_NAME,
|
||||
&gEfiCustomModeEnableGuid,
|
||||
|
@ -2,7 +2,7 @@
|
||||
This driver parses the mSmbiosMiscDataTable structure and reports
|
||||
any generated data.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -45,7 +45,7 @@ CurrentLanguageMatch (
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentLang = GetEfiGlobalVariable (L"PlatformLang");
|
||||
GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);
|
||||
DefaultLang = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);
|
||||
BestLanguage = GetBestLanguage (
|
||||
Languages,
|
||||
|
Loading…
x
Reference in New Issue
Block a user