]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix that the variable can't be stored. Next, I will update GetBrowserData API.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 22 Apr 2009 03:19:42 +0000 (03:19 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 22 Apr 2009 03:19:42 +0000 (03:19 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8147 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c

index 982db88dbf5d17fdd7c5e3c735736d8869720c7a..1e8e59305910524b19242d853dd441b84e761175 100644 (file)
@@ -272,8 +272,16 @@ BootMaintCallback (
   // Retrive uncommitted data from Form Browser\r
   //\r
   CurrentFakeNVMap = (BMM_FAKE_NV_DATA *) HiiGetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA));\r
-  if (CurrentFakeNVMap == NULL) {\r
-    return EFI_NOT_FOUND;\r
+  DisMap = (UINT8 *) CurrentFakeNVMap;\r
+  for (Index = 0; Index < sizeof (BMM_FAKE_NV_DATA); Index ++) {\r
+    if (DisMap [Index] != 0) {\r
+      break;\r
+    }\r
+  }\r
+  \r
+  if (Index == sizeof (BMM_FAKE_NV_DATA)) {\r
+    FreePool (CurrentFakeNVMap);\r
+    CurrentFakeNVMap = &Private->BmmFakeNvData;\r
   }\r
 \r
   //\r
@@ -590,7 +598,7 @@ BootMaintCallback (
   //\r
   // Update local settting.\r
   //\r
-  if (CurrentFakeNVMap != NULL) {\r
+  if (CurrentFakeNVMap != &Private->BmmFakeNvData) {\r
     CopyMem (&Private->BmmFakeNvData, CurrentFakeNVMap, sizeof (BMM_FAKE_NV_DATA));\r
     FreePool (CurrentFakeNVMap);\r
   }\r