FileInfo.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /** @file
  2. Provides a GUID and a data structure that can be used with EFI_FILE_PROTOCOL.SetInfo()
  3. and EFI_FILE_PROTOCOL.GetInfo() to set or get generic file information.
  4. This GUID is defined in UEFI specification.
  5. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
  6. SPDX-License-Identifier: BSD-2-Clause-Patent
  7. **/
  8. #ifndef __FILE_INFO_H__
  9. #define __FILE_INFO_H__
  10. #define EFI_FILE_INFO_ID \
  11. { \
  12. 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
  13. }
  14. typedef struct {
  15. ///
  16. /// The size of the EFI_FILE_INFO structure, including the Null-terminated FileName string.
  17. ///
  18. UINT64 Size;
  19. ///
  20. /// The size of the file in bytes.
  21. ///
  22. UINT64 FileSize;
  23. ///
  24. /// PhysicalSize The amount of physical space the file consumes on the file system volume.
  25. ///
  26. UINT64 PhysicalSize;
  27. ///
  28. /// The time the file was created.
  29. ///
  30. EFI_TIME CreateTime;
  31. ///
  32. /// The time when the file was last accessed.
  33. ///
  34. EFI_TIME LastAccessTime;
  35. ///
  36. /// The time when the file's contents were last modified.
  37. ///
  38. EFI_TIME ModificationTime;
  39. ///
  40. /// The attribute bits for the file.
  41. ///
  42. UINT64 Attribute;
  43. ///
  44. /// The Null-terminated name of the file.
  45. ///
  46. CHAR16 FileName[1];
  47. } EFI_FILE_INFO;
  48. ///
  49. /// The FileName field of the EFI_FILE_INFO data structure is variable length.
  50. /// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
  51. /// be the size of the data structure without the FileName field. The following macro
  52. /// computes this size correctly no matter how big the FileName array is declared.
  53. /// This is required to make the EFI_FILE_INFO data structure ANSI compilant.
  54. ///
  55. #define SIZE_OF_EFI_FILE_INFO OFFSET_OF (EFI_FILE_INFO, FileName)
  56. extern EFI_GUID gEfiFileInfoGuid;
  57. #endif