[edk2-devel] [PATCH] MdeModulePkg/Setup: Check ConfigAccess protocol in case it's destroyed

GregX Yeh posted 1 patch 1 week ago
Failed in applying to current master (apply log)
.../Universal/SetupBrowserDxe/Presentation.c       | 34 ++++++++++++++++++++++
1 file changed, 34 insertions(+)

[edk2-devel] [PATCH] MdeModulePkg/Setup: Check ConfigAccess protocol in case it's destroyed

Posted by GregX Yeh 1 week ago
https://bugzilla.tianocore.org/show_bug.cgi?id=1920
Check ConfigAccess protocol is available before process user input.

Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
---
 .../Universal/SetupBrowserDxe/Presentation.c       | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index d7927725b2..7c36a6f2b7 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -20,6 +20,38 @@ UINT16             mCurFakeQestId;
 FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
 BOOLEAN            mFinishRetrieveCall = FALSE;
 
+/**
+  Check whether the ConfigAccess protocol is available
+
+  @parm FormSet           FormSet of which the ConfigAcces protocol need to be checked.
+
+  @retval EFI_SUCCESS     The function executed successfully.
+
+**/
+EFI_STATUS
+CheckConfigAccess(
+  IN FORM_BROWSER_FORMSET  *FormSet
+  )
+{
+  EFI_STATUS                      Status;
+
+  Status = gBS->HandleProtocol (
+                  FormSet->DriverHandle,
+                  &gEfiHiiConfigAccessProtocolGuid,
+                  (VOID **) &FormSet->ConfigAccess
+                  );
+  if (EFI_ERROR (Status)) {
+    //
+    // Configuration Driver don't attach ConfigAccess protocol to its HII package
+    // list, then there will be no configuration action required.
+    // Or the ConfigAccess protocol has been uninstalled.
+    //
+    FormSet->ConfigAccess = NULL;
+  }
+
+  return EFI_SUCCESS;
+}
+
 /**
   Evaluate all expressions in a Form.
 
@@ -1686,6 +1718,8 @@ DisplayForm (
     return Status;
   }
 
+  CheckConfigAccess(gCurrentSelection->FormSet);
+
   Status = ProcessUserInput (&UserInput);
   FreeDisplayFormData();
   return Status;
-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43417): https://edk2.groups.io/g/devel/message/43417
Mute This Topic: https://groups.io/mt/32402217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH] MdeModulePkg/Setup: Check ConfigAccess protocol in case it's destroyed

Posted by Dandan Bi 1 week ago
Reviewed-by: Dandan Bi <dandan.bi@intel.com>

Thanks,
Dandan

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> GregX Yeh
> Sent: Tuesday, July 9, 2019 11:47 AM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan <dandan.bi@intel.com>; Ni, Ray <ray.ni@intel.com>; Kuo, Ted
> <ted.kuo@intel.com>
> Subject: [edk2-devel] [PATCH] MdeModulePkg/Setup: Check ConfigAccess
> protocol in case it's destroyed
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1920
> Check ConfigAccess protocol is available before process user input.
> 
> Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Ted Kuo <ted.kuo@intel.com>
> ---
>  .../Universal/SetupBrowserDxe/Presentation.c       | 34
> ++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
> b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
> index d7927725b2..7c36a6f2b7 100644
> --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
> +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
> @@ -20,6 +20,38 @@ UINT16             mCurFakeQestId;
>  FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
>  BOOLEAN            mFinishRetrieveCall = FALSE;
> 
> +/**
> +  Check whether the ConfigAccess protocol is available
> +
> +  @parm FormSet           FormSet of which the ConfigAcces protocol need to
> be checked.
> +
> +  @retval EFI_SUCCESS     The function executed successfully.
> +
> +**/
> +EFI_STATUS
> +CheckConfigAccess(
> +  IN FORM_BROWSER_FORMSET  *FormSet
> +  )
> +{
> +  EFI_STATUS                      Status;
> +
> +  Status = gBS->HandleProtocol (
> +                  FormSet->DriverHandle,
> +                  &gEfiHiiConfigAccessProtocolGuid,
> +                  (VOID **) &FormSet->ConfigAccess
> +                  );
> +  if (EFI_ERROR (Status)) {
> +    //
> +    // Configuration Driver don't attach ConfigAccess protocol to its HII
> package
> +    // list, then there will be no configuration action required.
> +    // Or the ConfigAccess protocol has been uninstalled.
> +    //
> +    FormSet->ConfigAccess = NULL;
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
>  /**
>    Evaluate all expressions in a Form.
> 
> @@ -1686,6 +1718,8 @@ DisplayForm (
>      return Status;
>    }
> 
> +  CheckConfigAccess(gCurrentSelection->FormSet);
> +
>    Status = ProcessUserInput (&UserInput);
>    FreeDisplayFormData();
>    return Status;
> --
> 2.16.2.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43449): https://edk2.groups.io/g/devel/message/43449
Mute This Topic: https://groups.io/mt/32402217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH] MdeModulePkg/Setup: Check ConfigAccess protocol in case it's destroyed

Posted by Wang, Jian J 1 week ago
Patch was pushed at 034a3b4f555c6844673a5ee6b7aa4faa74e90a6e

Regards,
Jian


> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Dandan Bi
> Sent: Wednesday, July 10, 2019 8:42 AM
> To: devel@edk2.groups.io; Yeh, GregX <gregx.yeh@intel.com>
> Cc: Ni, Ray <ray.ni@intel.com>; Kuo, Ted <ted.kuo@intel.com>
> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/Setup: Check
> ConfigAccess protocol in case it's destroyed
> 
> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
> 
> Thanks,
> Dandan
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > GregX Yeh
> > Sent: Tuesday, July 9, 2019 11:47 AM
> > To: devel@edk2.groups.io
> > Cc: Bi, Dandan <dandan.bi@intel.com>; Ni, Ray <ray.ni@intel.com>; Kuo,
> Ted
> > <ted.kuo@intel.com>
> > Subject: [edk2-devel] [PATCH] MdeModulePkg/Setup: Check ConfigAccess
> > protocol in case it's destroyed
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1920
> > Check ConfigAccess protocol is available before process user input.
> >
> > Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
> > Cc: Dandan Bi <dandan.bi@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Ted Kuo <ted.kuo@intel.com>
> > ---
> >  .../Universal/SetupBrowserDxe/Presentation.c       | 34
> > ++++++++++++++++++++++
> >  1 file changed, 34 insertions(+)
> >
> > diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
> > b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
> > index d7927725b2..7c36a6f2b7 100644
> > --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
> > +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
> > @@ -20,6 +20,38 @@ UINT16             mCurFakeQestId;
> >  FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
> >  BOOLEAN            mFinishRetrieveCall = FALSE;
> >
> > +/**
> > +  Check whether the ConfigAccess protocol is available
> > +
> > +  @parm FormSet           FormSet of which the ConfigAcces protocol need
> to
> > be checked.
> > +
> > +  @retval EFI_SUCCESS     The function executed successfully.
> > +
> > +**/
> > +EFI_STATUS
> > +CheckConfigAccess(
> > +  IN FORM_BROWSER_FORMSET  *FormSet
> > +  )
> > +{
> > +  EFI_STATUS                      Status;
> > +
> > +  Status = gBS->HandleProtocol (
> > +                  FormSet->DriverHandle,
> > +                  &gEfiHiiConfigAccessProtocolGuid,
> > +                  (VOID **) &FormSet->ConfigAccess
> > +                  );
> > +  if (EFI_ERROR (Status)) {
> > +    //
> > +    // Configuration Driver don't attach ConfigAccess protocol to its HII
> > package
> > +    // list, then there will be no configuration action required.
> > +    // Or the ConfigAccess protocol has been uninstalled.
> > +    //
> > +    FormSet->ConfigAccess = NULL;
> > +  }
> > +
> > +  return EFI_SUCCESS;
> > +}
> > +
> >  /**
> >    Evaluate all expressions in a Form.
> >
> > @@ -1686,6 +1718,8 @@ DisplayForm (
> >      return Status;
> >    }
> >
> > +  CheckConfigAccess(gCurrentSelection->FormSet);
> > +
> >    Status = ProcessUserInput (&UserInput);
> >    FreeDisplayFormData();
> >    return Status;
> > --
> > 2.16.2.windows.1
> >
> >
> >
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43452): https://edk2.groups.io/g/devel/message/43452
Mute This Topic: https://groups.io/mt/32402217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-