MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / EfiLibFileInfo

Function EfiLibFileInfo

rEFIt_UEFI/libeg/BmLib.cpp:197–215  ·  view source on GitHub ↗

Function gets the file information from an open file descriptor, and stores it in a buffer allocated from pool. @param FHand File Handle. @return A pointer to a buffer with file information or NULL is returned **/

Source from the content-addressed store, hash-verified

195
196**/
197EFI_FILE_INFO *
198EfiLibFileInfo (
199 IN EFI_FILE_HANDLE FHand
200 )
201{
202 EFI_STATUS Status;
203 EFI_FILE_INFO *FileInfo = NULL;
204 UINTN Size = 0;
205
206 Status = FHand->GetInfo (FHand, &gEfiFileInfoGuid, &Size, FileInfo);
207 if (Status == EFI_BUFFER_TOO_SMALL) {
208 // inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name
209 Size += 2;
210 FileInfo = (__typeof__(FileInfo))AllocateZeroPool(Size);
211 Status = FHand->GetInfo (FHand, &gEfiFileInfoGuid, &Size, FileInfo);
212 }
213
214 return EFI_ERROR(Status)?NULL:FileInfo;
215}
216
217EFI_FILE_SYSTEM_INFO *
218EfiLibFileSystemInfo (

Callers 7

egLoadFileFunction · 0.70
egSaveFileFunction · 0.70
ScanVolumeFunction · 0.50
DeleteFileFunction · 0.50
LoadLatestNvramPlistFunction · 0.50
AskUserForFilePathFunction · 0.50

Calls 1

AllocateZeroPoolFunction · 0.50

Tested by

no test coverage detected