diff options
author | Eric Dong <eric.dong@intel.com> | 2014-02-18 10:53:57 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-02-18 10:53:57 +0000 |
commit | 27c304f442538e3aeb1bcc5a6e52194a577dcde0 (patch) | |
tree | 6c1332a4d30b7a17e1a5a8fc28fc87c363a753a5 /MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | |
parent | a6c0ad816ac8f26d1af38f1a2c2ea538a852cb5b (diff) | |
download | edk2-27c304f442538e3aeb1bcc5a6e52194a577dcde0.zip edk2-27c304f442538e3aeb1bcc5a6e52194a577dcde0.tar.gz edk2-27c304f442538e3aeb1bcc5a6e52194a577dcde0.tar.bz2 |
Update configrequest string at runtime for dynamic created question.
Contributed-under: TianoCore Contribution Agreement 1.0
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@15247 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Setup.c')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index d1c6961..5ce0b84 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -417,7 +417,7 @@ SendForm ( //
// If no data is changed, don't need to save current FormSet into the maintain list.
//
- if (!IsNvUpdateRequiredForFormSet (FormSet) && !IsStorageDataChangedForFormSet(FormSet)) {
+ if (!IsNvUpdateRequiredForFormSet (FormSet)) {
CleanBrowserStorage(FormSet);
RemoveEntryList (&FormSet->Link);
DestroyFormSet (FormSet);
@@ -4081,39 +4081,51 @@ LoadStorage ( ConfigRequestAdjust(Storage);
return;
}
-
- //
- // Create the config request string to get all fields for this storage.
- // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
- // followed by "&OFFSET=0&WIDTH=WWWW"followed by a Null-terminator
- //
- StrLen = StrSize (Storage->BrowserStorage->ConfigHdr) + 20 * sizeof (CHAR16);
- ConfigRequest = AllocateZeroPool (StrLen);
- ASSERT (ConfigRequest != NULL);
- UnicodeSPrint (
- ConfigRequest,
- StrLen,
- L"%s&OFFSET=0&WIDTH=%04x",
- Storage->BrowserStorage->ConfigHdr,
- Storage->BrowserStorage->Size);
break;
case EFI_HII_VARSTORE_BUFFER:
case EFI_HII_VARSTORE_NAME_VALUE:
//
- // Skip if there is no RequestElement or data has initilized.
+ // Skip if there is no RequestElement.
//
- if (Storage->ElementCount == 0 || Storage->BrowserStorage->Initialized) {
+ if (Storage->ElementCount == 0) {
return;
}
+
+ //
+ // Just update the ConfigRequest, if storage already initialized.
+ //
+ if (Storage->BrowserStorage->Initialized) {
+ ConfigRequestAdjust(Storage);
+ return;
+ }
+
Storage->BrowserStorage->Initialized = TRUE;
- ConfigRequest = Storage->ConfigRequest;
break;
default:
return;
}
+ if (Storage->BrowserStorage->Type != EFI_HII_VARSTORE_NAME_VALUE) {
+ //
+ // Create the config request string to get all fields for this storage.
+ // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
+ // followed by "&OFFSET=0&WIDTH=WWWW"followed by a Null-terminator
+ //
+ StrLen = StrSize (Storage->BrowserStorage->ConfigHdr) + 20 * sizeof (CHAR16);
+ ConfigRequest = AllocateZeroPool (StrLen);
+ ASSERT (ConfigRequest != NULL);
+ UnicodeSPrint (
+ ConfigRequest,
+ StrLen,
+ L"%s&OFFSET=0&WIDTH=%04x",
+ Storage->BrowserStorage->ConfigHdr,
+ Storage->BrowserStorage->Size);
+ } else {
+ ConfigRequest = Storage->ConfigRequest;
+ }
+
//
// Request current settings from Configuration Driver
//
@@ -4149,7 +4161,7 @@ LoadStorage ( //
SynchronizeStorage(FormSet, Storage->BrowserStorage, NULL, TRUE);
- if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
+ if (Storage->BrowserStorage->Type != EFI_HII_VARSTORE_NAME_VALUE) {
if (ConfigRequest != NULL) {
FreePool (ConfigRequest);
}
|