From b034613e257c8d2952a994211f1a8842c23ff71f Mon Sep 17 00:00:00 2001 From: Regina König Date: Thu, 30 Jul 2020 03:52:45 +0200 Subject: Have some progress in search for file system protocol --- .../ProtocolInformation/ProtocolInformation.c | 88 +++++++++++++--------- 1 file changed, 53 insertions(+), 35 deletions(-) (limited to 'memtestEDK') diff --git a/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c b/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c index c60fbbd..c256dde 100644 --- a/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c +++ b/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c @@ -15,13 +15,13 @@ UefiMain ( EFI_STATUS efiStatus; EFI_BOOT_SERVICES* bs = SystemTable->BootServices; - //EFI_GUID sfspGuid = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID; + EFI_GUID sfspGuid = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID; EFI_HANDLE* handleBuffer = NULL; UINTN handleCount = 0; UINTN handleIndex; EFI_GUID **ProtocolGuidArray; UINTN ArrayCount; - //UINTN ProtocolIndex; + UINTN ProtocolIndex; //EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo; //UINTN OpenInfoIndex; //UINTN OpenInfoCount; @@ -34,8 +34,10 @@ UefiMain ( &handleBuffer ); - Print(L"EFI_STATUS after LocateHandleBuffer: %r\n", efiStatus); - Print(L"Number of handles found: %d\n", handleCount); // Last time: 182 + UINT32 sfspData1 = sfspGuid.Data1; + + //Print(L"EFI_STATUS after LocateHandleBuffer: %r\n", efiStatus); + //Print(L"Number of handles found: %d\n", handleCount); // Last time: 182 if (!EFI_ERROR (efiStatus)) { for (handleIndex = 0; handleIndex < handleCount; handleIndex++) { @@ -48,46 +50,61 @@ UefiMain ( &ArrayCount ); - Print(L"EFI_STATUS after ProtocolsPerHandle: %r\n", efiStatus); - Print(L"Number of Protocols per Handle: %d\n", ArrayCount); - -/* if (!EFI_ERROR (efiStatus)) { -*/ /*for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) { - // - // Retrieve the protocol instance for each protocol - // - - efiStatus = bs->OpenProtocol ( - handleBuffer[handleIndex], - ProtocolGuidArray[ProtocolIndex], - NULL, - ImageHandle, - NULL, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - // - // Retrieve the list of agents that have opened each protocol - // - efiStatus = bs->OpenProtocolInformation ( - handleBuffer[handleIndex], - ProtocolGuidArray[ProtocolIndex], - &OpenInfo, - &OpenInfoCount - );*/ - /* if (!EFI_ERROR (efiStatus)) { - for (OpenInfoIndex=0;OpenInfoIndexData1; + + if (Data1 == sfspData1) { + Print(L"GUID: %x\n", Data1); + Print(L"handleIndex: %d\n", handleIndex); + Print(L"ProtocolIndex: %d\n", ProtocolIndex); + } + // + // Retrieve the protocol instance for each protocol + // + + /*efiStatus = bs->OpenProtocol ( + handleBuffer[handleIndex], + ProtocolGuidArray[ProtocolIndex], + NULL, + ImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + );*/ + + // + // Retrieve the list of agents that have opened each protocol + // + /*efiStatus = bs->OpenProtocolInformation ( + handleBuffer[handleIndex], + ProtocolGuidArray[ProtocolIndex], + &OpenInfo, + &OpenInfoCount + ); +*/ /* if (!EFI_ERROR (efiStatus)) { +*/ /* for (OpenInfoIndex=0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {*/ // // HandleBuffer[handleIndex] is the handle // ProtocolGuidArray[ProtocolIndex] is the protocol GUID // Instance is the protocol instance for the protocol // OpenInfo[OpenInfoIndex] is an agent that has opened a protocol // - }*/ +/* }*/ /*if (OpenInfo != NULL) { bs->FreePool(OpenInfo); }*/ - /* } - }*/ + } + } + /* if (ProtocolGuidArray != NULL) { bs->FreePool(ProtocolGuidArray); }*/ @@ -97,6 +114,7 @@ UefiMain ( }*/ } } + Print(L"sfps: %x\n", sfspData1); /* efiStatus = bs->LocateHandleBuffer(ByProtocol, &sfspGuid, -- cgit v1.2.3-55-g7522