From 6dc837c8c76c18516a752f2415b21d7924e89d64 Mon Sep 17 00:00:00 2001 From: Regina König Date: Thu, 30 Jul 2020 02:42:40 +0200 Subject: searching for FILE access protocol --- .../ProtocolInformation/ProtocolInformation.c | 73 +++++++++++----------- memtestEDK/Memtest/run.sh | 2 +- 2 files changed, 38 insertions(+), 37 deletions(-) (limited to 'memtestEDK') diff --git a/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c b/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c index 20ac4bc..c60fbbd 100644 --- a/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c +++ b/memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c @@ -12,52 +12,53 @@ UefiMain ( IN EFI_SYSTEM_TABLE *SystemTable ) { -/* - EFI_STATUS efiStatus; + 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; + UINTN handleIndex; EFI_GUID **ProtocolGuidArray; UINTN ArrayCount; - UINTN ProtocolIndex; - EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo; - UINTN OpenInfoIndex; - UINTN OpenInfoCount; + //UINTN ProtocolIndex; + //EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo; + //UINTN OpenInfoIndex; + //UINTN OpenInfoCount; efiStatus = bs->LocateHandleBuffer ( AllHandles, NULL, NULL, - handleCount, + &handleCount, &handleBuffer ); - Print(L"Number of handles found: %d\n", handleCount); + 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++) { + for (handleIndex = 0; handleIndex < handleCount; handleIndex++) { // // Retrieve the list of all the protocols on each handle // - efiStatus = bs->ProtocolsPerHandle ( - handleBuffer[HandleIndex], - &ProtocolGuidArray, - &ArrayCount - ); + efiStatus = bs->ProtocolsPerHandle ( + handleBuffer[handleIndex], + &ProtocolGuidArray, + &ArrayCount + ); - Print(L"Number of Protocols per Handle: %d\n", 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++) { +/* if (!EFI_ERROR (efiStatus)) { +*/ /*for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) { // // Retrieve the protocol instance for each protocol // efiStatus = bs->OpenProtocol ( - handleBuffer[HandleIndex], + handleBuffer[handleIndex], ProtocolGuidArray[ProtocolIndex], NULL, ImageHandle, @@ -68,35 +69,35 @@ UefiMain ( // Retrieve the list of agents that have opened each protocol // efiStatus = bs->OpenProtocolInformation ( - handleBuffer[HandleIndex], + handleBuffer[handleIndex], ProtocolGuidArray[ProtocolIndex], &OpenInfo, &OpenInfoCount - ); - if (!EFI_ERROR (efiStatus)) { + );*/ + /* if (!EFI_ERROR (efiStatus)) { for (OpenInfoIndex=0;OpenInfoIndexFreePool(OpenInfo); - } - } - } - if (ProtocolGuidArray != NULL) { + }*/ + /* } + }*/ + /* if (ProtocolGuidArray != NULL) { bs->FreePool(ProtocolGuidArray); - } - } - if (handleBuffer != NULL) { + }*/ +/* }*/ + /*if (handleBuffer != NULL) { bs->FreePool (handleBuffer); - } - } + }*/ + } } -*/ + /* efiStatus = bs->LocateHandleBuffer(ByProtocol, &sfspGuid, NULL, diff --git a/memtestEDK/Memtest/run.sh b/memtestEDK/Memtest/run.sh index f9a3f01..6d98a65 100755 --- a/memtestEDK/Memtest/run.sh +++ b/memtestEDK/Memtest/run.sh @@ -3,7 +3,7 @@ (cd ..;. edksetup.sh BaseTools; build -a X64 -p MdeModulePkg/MdeModulePkg.dsc) if [ $? -ne 0 ]; then exit 1; fi -(cd ..; cp Build/MdeModule/DEBUG_GCC5/X64/GetRootSystemDescriptionPointer.efi ../../git/working_dir/memtest86/test_code/hda-contents/) +(cd ..; cp Build/MdeModule/DEBUG_GCC5/X64/ProtocolInformation.efi ../../git/working_dir/memtest86/test_code/hda-contents/) if [ $? -ne 0 ]; then exit 1; fi (cd ../../../git/working_dir/memtest86/test_code; sudo ./run.sh ) -- cgit v1.2.3-55-g7522