Reviewed-by: Liming Gao <liming....@intel.com>

-----Original Message-----
From: Dong, Eric 
Sent: Friday, October 16, 2015 9:34 AM
To: edk2-devel@lists.01.org
Cc: Gao, Liming; Bi, Dandan
Subject: [Patch] MdeModulePkg SetupBrowserDxe: Save global variable values 
before nest function called.

The SendForm function can be called again before this function exist. This 
function also uses some global variables. So we must save global variable 
values before the function been called again. Old implementation miss to save 
some global variable, this patch fixed it.

Cc: Liming Gao <liming....@intel.com>
Cc: Dandan Bi <dandan...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.d...@intel.com>
---
 MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 8 ++++++++  
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 8 +++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c 
b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index 43cfc87..4a6758a 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -5566,10 +5566,14 @@ SaveBrowserContext (
   Context->CallbackReconnect    = gCallbackReconnect;
   Context->ExitRequired         = gExitRequired;
   Context->HiiHandle            = mCurrentHiiHandle;
   Context->FormId               = mCurrentFormId;
   CopyGuid (&Context->FormSetGuid, &mCurrentFormSetGuid);
+  Context->SystemLevelFormSet   = mSystemLevelFormSet;
+  Context->CurFakeQestId        = mCurFakeQestId;
+  Context->HiiPackageListUpdated = mHiiPackageListUpdated;
+  Context->FinishRetrieveCall   = mFinishRetrieveCall;
 
   //
   // Save the menu history data.
   //
   InitializeListHead(&Context->FormHistoryList);
@@ -5623,10 +5627,14 @@ RestoreBrowserContext (
   gCallbackReconnect    = Context->CallbackReconnect;
   gExitRequired         = Context->ExitRequired;
   mCurrentHiiHandle     = Context->HiiHandle;
   mCurrentFormId        = Context->FormId;
   CopyGuid (&mCurrentFormSetGuid, &Context->FormSetGuid);
+  mSystemLevelFormSet   = Context->SystemLevelFormSet;
+  mCurFakeQestId        = Context->CurFakeQestId;
+  mHiiPackageListUpdated = Context->HiiPackageListUpdated;
+  mFinishRetrieveCall   = Context->FinishRetrieveCall;
 
   //
   // Restore the menu history data.
   //
   while (!IsListEmpty (&Context->FormHistoryList)) { diff --git 
a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h 
b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index 61e706a..81e2a62 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -536,11 +536,14 @@ typedef struct {
   BOOLEAN                  ExitRequired;
   EFI_HII_HANDLE           HiiHandle;
   EFI_GUID                 FormSetGuid;
   EFI_FORM_ID              FormId;
   UI_MENU_SELECTION        *Selection;
-
+  FORM_BROWSER_FORMSET     *SystemLevelFormSet;
+  EFI_QUESTION_ID          CurFakeQestId;
+  BOOLEAN                  HiiPackageListUpdated;
+  BOOLEAN                  FinishRetrieveCall;
   LIST_ENTRY           FormHistoryList;
 } BROWSER_CONTEXT;
 
 #define BROWSER_CONTEXT_FROM_LINK(a)  CR (a, BROWSER_CONTEXT, Link, 
BROWSER_CONTEXT_SIGNATURE)
 
@@ -584,10 +587,13 @@ extern SETUP_DRIVER_PRIVATE_DATA mPrivateData;  // 
Browser Global Strings  //
 extern CHAR16            *gEmptyString;
 
 extern UI_MENU_SELECTION  *gCurrentSelection;
+extern BOOLEAN            mHiiPackageListUpdated;
+extern UINT16             mCurFakeQestId;
+extern BOOLEAN            mFinishRetrieveCall;
 
 //
 // Global Procedure Defines
 //
 #include "Expression.h"
--
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to