Revision: 18812
          http://sourceforge.net/p/edk2/code/18812
Author:   vanjeff
Date:     2015-11-16 08:11:47 +0000 (Mon, 16 Nov 2015)
Log Message:
-----------
MdeModulePkg SetupBrowserDxe: Save global variable values before nest function 
called.

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.

(Sync patch r18681 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18681

Modified Paths:
--------------
    branches/UDK2015/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
    branches/UDK2015/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h

Modified: branches/UDK2015/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
===================================================================
--- branches/UDK2015/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c     
2015-11-16 08:10:46 UTC (rev 18811)
+++ branches/UDK2015/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c     
2015-11-16 08:11:47 UTC (rev 18812)
@@ -5541,8 +5541,9 @@
   VOID
   )
 {
-  BROWSER_CONTEXT  *Context;
-  FORM_ENTRY_INFO     *MenuList;
+  BROWSER_CONTEXT      *Context;
+  FORM_ENTRY_INFO      *MenuList;
+  FORM_BROWSER_FORMSET *FormSet;
 
   gBrowserContextCount++;
   if (gBrowserContextCount == 1) {
@@ -5585,6 +5586,17 @@
   }
 
   //
+  // Save formset list.
+  //
+  InitializeListHead(&Context->FormSetList);
+  while (!IsListEmpty (&gBrowserFormSetList)) {
+    FormSet = FORM_BROWSER_FORMSET_FROM_LINK (gBrowserFormSetList.ForwardLink);
+    RemoveEntryList (&FormSet->Link);
+
+    InsertTailList(&Context->FormSetList, &FormSet->Link);
+  }
+
+  //
   // Insert to FormBrowser context list
   //
   InsertHeadList (&gBrowserContextList, &Context->Link);
@@ -5602,7 +5614,8 @@
 {
   LIST_ENTRY       *Link;
   BROWSER_CONTEXT  *Context;
-  FORM_ENTRY_INFO     *MenuList;
+  FORM_ENTRY_INFO      *MenuList;
+  FORM_BROWSER_FORMSET *FormSet;
 
   ASSERT (gBrowserContextCount != 0);
   gBrowserContextCount--;
@@ -5645,6 +5658,16 @@
   }
 
   //
+  // Restore the Formset data.
+  //
+  while (!IsListEmpty (&Context->FormSetList)) {
+    FormSet = FORM_BROWSER_FORMSET_FROM_LINK 
(Context->FormSetList.ForwardLink);
+    RemoveEntryList (&FormSet->Link);
+
+    InsertTailList(&gBrowserFormSetList, &FormSet->Link);
+  }
+
+  //
   // Remove from FormBrowser context list
   //
   RemoveEntryList (&Context->Link);

Modified: branches/UDK2015/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
===================================================================
--- branches/UDK2015/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h     
2015-11-16 08:10:46 UTC (rev 18811)
+++ branches/UDK2015/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h     
2015-11-16 08:11:47 UTC (rev 18812)
@@ -542,7 +542,8 @@
   EFI_QUESTION_ID          CurFakeQestId;
   BOOLEAN                  HiiPackageListUpdated;
   BOOLEAN                  FinishRetrieveCall;
-  LIST_ENTRY           FormHistoryList;
+  LIST_ENTRY               FormHistoryList;
+  LIST_ENTRY               FormSetList;
 } BROWSER_CONTEXT;
 
 #define BROWSER_CONTEXT_FROM_LINK(a)  CR (a, BROWSER_CONTEXT, Link, 
BROWSER_CONTEXT_SIGNATURE)


------------------------------------------------------------------------------
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a 
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to