Revision: 14992
          http://sourceforge.net/p/edk2/code/14992
Author:   ydong10
Date:     2013-12-17 05:00:17 +0000 (Tue, 17 Dec 2013)
Log Message:
-----------
Get entire variable data for efi varstore at first time.

Signed-off-by: Eric Dong <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c

Modified: trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c   2013-12-17 
05:00:10 UTC (rev 14991)
+++ trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c   2013-12-17 
05:00:17 UTC (rev 14992)
@@ -4085,7 +4085,11 @@
   EFI_STRING  Progress;
   EFI_STRING  Result;
   CHAR16      *StrPtr;
+  EFI_STRING  ConfigRequest;
+  UINTN       StrLen;
 
+  ConfigRequest = NULL;
+
   switch (Storage->BrowserStorage->Type) {
     case EFI_HII_VARSTORE_EFI_VARIABLE:
       return;
@@ -4095,6 +4099,21 @@
         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:
@@ -4106,6 +4125,7 @@
         return;
       }
       Storage->BrowserStorage->Initialized = TRUE;
+      ConfigRequest = Storage->ConfigRequest;
       break;
 
     default:
@@ -4117,7 +4137,7 @@
   //
   Status = mHiiConfigRouting->ExtractConfig (
                                     mHiiConfigRouting,
-                                    Storage->ConfigRequest,
+                                    ConfigRequest,
                                     &Progress,
                                     &Result
                                     );
@@ -4146,6 +4166,12 @@
   // Input NULL for ConfigRequest field means sync all fields from editbuffer 
to buffer. 
   //
   SynchronizeStorage(FormSet, Storage->BrowserStorage, NULL, TRUE);
+
+  if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
+    if (ConfigRequest != NULL) {
+      FreePool (ConfigRequest);
+    }
+  }
 }
 
 /**

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to