mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
Protocol libs: Error-exit when reinstalling fails
This commit is contained in:
parent
cf35807a8d
commit
0410d97604
@ -1509,17 +1509,21 @@ OcAppleBootPolicyInstallProtocol (
|
||||
EFI_HANDLE Handle;
|
||||
|
||||
if (Reinstall) {
|
||||
UninstallAllProtocolInstances (&gAppleBootPolicyProtocolGuid);
|
||||
}
|
||||
Status = UninstallAllProtocolInstances (&gAppleBootPolicyProtocolGuid);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "OCBP: Uninstall failed: %r\n", Status));
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
Status = gBS->LocateProtocol (
|
||||
&gAppleBootPolicyProtocolGuid,
|
||||
NULL,
|
||||
(VOID *) &Protocol
|
||||
);
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gAppleBootPolicyProtocolGuid,
|
||||
NULL,
|
||||
(VOID *) &Protocol
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return Protocol;
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return Protocol;
|
||||
}
|
||||
}
|
||||
|
||||
Handle = NULL;
|
||||
|
||||
@ -604,7 +604,7 @@ InternalVerifyImg4ByPathWorker (
|
||||
|
||||
STATIC CONST UINTN ManifestSuffixMaxSize =
|
||||
(((ARRAY_SIZE (HwModel) - 1 + (2 * sizeof (Ecid))) * sizeof (CHAR16))
|
||||
+ L_STR_SIZE (L"...im4m"));
|
||||
+ L_STR_SIZE_NT (L"...im4m"));
|
||||
|
||||
Status = gBS->LocateDevicePath (
|
||||
&gEfiSimpleFileSystemProtocolGuid,
|
||||
@ -1011,16 +1011,20 @@ OcAppleSecureBootInstallProtocol (
|
||||
EFI_HANDLE Handle;
|
||||
|
||||
if (Reinstall) {
|
||||
UninstallAllProtocolInstances (&gAppleSecureBootProtocolGuid);
|
||||
}
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gAppleSecureBootProtocolGuid,
|
||||
NULL,
|
||||
(VOID **)&Protocol
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return Protocol;
|
||||
Status = UninstallAllProtocolInstances (&gAppleSecureBootProtocolGuid);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "OCSB: Uninstall failed: %r\n", Status));
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
Status = gBS->LocateProtocol (
|
||||
&gAppleSecureBootProtocolGuid,
|
||||
NULL,
|
||||
(VOID **)&Protocol
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return Protocol;
|
||||
}
|
||||
}
|
||||
|
||||
Handle = NULL;
|
||||
|
||||
@ -52,21 +52,24 @@ OcDataHubInstallProtocol (
|
||||
EFI_DATA_HUB_PROTOCOL *DataHub;
|
||||
|
||||
if (Reinstall) {
|
||||
UninstallAllProtocolInstances (&gEfiDataHubProtocolGuid);
|
||||
Status = UninstallAllProtocolInstances (&gEfiDataHubProtocolGuid);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "OCDH: Uninstall failed: %r\n", Status));
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiDataHubProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) &DataHub
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return DataHub;
|
||||
}
|
||||
}
|
||||
|
||||
DataHub = NULL;
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiDataHubProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) &DataHub
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return DataHubInstall ();
|
||||
}
|
||||
|
||||
return DataHub;
|
||||
return DataHubInstall ();
|
||||
}
|
||||
|
||||
STATIC
|
||||
|
||||
@ -796,17 +796,21 @@ OcDevicePathPropertyInstallProtocol (
|
||||
EFI_HANDLE Handle;
|
||||
|
||||
if (Reinstall) {
|
||||
UninstallAllProtocolInstances (&gEfiDevicePathPropertyDatabaseProtocolGuid);
|
||||
}
|
||||
Status = UninstallAllProtocolInstances (&gEfiDevicePathPropertyDatabaseProtocolGuid);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "OCDP: Uninstall failed: %r\n", Status));
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiDevicePathPropertyDatabaseProtocolGuid,
|
||||
NULL,
|
||||
(VOID *)&Protocol
|
||||
);
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiDevicePathPropertyDatabaseProtocolGuid,
|
||||
NULL,
|
||||
(VOID *)&Protocol
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return Protocol;
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return Protocol;
|
||||
}
|
||||
}
|
||||
|
||||
DevicePathPropertyData = AllocateZeroPool (sizeof (*DevicePathPropertyData));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user