Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

158 lines
6.0 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntddsnap.h
  5. Abstract:
  6. This header file defines the public interface for the volume snapshot
  7. driver.
  8. Author:
  9. Norbert P. Kusters (norbertk) 30-July-1999
  10. Notes:
  11. Revision History:
  12. Adi Oltean (aoltean) 08-May-2001 - Added Application Info GUID for Client accessible snapshots
  13. --*/
  14. #ifndef _NTDDSNAP_
  15. #define _NTDDSNAP_
  16. #define VOLSNAPCONTROLTYPE ((ULONG) 'S') // ntifs
  17. //
  18. // The following IOCTLs are intended for proper volumes.
  19. //
  20. #define IOCTL_VOLSNAP_FLUSH_AND_HOLD_WRITES CTL_CODE(VOLSNAPCONTROLTYPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) // ntifs
  21. #define IOCTL_VOLSNAP_RELEASE_WRITES CTL_CODE(VOLSNAPCONTROLTYPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  22. #define IOCTL_VOLSNAP_PREPARE_FOR_SNAPSHOT CTL_CODE(VOLSNAPCONTROLTYPE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  23. #define IOCTL_VOLSNAP_ABORT_PREPARED_SNAPSHOT CTL_CODE(VOLSNAPCONTROLTYPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  24. #define IOCTL_VOLSNAP_COMMIT_SNAPSHOT CTL_CODE(VOLSNAPCONTROLTYPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  25. #define IOCTL_VOLSNAP_END_COMMIT_SNAPSHOT CTL_CODE(VOLSNAPCONTROLTYPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  26. #define IOCTL_VOLSNAP_QUERY_NAMES_OF_SNAPSHOTS CTL_CODE(VOLSNAPCONTROLTYPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS)
  27. #define IOCTL_VOLSNAP_CLEAR_DIFF_AREA CTL_CODE(VOLSNAPCONTROLTYPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  28. #define IOCTL_VOLSNAP_ADD_VOLUME_TO_DIFF_AREA CTL_CODE(VOLSNAPCONTROLTYPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  29. #define IOCTL_VOLSNAP_QUERY_DIFF_AREA CTL_CODE(VOLSNAPCONTROLTYPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS)
  30. #define IOCTL_VOLSNAP_SET_MAX_DIFF_AREA_SIZE CTL_CODE(VOLSNAPCONTROLTYPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  31. #define IOCTL_VOLSNAP_QUERY_DIFF_AREA_SIZES CTL_CODE(VOLSNAPCONTROLTYPE, 11, METHOD_BUFFERED, FILE_READ_ACCESS)
  32. #define IOCTL_VOLSNAP_DELETE_OLDEST_SNAPSHOT CTL_CODE(VOLSNAPCONTROLTYPE, 12, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  33. #define IOCTL_VOLSNAP_AUTO_CLEANUP CTL_CODE(VOLSNAPCONTROLTYPE, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
  34. #define IOCTL_VOLSNAP_DELETE_SNAPSHOT CTL_CODE(VOLSNAPCONTROLTYPE, 14, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  35. //
  36. // The following IOCTLs are intended for volume snapshots.
  37. //
  38. #define IOCTL_VOLSNAP_QUERY_ORIGINAL_VOLUME_NAME CTL_CODE(VOLSNAPCONTROLTYPE, 100, METHOD_BUFFERED, FILE_READ_ACCESS)
  39. #define IOCTL_VOLSNAP_QUERY_CONFIG_INFO CTL_CODE(VOLSNAPCONTROLTYPE, 101, METHOD_BUFFERED, FILE_READ_ACCESS)
  40. #define IOCTL_VOLSNAP_SET_APPLICATION_INFO CTL_CODE(VOLSNAPCONTROLTYPE, 102, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  41. #define IOCTL_VOLSNAP_QUERY_APPLICATION_INFO CTL_CODE(VOLSNAPCONTROLTYPE, 103, METHOD_BUFFERED, FILE_READ_ACCESS)
  42. //
  43. // Input buffer for IOCTL_VOLSNAP_FLUSH_AND_HOLD_WRITES.
  44. //
  45. typedef struct _VOLSNAP_FLUSH_AND_HOLD_INPUT {
  46. GUID InstanceId;
  47. ULONG NumberOfVolumesToFlush;
  48. USHORT SecondsToHoldFileSystemsTimeout; // 60 seconds recommended.
  49. USHORT SecondsToHoldIrpsTimeout; // 10 seconds recommended.
  50. } VOLSNAP_FLUSH_AND_HOLD_INPUT, *PVOLSNAP_FLUSH_AND_HOLD_INPUT;
  51. //
  52. // Input buffer for IOCTL_VOLSNAP_PREPARE_FOR_SNAPSHOT.
  53. //
  54. #define VOLSNAP_ATTRIBUTE_PERSISTENT (0x1)
  55. #define VOLSNAP_ALL_ATTRIBUTES (0x1)
  56. typedef struct _VOLSNAP_PREPARE_INFO {
  57. ULONG Attributes;
  58. ULONG Reserved; // Must be 0.
  59. LONGLONG InitialDiffAreaAllocation; // 100 MB recommended.
  60. } VOLSNAP_PREPARE_INFO, *PVOLSNAP_PREPARE_INFO;
  61. //
  62. // Output buffer for IOCTL_VOLSNAP_END_COMMIT_SNAPSHOT.
  63. // Input buffer for IOCTL_VOLSNAP_ADD_VOLUME_TO_DIFF_AREA.
  64. // Output buffer for IOCTL_VOLSNAP_QUERY_ORIGINAL_VOLUME_NAME.
  65. // Input buffer for IOCTL_VOLSNAP_DELETE_SNAPSHOT.
  66. //
  67. typedef struct _VOLSNAP_NAME {
  68. USHORT NameLength;
  69. WCHAR Name[1];
  70. } VOLSNAP_NAME, *PVOLSNAP_NAME;
  71. //
  72. // Input buffer for IOCTL_VOLSNAP_SET_DIFF_AREA.
  73. // Output buffer for IOCTL_VOLSNAP_QUERY_NAMES_OF_SNAPSHOTS and
  74. // IOCTL_VOLSNAP_QUERY_DIFF_AREA.
  75. //
  76. typedef struct _VOLSNAP_NAMES {
  77. ULONG MultiSzLength;
  78. WCHAR Names[1];
  79. } VOLSNAP_NAMES, *PVOLSNAP_NAMES;
  80. //
  81. // Output buffer for IOCTL_VOLSNAP_QUERY_DIFF_AREA_SIZES.
  82. // Input buffer for IOCTL_VOLSNAP_SET_MAX_DIFF_AREA_SIZE.
  83. //
  84. typedef struct _VOLSNAP_DIFF_AREA_SIZES {
  85. LONGLONG UsedVolumeSpace; // This value is ignored on a SET call.
  86. LONGLONG AllocatedVolumeSpace;
  87. LONGLONG MaximumVolumeSpace; // A value of 0 indicates no maximum.
  88. } VOLSNAP_DIFF_AREA_SIZES, *PVOLSNAP_DIFF_AREA_SIZES;
  89. //
  90. // Output buffer for IOCTL_VOLSNAP_QUERY_CONFIG_INFO.
  91. //
  92. typedef struct _VOLSNAP_CONFIG_INFO {
  93. ULONG Attributes;
  94. ULONG Reserved;
  95. LARGE_INTEGER SnapshotCreationTime;
  96. } VOLSNAP_CONFIG_INFO, *PVOLSNAP_CONFIG_INFO;
  97. //
  98. // Input buffer for IOCTL_VOLSNAP_END_COMMIT_SNAPSHOT.
  99. // Input buffer for IOCTL_VOLSNAP_SET_APPLICATION_INFO.
  100. // Output buffer for IOCTL_VOLSNAP_QUERY_APPLICATION_INFO.
  101. //
  102. typedef struct _VOLSNAP_APPLICATION_INFO {
  103. ULONG InformationLength;
  104. UCHAR Information[1];
  105. //
  106. // It is highly recommended that the first 16 bytes from the
  107. // Application Info should be a unique GUID indentifying the
  108. // unique structure layout of the subsequent Application Info.
  109. //
  110. } VOLSNAP_APPLICATION_INFO, *PVOLSNAP_APPLICATION_INFO;
  111. #ifdef DEFINE_GUID
  112. //
  113. // This GUID denotes the first 16 bytes from the Application
  114. // Info structure associated with Client accessible snapshots.
  115. //
  116. // {E5DE7D45-49F2-40a4-817C-7DC82B72587F}
  117. DEFINE_GUID(VOLSNAP_APPINFO_GUID_CLIENT_ACCESSIBLE,
  118. 0xe5de7d45, 0x49f2, 0x40a4, 0x81, 0x7c, 0x7d, 0xc8, 0x2b, 0x72, 0x58, 0x7f);
  119. #endif // DEFINE_GUID
  120. #endif