From b6f61255260a2e7c06ade9e3d4edb1e8e178f71f Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Tue, 27 Oct 2015 07:37:56 +0000 Subject: 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 Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18681 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 29 +++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Setup.c') diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 4a6758a5e4..cc9896959b 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -5541,8 +5541,9 @@ SaveBrowserContext ( VOID ) { - BROWSER_CONTEXT *Context; - FORM_ENTRY_INFO *MenuList; + BROWSER_CONTEXT *Context; + FORM_ENTRY_INFO *MenuList; + FORM_BROWSER_FORMSET *FormSet; gBrowserContextCount++; if (gBrowserContextCount == 1) { @@ -5584,6 +5585,17 @@ SaveBrowserContext ( InsertTailList(&Context->FormHistoryList, &MenuList->Link); } + // + // 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 // @@ -5602,7 +5614,8 @@ RestoreBrowserContext ( { LIST_ENTRY *Link; BROWSER_CONTEXT *Context; - FORM_ENTRY_INFO *MenuList; + FORM_ENTRY_INFO *MenuList; + FORM_BROWSER_FORMSET *FormSet; ASSERT (gBrowserContextCount != 0); gBrowserContextCount--; @@ -5644,6 +5657,16 @@ RestoreBrowserContext ( InsertTailList(&mPrivateData.FormBrowserEx2.FormViewHistoryHead, &MenuList->Link); } + // + // 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 // -- cgit v1.2.3