From bcdf51597f044672db3faa3867f07579cac7f343 Mon Sep 17 00:00:00 2001 From: Download-Fritz Date: Wed, 19 Jun 2019 13:58:34 +0200 Subject: [PATCH] OcFileLib: Locate Disk I/O type agnostic of Block I/O --- Library/OcFileLib/GptPartitionEntry.c | 29 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Library/OcFileLib/GptPartitionEntry.c b/Library/OcFileLib/GptPartitionEntry.c index 1585a1e5..721ccc4d 100644 --- a/Library/OcFileLib/GptPartitionEntry.c +++ b/Library/OcFileLib/GptPartitionEntry.c @@ -368,21 +368,25 @@ InternalGetDiskPartitions ( ); } if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, "OCPI: Block I/O protocol is not present\n")); + DEBUG (( + DEBUG_INFO, + "OCPI: Block I/O protocol is not present %r(%d)\n", + Status, + HasBlockIo2 + )); return NULL; } // // Retrieve the Disk I/O protocol. // - if (HasBlockIo2) { - DiskIo = NULL; + DiskIo = NULL; - Status = gBS->HandleProtocol ( - DiskHandle, - &gEfiDiskIo2ProtocolGuid, - (VOID **)&DiskIo2 - ); - } else { + Status = gBS->HandleProtocol ( + DiskHandle, + &gEfiDiskIo2ProtocolGuid, + (VOID **)&DiskIo2 + ); + if (EFI_ERROR (Status)) { DiskIo2 = NULL; Status = gBS->HandleProtocol ( @@ -392,7 +396,12 @@ InternalGetDiskPartitions ( ); } if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, "OCPI: Disk I/O protocol is not present\n")); + DEBUG (( + DEBUG_INFO, + "OCPI: Disk I/O protocol is not present %r(%d)\n", + Status, + HasBlockIo2 + )); return NULL; } //