]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg SetupBrowserDxe: Save global variable values before nest function called.
authorEric Dong <eric.dong@intel.com>
Tue, 27 Oct 2015 07:37:56 +0000 (07:37 +0000)
committerydong10 <ydong10@Edk2>
Tue, 27 Oct 2015 07:37:56 +0000 (07:37 +0000)
The SendForm function can be called nest in it. This function also uses some global variables. So we must save global variable values before it been called again.

Checked in the missing change for gBrowserFormSetList.

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@18681 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h

index 4a6758a5e489a3e87df1336f4a6f5ace3e46f594..cc9896959b6a8e0c17daad04d380b1d4d12a24ec 100644 (file)
@@ -5541,8 +5541,9 @@ SaveBrowserContext (
   VOID\r
   )\r
 {\r
-  BROWSER_CONTEXT  *Context;\r
-  FORM_ENTRY_INFO     *MenuList;\r
+  BROWSER_CONTEXT      *Context;\r
+  FORM_ENTRY_INFO      *MenuList;\r
+  FORM_BROWSER_FORMSET *FormSet;\r
 \r
   gBrowserContextCount++;\r
   if (gBrowserContextCount == 1) {\r
@@ -5584,6 +5585,17 @@ SaveBrowserContext (
     InsertTailList(&Context->FormHistoryList, &MenuList->Link);\r
   }\r
 \r
+  //\r
+  // Save formset list.\r
+  //\r
+  InitializeListHead(&Context->FormSetList);\r
+  while (!IsListEmpty (&gBrowserFormSetList)) {\r
+    FormSet = FORM_BROWSER_FORMSET_FROM_LINK (gBrowserFormSetList.ForwardLink);\r
+    RemoveEntryList (&FormSet->Link);\r
+\r
+    InsertTailList(&Context->FormSetList, &FormSet->Link);\r
+  }\r
+\r
   //\r
   // Insert to FormBrowser context list\r
   //\r
@@ -5602,7 +5614,8 @@ RestoreBrowserContext (
 {\r
   LIST_ENTRY       *Link;\r
   BROWSER_CONTEXT  *Context;\r
-  FORM_ENTRY_INFO     *MenuList;\r
+  FORM_ENTRY_INFO      *MenuList;\r
+  FORM_BROWSER_FORMSET *FormSet;\r
 \r
   ASSERT (gBrowserContextCount != 0);\r
   gBrowserContextCount--;\r
@@ -5644,6 +5657,16 @@ RestoreBrowserContext (
     InsertTailList(&mPrivateData.FormBrowserEx2.FormViewHistoryHead, &MenuList->Link);\r
   }\r
 \r
+  //\r
+  // Restore the Formset data.\r
+  //\r
+  while (!IsListEmpty (&Context->FormSetList)) {\r
+    FormSet = FORM_BROWSER_FORMSET_FROM_LINK (Context->FormSetList.ForwardLink);\r
+    RemoveEntryList (&FormSet->Link);\r
+\r
+    InsertTailList(&gBrowserFormSetList, &FormSet->Link);\r
+  }\r
+\r
   //\r
   // Remove from FormBrowser context list\r
   //\r
index 81e2a62df1981923764a4e441a9ce66b0dfbedbb..0abb09cf87b57419ef615e1b5af50d865e5b2060 100644 (file)
@@ -542,7 +542,8 @@ typedef struct {
   EFI_QUESTION_ID          CurFakeQestId;\r
   BOOLEAN                  HiiPackageListUpdated;\r
   BOOLEAN                  FinishRetrieveCall;\r
-  LIST_ENTRY           FormHistoryList;\r
+  LIST_ENTRY               FormHistoryList;\r
+  LIST_ENTRY               FormSetList;\r
 } BROWSER_CONTEXT;\r
 \r
 #define BROWSER_CONTEXT_FROM_LINK(a)  CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)\r