summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2013-07-02 07:53:35 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2013-07-02 07:53:35 +0000
commit82e8c1380fe8d9d94b7585242f1e159bdbbeb778 (patch)
treea870a96103ef2fb7647b6180d905233b1f3072c5 /MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
parent3aee9940c98cff4814c1ec9bddbcfd8528211c58 (diff)
downloadedk2-platforms-82e8c1380fe8d9d94b7585242f1e159bdbbeb778.tar.xz
Update HiiDataBase and UefiHiiLib to support Name/Value varstore.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14451 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c')
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index 3ae55de2b0..cb2cbe7932 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -1794,6 +1794,7 @@ DriverSampleInit (
DRIVER_SAMPLE_CONFIGURATION *Configuration;
BOOLEAN ActionFlag;
EFI_STRING ConfigRequestHdr;
+ EFI_STRING NameRequestHdr;
MY_EFI_VARSTORE_DATA *VarStoreConfig;
EFI_INPUT_KEY HotKey;
EFI_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx;
@@ -1973,6 +1974,9 @@ DriverSampleInit (
ConfigRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, VariableName, DriverHandle[0]);
ASSERT (ConfigRequestHdr != NULL);
+ NameRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, NULL, DriverHandle[0]);
+ ASSERT (NameRequestHdr != NULL);
+
BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
Status = gRT->GetVariable (VariableName, &gDriverSampleFormSetGuid, NULL, &BufferSize, Configuration);
if (EFI_ERROR (Status)) {
@@ -1991,12 +1995,18 @@ DriverSampleInit (
// EFI variable for NV config doesn't exit, we should build this variable
// based on default values stored in IFR
//
+ ActionFlag = HiiSetToDefaults (NameRequestHdr, EFI_HII_DEFAULT_CLASS_STANDARD);
+ ASSERT (ActionFlag);
+
ActionFlag = HiiSetToDefaults (ConfigRequestHdr, EFI_HII_DEFAULT_CLASS_STANDARD);
ASSERT (ActionFlag);
} else {
//
// EFI variable does exist and Validate Current Setting
//
+ ActionFlag = HiiValidateSettings (NameRequestHdr);
+ ASSERT (ActionFlag);
+
ActionFlag = HiiValidateSettings (ConfigRequestHdr);
ASSERT (ActionFlag);
}