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.

271 lines
4.8 KiB

  1. /*++
  2. Copyright (c) 1991-1999 Microsoft Corporation
  3. Module Name:
  4. ntdskreg.h
  5. Abstract:
  6. This file contains disk registry data structures.
  7. Authors:
  8. mglass
  9. bobri
  10. Notes:
  11. Revision History:
  12. --*/
  13. #ifndef _NTDSKREG_
  14. #define _NTDSKREG_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. //
  22. // Component types for FT members. If a disk partition
  23. // is not a part of an FT component then it is stamped
  24. // as "NotAnFtMember".
  25. //
  26. typedef enum {
  27. Mirror,
  28. Stripe,
  29. StripeWithParity,
  30. VolumeSet,
  31. NotAnFtMember,
  32. WholeDisk
  33. } FT_TYPE;
  34. //
  35. // FT_PARTITION_STATE is an enumerated type that describes the state of an
  36. // NTFT member.
  37. // Up to one member can be 'orphaned', that is missing or out of sync with
  38. // the other members. The orphaned member will remain orphaned until recovery
  39. // action is commenced in DISKMAN.EXE.
  40. // When READs are directed at an orphaned member, the data is returned from
  41. // the redundant copy. WRITEs go to the secondary members only.
  42. //
  43. // Note that SyncRedundantCopy should NEVER be seen by anything other
  44. // than ft itself.
  45. //
  46. typedef enum _FT_PARTITION_STATE {
  47. Healthy,
  48. Orphaned,
  49. Regenerating,
  50. Initializing,
  51. SyncRedundantCopy
  52. } FT_PARTITION_STATE, *PFT_PARTITION_STATE;
  53. //
  54. // The description of a partition on a disk.
  55. //
  56. #include "pshpack4.h"
  57. typedef struct _DISK_PARTITION {
  58. FT_TYPE FtType;
  59. FT_PARTITION_STATE FtState;
  60. LARGE_INTEGER StartingOffset;
  61. LARGE_INTEGER Length;
  62. LARGE_INTEGER FtLength;
  63. ULONG ReservedTwoLongs[2];
  64. UCHAR DriveLetter;
  65. BOOLEAN AssignDriveLetter;
  66. USHORT LogicalNumber;
  67. USHORT FtGroup;
  68. USHORT FtMember;
  69. BOOLEAN Modified;
  70. UCHAR ReservedChars[3];
  71. } DISK_PARTITION, *PDISK_PARTITION;
  72. //
  73. // The description of a disk.
  74. //
  75. typedef struct _DISK_DESCRIPTION {
  76. USHORT NumberOfPartitions;
  77. USHORT ReservedShort;
  78. ULONG Signature;
  79. //
  80. // An array for NumberOfPartitions
  81. //
  82. DISK_PARTITION Partitions[1];
  83. } DISK_DESCRIPTION, *PDISK_DESCRIPTION;
  84. //
  85. // Header for all disk descriptions.
  86. //
  87. typedef struct _DISK_REGISTRY {
  88. USHORT NumberOfDisks;
  89. USHORT ReservedShort;
  90. //
  91. // An array for NumberOfDisks.
  92. //
  93. DISK_DESCRIPTION Disks[1];
  94. } DISK_REGISTRY, *PDISK_REGISTRY;
  95. #include "poppack.h"
  96. //
  97. // Function prototypes.
  98. //
  99. //
  100. // Set the current registry information.
  101. //
  102. NTSTATUS
  103. DiskRegistrySet(
  104. IN PDISK_REGISTRY Buffer
  105. );
  106. //
  107. // Add a single disk to the registry. This disk is not a part of
  108. // a Fault Tolerance volume.
  109. //
  110. NTSTATUS
  111. DiskRegistryAddNewDisk(
  112. IN PDISK_DESCRIPTION Buffer
  113. );
  114. //
  115. // Get the current registry information.
  116. // A Buffer address == NULL indicates that the caller only wants.
  117. // to know the size of the registry information.
  118. //
  119. NTSTATUS
  120. DiskRegistryGet(
  121. OUT PDISK_REGISTRY Buffer,
  122. OUT PULONG LengthReturned
  123. );
  124. //
  125. // Determine if FT is installed and currently active in the system.
  126. //
  127. BOOLEAN
  128. FtInstalled(
  129. );
  130. //
  131. // Cause an FT set to be initialized at the earliest possible moment.
  132. //
  133. VOID
  134. DiskRegistryInitializeSet(
  135. IN USHORT FtType,
  136. IN USHORT FtGroup
  137. );
  138. //
  139. // Cause an FT set member to be regenerated at the earliest possible moment.
  140. //
  141. VOID
  142. DiskRegistryRegenerateSet(
  143. IN USHORT FtType,
  144. IN USHORT FtGroup,
  145. IN USHORT FtMember
  146. );
  147. //
  148. // Enable the FT driver.
  149. //
  150. BOOLEAN
  151. DiskRegistryEnableFt();
  152. //
  153. // Disable the FT driver.
  154. //
  155. VOID
  156. DiskRegistryDisableFt();
  157. //
  158. // Determine if the existing FT registry information requires the FT driver.
  159. //
  160. BOOLEAN
  161. DiskRegistryRequiresFt();
  162. //
  163. // Update drive letter assignment.
  164. //
  165. BOOLEAN
  166. DiskRegistryAssignDriveLetter(
  167. ULONG Signature,
  168. LARGE_INTEGER StartingOffset,
  169. LARGE_INTEGER Length,
  170. UCHAR DriveLetter
  171. );
  172. //
  173. // Determine if DoubleSpace support is set to automount double space
  174. // volumes on removable media.
  175. //
  176. BOOLEAN
  177. DiskRegistryAutomountCurrentState(
  178. );
  179. //
  180. // Set the automount state for double space volumes on removable media.
  181. //
  182. NTSTATUS
  183. DiskRegistryDblSpaceRemovable(
  184. IN BOOLEAN Automount
  185. );
  186. //
  187. // Set the drive letter for space mount information in the registry.
  188. //
  189. NTSTATUS
  190. DiskRegistryAssignDblSpaceLetter(
  191. IN PWSTR CvfName,
  192. IN WCHAR DriveLetter
  193. );
  194. //
  195. // Set up the registry information for CdRom drive letters.
  196. //
  197. NTSTATUS
  198. DiskRegistryAssignCdRomLetter(
  199. IN PWSTR CdromName,
  200. IN WCHAR DriveLetter
  201. );
  202. #ifdef __cplusplus
  203. }
  204. #endif
  205. #endif // _NTDSKREG_