Leaked source code of windows server 2003
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.

175 lines
6.8 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_ANY_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_ANY_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_ANY_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. #define IOCTL_VOLSNAP_QUERY_EPIC CTL_CODE(VOLSNAPCONTROLTYPE, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
  36. #define IOCTL_VOLSNAP_QUERY_OFFLINE CTL_CODE(VOLSNAPCONTROLTYPE, 21, METHOD_BUFFERED, FILE_READ_ACCESS)
  37. //
  38. // The following IOCTLs are intended for volume snapshots.
  39. //
  40. #define IOCTL_VOLSNAP_QUERY_ORIGINAL_VOLUME_NAME CTL_CODE(VOLSNAPCONTROLTYPE, 100, METHOD_BUFFERED, FILE_ANY_ACCESS)
  41. #define IOCTL_VOLSNAP_QUERY_CONFIG_INFO CTL_CODE(VOLSNAPCONTROLTYPE, 101, METHOD_BUFFERED, FILE_ANY_ACCESS)
  42. #define IOCTL_VOLSNAP_SET_APPLICATION_INFO CTL_CODE(VOLSNAPCONTROLTYPE, 102, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  43. #define IOCTL_VOLSNAP_QUERY_APPLICATION_INFO CTL_CODE(VOLSNAPCONTROLTYPE, 103, METHOD_BUFFERED, FILE_ANY_ACCESS)
  44. //
  45. // Input buffer for IOCTL_VOLSNAP_FLUSH_AND_HOLD_WRITES.
  46. //
  47. typedef struct _VOLSNAP_FLUSH_AND_HOLD_INPUT {
  48. GUID InstanceId;
  49. ULONG NumberOfVolumesToFlush;
  50. USHORT SecondsToHoldFileSystemsTimeout; // 60 seconds recommended.
  51. USHORT SecondsToHoldIrpsTimeout; // 10 seconds recommended.
  52. } VOLSNAP_FLUSH_AND_HOLD_INPUT, *PVOLSNAP_FLUSH_AND_HOLD_INPUT;
  53. //
  54. // Input buffer for IOCTL_VOLSNAP_PREPARE_FOR_SNAPSHOT.
  55. //
  56. #define VOLSNAP_ATTRIBUTE_PERSISTENT (0x1)
  57. #define VOLSNAP_ALL_ATTRIBUTES (0x1)
  58. typedef struct _VOLSNAP_PREPARE_INFO {
  59. ULONG Attributes;
  60. ULONG Reserved; // Must be 0.
  61. LONGLONG InitialDiffAreaAllocation; // 100 MB recommended.
  62. } VOLSNAP_PREPARE_INFO, *PVOLSNAP_PREPARE_INFO;
  63. //
  64. // Output buffer for IOCTL_VOLSNAP_END_COMMIT_SNAPSHOT.
  65. // Input buffer for IOCTL_VOLSNAP_ADD_VOLUME_TO_DIFF_AREA.
  66. // Output buffer for IOCTL_VOLSNAP_QUERY_ORIGINAL_VOLUME_NAME.
  67. // Input buffer for IOCTL_VOLSNAP_DELETE_SNAPSHOT.
  68. //
  69. typedef struct _VOLSNAP_NAME {
  70. USHORT NameLength;
  71. WCHAR Name[1];
  72. } VOLSNAP_NAME, *PVOLSNAP_NAME;
  73. //
  74. // Input buffer for IOCTL_VOLSNAP_SET_DIFF_AREA.
  75. // Output buffer for IOCTL_VOLSNAP_QUERY_NAMES_OF_SNAPSHOTS and
  76. // IOCTL_VOLSNAP_QUERY_DIFF_AREA.
  77. //
  78. typedef struct _VOLSNAP_NAMES {
  79. ULONG MultiSzLength;
  80. WCHAR Names[1];
  81. } VOLSNAP_NAMES, *PVOLSNAP_NAMES;
  82. //
  83. // Output buffero for IOCTL_VOLSNAP_QUERY_EPIC.
  84. //
  85. typedef struct _VOLSNAP_EPIC {
  86. LONG EpicNumber;
  87. } VOLSNAP_EPIC, *PVOLSNAP_EPIC;
  88. //
  89. // Output buffer for IOCTL_VOLSNAP_QUERY_DIFF_AREA_SIZES.
  90. // Input buffer for IOCTL_VOLSNAP_SET_MAX_DIFF_AREA_SIZE.
  91. //
  92. typedef struct _VOLSNAP_DIFF_AREA_SIZES {
  93. LONGLONG UsedVolumeSpace; // This value is ignored on a SET call.
  94. LONGLONG AllocatedVolumeSpace;
  95. LONGLONG MaximumVolumeSpace; // A value of 0 indicates no maximum.
  96. } VOLSNAP_DIFF_AREA_SIZES, *PVOLSNAP_DIFF_AREA_SIZES;
  97. //
  98. // Output buffer for IOCTL_VOLSNAP_QUERY_CONFIG_INFO.
  99. //
  100. typedef struct _VOLSNAP_CONFIG_INFO {
  101. ULONG Attributes;
  102. ULONG Reserved;
  103. LARGE_INTEGER SnapshotCreationTime;
  104. } VOLSNAP_CONFIG_INFO, *PVOLSNAP_CONFIG_INFO;
  105. //
  106. // Input buffer for IOCTL_VOLSNAP_END_COMMIT_SNAPSHOT.
  107. // Input buffer for IOCTL_VOLSNAP_SET_APPLICATION_INFO.
  108. // Output buffer for IOCTL_VOLSNAP_QUERY_APPLICATION_INFO.
  109. //
  110. typedef struct _VOLSNAP_APPLICATION_INFO {
  111. ULONG InformationLength;
  112. UCHAR Information[1];
  113. //
  114. // It is highly recommended that the first 16 bytes from the
  115. // Application Info should be a unique GUID indentifying the
  116. // unique structure layout of the subsequent Application Info.
  117. //
  118. } VOLSNAP_APPLICATION_INFO, *PVOLSNAP_APPLICATION_INFO;
  119. #ifdef DEFINE_GUID
  120. //
  121. // This GUID denotes the first 16 bytes from the Application
  122. // Info structure associated with Client accessible snapshots.
  123. //
  124. // {E5DE7D45-49F2-40a4-817C-7DC82B72587F}
  125. DEFINE_GUID(VOLSNAP_APPINFO_GUID_CLIENT_ACCESSIBLE,
  126. 0xe5de7d45, 0x49f2, 0x40a4, 0x81, 0x7c, 0x7d, 0xc8, 0x2b, 0x72, 0x58, 0x7f);
  127. //
  128. // This GUID corresponds to the format used to store the
  129. // Hidden (Inaccessible) Snapshot Application Info.
  130. //
  131. // {F12142B4-9A4B-49af-A851-700C42FDC2BE}
  132. DEFINE_GUID(VOLSNAP_APPINFO_GUID_SYSTEM_HIDDEN,
  133. 0xf12142b4, 0x9a4b, 0x49af, 0xa8, 0x51, 0x70, 0xc, 0x42, 0xfd, 0xc2, 0xbe);
  134. #endif // DEFINE_GUID
  135. #endif