Revision: 18681
          http://sourceforge.net/p/edk2/code/18681
Author:   ydong10
Date:     2015-10-27 07:37:56 +0000 (Tue, 27 Oct 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.

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

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

Modified: trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c   2015-10-27 
04:46:50 UTC (rev 18680)
+++ trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c   2015-10-27 
07:37:56 UTC (rev 18681)
@@ -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: trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h   2015-10-27 
04:46:50 UTC (rev 18680)
+++ trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h   2015-10-27 
07:37:56 UTC (rev 18681)
@@ -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)


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to