mirror of https://github.com/acidanthera/audk.git
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> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
This commit is contained in:
parent
688ec2d006
commit
034a3b4f55
|
@ -20,6 +20,38 @@ UINT16 mCurFakeQestId;
|
||||||
FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
|
FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
|
||||||
BOOLEAN mFinishRetrieveCall = FALSE;
|
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.
|
Evaluate all expressions in a Form.
|
||||||
|
|
||||||
|
@ -1686,6 +1718,8 @@ DisplayForm (
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckConfigAccess(gCurrentSelection->FormSet);
|
||||||
|
|
||||||
Status = ProcessUserInput (&UserInput);
|
Status = ProcessUserInput (&UserInput);
|
||||||
FreeDisplayFormData();
|
FreeDisplayFormData();
|
||||||
return Status;
|
return Status;
|
||||||
|
|
Loading…
Reference in New Issue