mirror of https://github.com/acidanthera/audk.git
SignedCapsulePkg SystemFirmwareReportDxe: Try LocateProtocol
Try LocateProtocol after HandleProtocol fails to be compatible with old SystemFirmwareUpdateDxe. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
parent
7343bc8062
commit
fc0494a654
|
@ -202,17 +202,24 @@ FmpSetImage (
|
|||
(VOID **)&SystemFmp
|
||||
);
|
||||
if (EFI_ERROR(Status)) {
|
||||
DEBUG((DEBUG_INFO, "(Agent)SetImage - SystemFmpProtocol - %r\n", Status));
|
||||
SystemFmpPrivate->LastAttempt.LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT;
|
||||
VarStatus = gRT->SetVariable(
|
||||
SYSTEM_FMP_LAST_ATTEMPT_VARIABLE_NAME,
|
||||
&gSystemFmpLastAttemptVariableGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof(SystemFmpPrivate->LastAttempt),
|
||||
&SystemFmpPrivate->LastAttempt
|
||||
);
|
||||
DEBUG((DEBUG_INFO, "(Agent)SetLastAttemp - %r\n", VarStatus));
|
||||
return Status;
|
||||
Status = gBS->LocateProtocol (
|
||||
&gSystemFmpProtocolGuid,
|
||||
NULL,
|
||||
(VOID **)&SystemFmp
|
||||
);
|
||||
if (EFI_ERROR(Status)) {
|
||||
DEBUG((DEBUG_INFO, "(Agent)SetImage - SystemFmpProtocol - %r\n", Status));
|
||||
SystemFmpPrivate->LastAttempt.LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT;
|
||||
VarStatus = gRT->SetVariable(
|
||||
SYSTEM_FMP_LAST_ATTEMPT_VARIABLE_NAME,
|
||||
&gSystemFmpLastAttemptVariableGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof(SystemFmpPrivate->LastAttempt),
|
||||
&SystemFmpPrivate->LastAttempt
|
||||
);
|
||||
DEBUG((DEBUG_INFO, "(Agent)SetLastAttemp - %r\n", VarStatus));
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
return SystemFmp->SetImage(SystemFmp, ImageIndex, Image, ImageSize, VendorCode, Progress, AbortReason);
|
||||
|
|
Loading…
Reference in New Issue