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 **/
| 195 | |
| 196 | **/ |
| 197 | EFI_FILE_INFO * |
| 198 | EfiLibFileInfo ( |
| 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 | |
| 217 | EFI_FILE_SYSTEM_INFO * |
| 218 | EfiLibFileSystemInfo ( |
no test coverage detected