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.

225 lines
5.2 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntddft.h
  5. Abstract:
  6. This file contains NTFT definitions and prototypes.
  7. Authors:
  8. Bob Rinne
  9. Mike Glass
  10. Notes:
  11. Revision History:
  12. --*/
  13. #ifndef _NTDDFT_
  14. #define _NTDDFT_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #include <ntdskreg.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. //
  23. // Device Control Codes
  24. //
  25. #define FTTYPE ((ULONG)'f')
  26. #define FT_INITIALIZE_SET CTL_CODE(FTTYPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
  27. #define FT_REGENERATE CTL_CODE(FTTYPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
  28. #define FT_CONFIGURE CTL_CODE(FTTYPE, 2, METHOD_NEITHER, FILE_ANY_ACCESS)
  29. #define FT_VERIFY CTL_CODE(FTTYPE, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
  30. #define FT_SECONDARY_READ CTL_CODE(FTTYPE, 4, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
  31. #define FT_PRIMARY_READ CTL_CODE(FTTYPE, 5, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
  32. #define FT_BALANCED_READ_MODE CTL_CODE(FTTYPE, 6, METHOD_NEITHER, FILE_ANY_ACCESS)
  33. #define FT_SYNC_REDUNDANT_COPY CTL_CODE(FTTYPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
  34. #define FT_SEQUENTIAL_WRITE_MODE CTL_CODE(FTTYPE, 8, METHOD_NEITHER, FILE_ANY_ACCESS)
  35. #define FT_PARALLEL_WRITE_MODE CTL_CODE(FTTYPE, 9, METHOD_NEITHER, FILE_ANY_ACCESS)
  36. #define FT_QUERY_SET_STATE CTL_CODE(FTTYPE,10, METHOD_BUFFERED, FILE_ANY_ACCESS)
  37. #define FT_CLUSTER_SET_MEMBER_STATE CTL_CODE(FTTYPE,11, METHOD_BUFFERED, FILE_ANY_ACCESS)
  38. #define FT_CLUSTER_GET_MEMBER_STATE CTL_CODE(FTTYPE,12, METHOD_BUFFERED, FILE_ANY_ACCESS)
  39. //
  40. // Used as input parameters to the SECONDARY and PRIMARY read device controls
  41. //
  42. typedef struct _FT_SPECIAL_READ {
  43. LARGE_INTEGER ByteOffset;
  44. ULONG Length;
  45. } FT_SPECIAL_READ, *PFT_SPECIAL_READ;
  46. //
  47. // Used to find a partition in the system.
  48. //
  49. typedef struct _FT_CONTROL_BLOCK {
  50. USHORT Type;
  51. USHORT FtGroup;
  52. } FT_CONTROL_BLOCK, *PFT_CONTROL_BLOCK;
  53. //
  54. // FT SYNC primary from secondary IOCTL
  55. //
  56. typedef struct _FT_SYNC_INFORMATION {
  57. LARGE_INTEGER ByteOffset;
  58. LARGE_INTEGER ByteCount;
  59. } FT_SYNC_INFORMATION, *PFT_SYNC_INFORMATION;
  60. //
  61. // Define for registry information.
  62. //
  63. #define DISK_REGISTRY_KEY "\\REGISTRY\\MACHINE\\SYSTEM\\DISK"
  64. //
  65. // Define for value name for registry information.
  66. //
  67. #define DISK_REGISTRY_VALUE "Information"
  68. //
  69. // Structures for config registry.
  70. //
  71. //
  72. // The header for the registry information structure.
  73. //
  74. #include "pshpack4.h"
  75. typedef struct _DISK_CONFIG_HEADER {
  76. ULONG Version;
  77. ULONG CheckSum;
  78. BOOLEAN DirtyShutdown;
  79. UCHAR Reserved[3];
  80. ULONG DiskInformationOffset;
  81. ULONG DiskInformationSize;
  82. ULONG FtInformationOffset;
  83. ULONG FtInformationSize;
  84. ULONG FtStripeWidth;
  85. ULONG FtPoolSize;
  86. ULONG NameOffset; // Reserved for future.
  87. ULONG NameSize; // Reserved for future.
  88. } DISK_CONFIG_HEADER, *PDISK_CONFIG_HEADER;
  89. #define DISK_INFORMATION_VERSION 0x03
  90. //
  91. // FT_STATE is an enumerated field that describes the state of the FT
  92. // volume as a whole.
  93. //
  94. typedef enum _FT_STATE {
  95. FtStateOk, // set is complete
  96. FtHasOrphan, // set is running, but one member is turned off
  97. FtDisabled, // set has been turned off - it cannot be used
  98. FtRegenerating, // member of set is being generated from check data
  99. FtInitializing, // set is being initialized
  100. FtCheckParity, // check data is not in sync
  101. FtNoCheckData // parity has not been initialized
  102. } FT_STATE, *PFT_STATE;
  103. //
  104. // State information for an FT set. The partition state enum is used to
  105. // specify the state for the complete set.
  106. //
  107. typedef struct _FT_SET_INFORMATION {
  108. ULONG NumberOfMembers;
  109. FT_TYPE Type;
  110. FT_STATE SetState;
  111. } FT_SET_INFORMATION, *PFT_SET_INFORMATION;
  112. //
  113. // The description information for an FT component member.
  114. //
  115. typedef struct _FT_MEMBER_DESCRIPTION {
  116. USHORT State;
  117. USHORT ReservedShort;
  118. ULONG Signature;
  119. ULONG OffsetToPartitionInfo;
  120. ULONG LogicalNumber;
  121. } FT_MEMBER_DESCRIPTION, *PFT_MEMBER_DESCRIPTION;
  122. //
  123. // Definitions for FT volume state.
  124. //
  125. //
  126. // When this state is set, FT assumes at boot time that the volume
  127. // must be initialized and starts a system thread of execution to
  128. // perform the initialization work.
  129. //
  130. #define FT_VOLUME_INITIALIZING 0x0001
  131. #define FT_VOLUME_REGENERATING 0x0002
  132. //
  133. // The description information for an FT component.
  134. //
  135. typedef struct _FT_DESCRIPTION {
  136. USHORT NumberOfMembers;
  137. USHORT Type;
  138. ULONG Reserved;
  139. //
  140. // The volume state will indicate which member is being regenerated
  141. //
  142. FT_STATE FtVolumeState;
  143. //
  144. // Array for NumberOfMembers
  145. //
  146. FT_MEMBER_DESCRIPTION FtMemberDescription[1];
  147. } FT_DESCRIPTION, *PFT_DESCRIPTION;
  148. //
  149. // Header for all FT information.
  150. //
  151. typedef struct _FT_REGISTRY {
  152. USHORT NumberOfComponents;
  153. USHORT ReservedShort;
  154. //
  155. // An array of NumberOfComponents
  156. //
  157. FT_DESCRIPTION FtDescription[1];
  158. } FT_REGISTRY, *PFT_REGISTRY;
  159. #include "poppack.h"
  160. #ifdef __cplusplus
  161. }
  162. #endif
  163. #endif // _NTDDFT_