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.

177 lines
4.9 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntddvol.h
  5. Abstract:
  6. This header file defines the IOCTLs supported by Windows NT volumes.
  7. Author:
  8. Norbert Kusters 15-April-1998
  9. Notes:
  10. Revision History:
  11. --*/
  12. #ifndef _NTDDVOL_
  13. #define _NTDDVOL_
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #ifndef IOCTL_VOLUME_BASE
  21. // begin_winioctl
  22. //
  23. // These IOCTLs are handled by hard disk volumes.
  24. //
  25. #define IOCTL_VOLUME_BASE ((ULONG) 'V')
  26. #define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
  27. #define IOCTL_VOLUME_IS_CLUSTERED CTL_CODE(IOCTL_VOLUME_BASE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
  28. //
  29. // Disk extent definition.
  30. //
  31. typedef struct _DISK_EXTENT {
  32. ULONG DiskNumber;
  33. LARGE_INTEGER StartingOffset;
  34. LARGE_INTEGER ExtentLength;
  35. } DISK_EXTENT, *PDISK_EXTENT;
  36. //
  37. // Output structure for IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS.
  38. //
  39. typedef struct _VOLUME_DISK_EXTENTS {
  40. ULONG NumberOfDiskExtents;
  41. DISK_EXTENT Extents[1];
  42. } VOLUME_DISK_EXTENTS, *PVOLUME_DISK_EXTENTS;
  43. // end_winioctl
  44. #endif
  45. //
  46. // These IOCTLs are to support cluster services.
  47. //
  48. #define IOCTL_VOLUME_SUPPORTS_ONLINE_OFFLINE CTL_CODE(IOCTL_VOLUME_BASE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
  49. #define IOCTL_VOLUME_ONLINE CTL_CODE(IOCTL_VOLUME_BASE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  50. #define IOCTL_VOLUME_OFFLINE CTL_CODE(IOCTL_VOLUME_BASE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  51. #define IOCTL_VOLUME_IS_OFFLINE CTL_CODE(IOCTL_VOLUME_BASE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
  52. #define IOCTL_VOLUME_IS_IO_CAPABLE CTL_CODE(IOCTL_VOLUME_BASE, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
  53. #define IOCTL_VOLUME_QUERY_FAILOVER_SET CTL_CODE(IOCTL_VOLUME_BASE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
  54. //
  55. // Output structure for IOCTL_VOLUME_QUERY_FAILOVER_SET.
  56. //
  57. typedef struct _VOLUME_FAILOVER_SET {
  58. ULONG NumberOfDisks;
  59. ULONG DiskNumbers[1];
  60. } VOLUME_FAILOVER_SET, *PVOLUME_FAILOVER_SET;
  61. //
  62. // More IOCTLs for hard disk volumes.
  63. //
  64. #define IOCTL_VOLUME_QUERY_VOLUME_NUMBER CTL_CODE(IOCTL_VOLUME_BASE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
  65. #define IOCTL_VOLUME_LOGICAL_TO_PHYSICAL CTL_CODE(IOCTL_VOLUME_BASE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
  66. #define IOCTL_VOLUME_PHYSICAL_TO_LOGICAL CTL_CODE(IOCTL_VOLUME_BASE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
  67. #define IOCTL_VOLUME_IS_PARTITION CTL_CODE(IOCTL_VOLUME_BASE, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
  68. #define IOCTL_VOLUME_READ_PLEX CTL_CODE(IOCTL_VOLUME_BASE, 11, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
  69. //
  70. // Output structure for IOCTL_VOLUME_QUERY_VOLUME_NUMBER. If the volume
  71. // manager name is less than 8 characters then it should be padded with
  72. // blanks (0x20).
  73. //
  74. typedef struct _VOLUME_NUMBER {
  75. ULONG VolumeNumber;
  76. WCHAR VolumeManagerName[8];
  77. } VOLUME_NUMBER, *PVOLUME_NUMBER;
  78. //
  79. // Input structure for IOCTL_VOLUME_LOGICAL_TO_PHYSICAL.
  80. // Output structure for IOCTL_VOLUME_PHYSICAL_TO_LOGICAL.
  81. //
  82. typedef struct _VOLUME_LOGICAL_OFFSET {
  83. LONGLONG LogicalOffset;
  84. } VOLUME_LOGICAL_OFFSET, *PVOLUME_LOGICAL_OFFSET;
  85. //
  86. // Input structure for IOCTL_VOLUME_PHYSICAL_TO_LOGICAL.
  87. //
  88. typedef struct _VOLUME_PHYSICAL_OFFSET {
  89. ULONG DiskNumber;
  90. LONGLONG Offset;
  91. } VOLUME_PHYSICAL_OFFSET, *PVOLUME_PHYSICAL_OFFSET;
  92. //
  93. // Output structure for IOCTL_VOLUME_LOGICAL_TO_PHYSICAL.
  94. //
  95. typedef struct _VOLUME_PHYSICAL_OFFSETS {
  96. ULONG NumberOfPhysicalOffsets;
  97. VOLUME_PHYSICAL_OFFSET PhysicalOffset[1];
  98. } VOLUME_PHYSICAL_OFFSETS, *PVOLUME_PHYSICAL_OFFSETS;
  99. //
  100. // Input structure for IOCTL_VOLUME_READ_PLEX.
  101. //
  102. typedef struct _VOLUME_READ_PLEX_INPUT {
  103. LARGE_INTEGER ByteOffset;
  104. ULONG Length;
  105. ULONG PlexNumber;
  106. } VOLUME_READ_PLEX_INPUT, *PVOLUME_READ_PLEX_INPUT;
  107. //
  108. // IOCTLs for setting and getting GPT attributes on volumes.
  109. //
  110. #define IOCTL_VOLUME_SET_GPT_ATTRIBUTES CTL_CODE(IOCTL_VOLUME_BASE, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
  111. #define IOCTL_VOLUME_GET_GPT_ATTRIBUTES CTL_CODE(IOCTL_VOLUME_BASE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
  112. //
  113. // Input structure for IOCTL_VOLUME_SET_GPT_ATTRIBUTES.
  114. //
  115. typedef struct _VOLUME_SET_GPT_ATTRIBUTES_INFORMATION {
  116. ULONGLONG GptAttributes;
  117. BOOLEAN RevertOnClose;
  118. BOOLEAN ApplyToAllConnectedVolumes;
  119. USHORT Reserved1; // Must be 0.
  120. ULONG Reserved2; // Must be 0.
  121. } VOLUME_SET_GPT_ATTRIBUTES_INFORMATION, *PVOLUME_SET_GPT_ATTRIBUTES_INFORMATION;
  122. //
  123. // Output structure for IOCTL_VOLUME_GET_GPT_ATTRIBUTES.
  124. //
  125. typedef struct _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION {
  126. ULONGLONG GptAttributes;
  127. } VOLUME_GET_GPT_ATTRIBUTES_INFORMATION, *PVOLUME_GET_GPT_ATTRIBUTES_INFORMATION;
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif // _NTDDVOL_