summaryrefslogtreecommitdiffstats
path: root/memtestEDK
diff options
context:
space:
mode:
authorRegina König2020-07-30 03:52:45 +0200
committerRegina König2020-07-30 03:52:45 +0200
commitb034613e257c8d2952a994211f1a8842c23ff71f (patch)
treeec0cd3adf5a53e556fe4a4f30ebf370c05255b97 /memtestEDK
parentsearching for FILE access protocol (diff)
downloadmemtest86-b034613e257c8d2952a994211f1a8842c23ff71f.tar.gz
memtest86-b034613e257c8d2952a994211f1a8842c23ff71f.tar.xz
memtest86-b034613e257c8d2952a994211f1a8842c23ff71f.zip
Have some progress in search for file system protocol
Diffstat (limited to 'memtestEDK')
-rw-r--r--memtestEDK/Memtest/ProtocolInformation/ProtocolInformation.c88
1 files changed, 53 insertions, 35 deletions
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;OpenInfoIndex<OpenInfoCount;OpenInfoIndex++) {
+ //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++) {
+
+ EFI_GUID *guid = ProtocolGuidArray[ProtocolIndex];
+ UINT32 Data1;
+ //UINT16 Data2;
+ //UINT32 Data3;
+ //UINT8 Data4[8];
+ Data1 = guid->Data1;
+
+ 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,