]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
MdeModulePkg/SetupBrowserDxe:Follow spec'd way to reconnect driver
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.c
index fe0d46d93ff201b6780eaabb97b0e59e0042750c..5158baf5bd55e9cd9c87c7c7744aed4aee012e3f 100644 (file)
@@ -2,7 +2,7 @@
 Entry and initialization module for the browser.\r
 \r
 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
+(C) Copyright 2020 - 2022 Hewlett Packard Enterprise Development LP<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -68,7 +68,6 @@ extern EFI_GUID                  mCurrentFormSetGuid;
 extern EFI_HII_HANDLE            mCurrentHiiHandle;\r
 extern UINT16                    mCurrentFormId;\r
 extern FORM_DISPLAY_ENGINE_FORM  gDisplayFormData;\r
-extern BOOLEAN                   mDynamicFormUpdated;\r
 \r
 /**\r
   Create a menu with specified formset GUID and form ID, and add it as a child\r
@@ -539,7 +538,6 @@ SendForm (
 \r
       Selection->FormSet  = FormSet;\r
       mSystemLevelFormSet = FormSet;\r
-      mDynamicFormUpdated = FALSE;\r
 \r
       //\r
       // Display this formset\r
@@ -552,10 +550,9 @@ SendForm (
       mSystemLevelFormSet = NULL;\r
 \r
       //\r
-      // If callback update form dynamically, it's not exiting of the formset for user so system do not reconnect driver hanlde\r
-      // this time.\r
+      // Check incoming formset whether is same with previous. If yes, that means action is not exiting of formset so do not reconnect controller.\r
       //\r
-      if (!mDynamicFormUpdated && (gFlagReconnect || gCallbackReconnect)) {\r
+      if ((gFlagReconnect || gCallbackReconnect) && !CompareGuid (&FormSet->Guid, &Selection->FormSetGuid)) {\r
         RetVal = ReconnectController (FormSet->DriverHandle);\r
         if (!RetVal) {\r
           PopupErrorMessage (BROWSER_RECONNECT_FAIL, NULL, NULL, NULL);\r