Code: Select all
#define EFI_FILE_INFO_ID {0x09576e92,0x6d3f,0x11d2,{0x8e39,0x00,0xa0,0xc9,0x69,0x72,0x3b}}
Code: Select all
./Bootloader/SEFI/Headers/simpleFileSystemProtocol.h:7:53: warning: unsigned conversion from ‘int’ to ‘unsigned char’ changes value from ‘36409’ to ‘57’ [-Woverflow]
7 | #define EFI_FILE_INFO_ID {0x09576e92,0x6d3f,0x11d2,{0x8e39,0x00,0xa0,0xc9,0x69,0x72,0x3b}}
| ^~~~~~
./Bootloader/x86_64/file.c:22:23: note: in expansion of macro ‘EFI_FILE_INFO_ID’
22 | EFI_GUID ifGuid = EFI_FILE_INFO_ID;
~~~~~~~
From the log file:
Failed with err: 0x8000000000000003
Failed to get file info
However, if I change the define to:
Code: Select all
#define EFI_FILE_INFO_ID {0x09576e92,0x6d3f,0x11d2,{0x8e,0x39,0x00,0xa0,0xc9,0x69,0x72,0x3b}}
Here's my code for getting file info
Code: Select all
EFI_STATUS getFileInfo(EFIFile *file){
EFI_GUID ifGuid = EFI_FILE_INFO_ID;
UINTN sz = 0;
EFI_STATUS status = file->File->GetInfo(file->File,&ifGuid,&sz,NULL);
if(status != EFI_BUFFER_TOO_SMALL){sprint(L"Failed with err: 0x%lx\n",status); return status;}
file->Info = (EFI_FILE_INFO*)allocPool(sz);
status = file->File->GetInfo(file->File,&ifGuid,&sz,file->Info);
if(status != EFI_SUCCESS){freePool(file->Info); return status;}
return EFI_SUCCESS;
}
EFIFile is just a struct I made for convenience
Code: Select all
typedef struct EFIFile{
uint16_t *name; //!< File name
EFI_HANDLE image; //!< EFI image
EFI_FILE_PROTOCOL *Volume; //!< EFI volume
EFI_FILE_PROTOCOL *File; //!< File handle
EFI_FILE_PROTOCOL *Directory; //!< EFI Directory
EFI_FILE_INFO *Info; //!< File info
uint64_t mode; //!< File mode
uint64_t flags; //!< File flags
EFI_LOADED_IMAGE_PROTOCOL *ldImg; //!< EFI protocol
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *io; //!< EFI protocol
}EFIFile;
My UEFI headers are at https://github.com/Roverx64/SEFI
You can see my definitions for all UEFI structs and types on there as well.
The definition for the GUID is on page 486 (13.5. File Protocol) of the latest UEFI spec.