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.

1391 lines
40 KiB

  1. /*++
  2. Copyright (c) 1991-2001 Microsoft Corporation
  3. Module Name:
  4. ntfssa.hxx
  5. Abstract:
  6. This class supplies the NTFS-only SUPERAREA methods.
  7. Author:
  8. Norbert P. Kusters (norbertk) 29-Jul-91
  9. --*/
  10. #if !defined(_NTFS_SUPERAREA_DEFN_)
  11. #define _NTFS_SUPERAREA_DEFN_
  12. #include "supera.hxx"
  13. #include "hmem.hxx"
  14. #include "untfs.hxx"
  15. #include "message.hxx"
  16. #include "ntfsbit.hxx"
  17. #include "numset.hxx"
  18. DECLARE_CLASS( NTFS_INDEX_TREE );
  19. DECLARE_CLASS( NTFS_MFT_INFO );
  20. #include "indxtree.hxx"
  21. #define CHKDSK_ALGORITHM_NOT_SPECIFIED 0xffff
  22. struct NTFS_CHKDSK_REPORT {
  23. BIG_INT NumUserFiles;
  24. BIG_INT BytesUserData;
  25. BIG_INT NumIndices;
  26. BIG_INT BytesInIndices;
  27. BIG_INT BytesLogFile;
  28. };
  29. DEFINE_POINTER_TYPES( NTFS_CHKDSK_REPORT );
  30. struct NTFS_CHKDSK_INFO {
  31. UCHAR major;
  32. UCHAR minor;
  33. VCN QuotaFileNumber;
  34. VCN ObjectIdFileNumber;
  35. VCN UsnJournalFileNumber;
  36. VCN ReparseFileNumber;
  37. BOOLEAN Verbose;
  38. ULONG NumFiles;
  39. ULONG BaseFrsCount;
  40. BIG_INT TotalNumFileNames;
  41. PUSHORT NumFileNames; // array of length 'NumFiles'
  42. PSHORT ReferenceCount; // array of length 'NumFiles'
  43. NTFS_BITMAP FilesWithIndices;
  44. ULONG CountFilesWithIndices;
  45. NTFS_BITMAP IndexEntriesToCheck;
  46. BOOLEAN IndexEntriesToCheckIsSet;
  47. NUMBER_SET FilesWithEas;
  48. NUMBER_SET ChildFrs;
  49. NUMBER_SET BadFiles;
  50. NTFS_BITMAP FilesWhoNeedData;
  51. BOOLEAN CrossLinkYet; // Is the following field valid.
  52. ULONG CrossLinkedFile; // File cross-linked with following.
  53. ULONG CrossLinkedAttribute;
  54. DSTRING CrossLinkedName;
  55. ULONG CrossLinkStart; // Start of cross-linked portion.
  56. ULONG CrossLinkLength; // Length of cross-link.
  57. NUMBER_SET FilesWithNoReferences;
  58. NUMBER_SET FilesWithTooManyFileNames;
  59. NUMBER_SET FilesWithObjectId;
  60. NTFS_BITMAP FilesWithReparsePoint;
  61. ULONG TotalNumSID;
  62. ULONG ExitStatus; // To be returned to chkdsk.exe
  63. #if defined(_AUTOCHECK_)
  64. ULONG AvailablePages;
  65. #endif
  66. };
  67. DEFINE_POINTER_TYPES( NTFS_CHKDSK_INFO );
  68. //
  69. // NTFS_CENSUS_INFO -- this is used by convert to determine how
  70. // much space will be needed to convert an NTFS volume.
  71. //
  72. struct NTFS_CENSUS_INFO {
  73. ULONG NumFiles; // Total number of files on volume.
  74. ULONG BytesLgResidentFiles; // Bytes in "large" resident files.
  75. ULONG BytesIndices; // Bytes in indices.
  76. ULONG BytesExternalExtentLists;
  77. ULONG BytesFileNames; // Total bytes in file name attributes.
  78. };
  79. DEFINE_POINTER_TYPES( NTFS_CENSUS_INFO );
  80. DECLARE_CLASS( LOG_IO_DP_DRIVE );
  81. DECLARE_CLASS( WSTRING );
  82. DECLARE_CLASS( NTFS_MASTER_FILE_TABLE );
  83. DECLARE_CLASS( NTFS_BITMAP );
  84. DECLARE_CLASS( NTFS_FILE_RECORD_SEGMENT );
  85. DECLARE_CLASS( NTFS_ATTRIBUTE );
  86. DECLARE_CLASS( NTFS_ATTRIBUTE_COLUMNS );
  87. DECLARE_CLASS( NTFS_FRS_STRUCTURE );
  88. DECLARE_CLASS( NTFS_ATTRIBUTE_LIST );
  89. DECLARE_CLASS( CONTAINER );
  90. DECLARE_CLASS( SEQUENTIAL_CONTAINER );
  91. DECLARE_CLASS( LIST );
  92. DECLARE_CLASS( NTFS_EXTENT_LIST );
  93. DECLARE_CLASS( NUMBER_SET );
  94. DECLARE_CLASS( NTFS_UPCASE_TABLE );
  95. DECLARE_CLASS( DIGRAPH );
  96. DECLARE_CLASS( NTFS_LOG_FILE );
  97. DECLARE_CLASS( NTFS_MFT_FILE );
  98. //
  99. // Types of message for SynchronizeMft()
  100. //
  101. enum MessageMode {
  102. CorrectMessage = 0,
  103. SuppressMessage,
  104. UpdateMessage
  105. };
  106. // This global variable used by CHKDSK to compute the largest
  107. // LSN on the volume.
  108. extern LSN LargestLsnEncountered;
  109. extern LARGE_INTEGER LargestUsnEncountered;
  110. extern ULONG64 FrsOfLargestUsnEncountered;
  111. CONST ULONG LsnResetThreshholdHighPart = 0x10000;
  112. CONST UCHAR UpdateSequenceArrayCheckValueMinorError = 2;// should always be non-zero
  113. CONST UCHAR UpdateSequenceArrayCheckValueOk = 1; // should always be non-zero
  114. BOOLEAN
  115. ExtractExtendInfo(
  116. IN OUT PNTFS_INDEX_TREE Index,
  117. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  118. IN OUT PMESSAGE Message
  119. );
  120. BOOLEAN
  121. UpdateChkdskInfo(
  122. IN OUT PNTFS_FRS_STRUCTURE Frs,
  123. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  124. IN OUT PMESSAGE Message
  125. );
  126. class NTFS_SA : public SUPERAREA {
  127. public:
  128. UNTFS_EXPORT
  129. DECLARE_CONSTRUCTOR(NTFS_SA);
  130. VIRTUAL
  131. UNTFS_EXPORT
  132. ~NTFS_SA(
  133. );
  134. NONVIRTUAL
  135. UNTFS_EXPORT
  136. BOOLEAN
  137. Initialize(
  138. IN OUT PLOG_IO_DP_DRIVE Drive,
  139. IN OUT PMESSAGE Message,
  140. IN LCN CvtStartZone DEFAULT 0,
  141. IN BIG_INT CvtZoneSize DEFAULT 0
  142. );
  143. VIRTUAL
  144. PVOID
  145. GetBuf(
  146. );
  147. VIRTUAL
  148. BOOLEAN
  149. Create(
  150. IN PCNUMBER_SET BadSectors,
  151. IN OUT PMESSAGE Message,
  152. IN PCWSTRING Label DEFAULT NULL,
  153. IN ULONG Flags DEFAULT FORMAT_BACKWARD_COMPATIBLE,
  154. IN ULONG ClusterSize DEFAULT 0,
  155. IN ULONG VirtualSectors DEFAULT 0
  156. );
  157. VIRTUAL
  158. BOOLEAN
  159. Create(
  160. IN PCNUMBER_SET BadSectors,
  161. IN ULONG ClusterFactor,
  162. IN ULONG FrsSize,
  163. IN ULONG ClustersPerIndexBuffer,
  164. IN ULONG InitialLogFileSize,
  165. IN BOOLEAN BackwardCompatible,
  166. IN OUT PMESSAGE Message,
  167. IN PCWSTRING Label DEFAULT NULL
  168. );
  169. NONVIRTUAL
  170. UNTFS_EXPORT
  171. BOOLEAN
  172. CreateElementaryStructures(
  173. IN OUT PNTFS_BITMAP VolumeBitmap,
  174. IN ULONG ClusterFactor,
  175. IN ULONG FrsSize,
  176. IN ULONG IndexBufferSize,
  177. IN ULONG InitialLogFileSize,
  178. IN PCNUMBER_SET BadSectors,
  179. IN BOOLEAN BackwardCompatible,
  180. IN BOOLEAN IsConvert,
  181. IN OUT PMESSAGE Message,
  182. IN PBIOS_PARAMETER_BLOCK OldBpb OPTIONAL,
  183. IN PCWSTRING Label DEFAULT NULL
  184. );
  185. STATIC
  186. UNTFS_EXPORT
  187. ULONG
  188. QuerySectorsInElementaryStructures(
  189. IN PCDP_DRIVE Drive,
  190. IN ULONG ClusterFactor DEFAULT 0,
  191. IN ULONG FrsSize DEFAULT 0,
  192. IN ULONG ClustersPerIndexBuffer DEFAULT 0,
  193. IN ULONG InitialLogFileSize DEFAULT 0
  194. );
  195. STATIC
  196. ULONG
  197. QueryDefaultClusterFactor(
  198. IN PCDP_DRIVE Drive
  199. );
  200. STATIC
  201. UNTFS_EXPORT
  202. ULONG
  203. QueryDefaultFrsSize(
  204. IN PCDP_DRIVE Drive,
  205. IN ULONG ClusterFactor
  206. );
  207. STATIC
  208. UNTFS_EXPORT
  209. ULONG
  210. QueryDefaultClustersPerIndexBuffer(
  211. IN PCDP_DRIVE Drive,
  212. IN ULONG ClusterFactor
  213. );
  214. VIRTUAL
  215. BOOLEAN
  216. VerifyAndFix(
  217. IN FIX_LEVEL FixLevel,
  218. IN OUT PMESSAGE Message,
  219. IN ULONG Flags,
  220. IN ULONG DesiredLogFileSize DEFAULT 0,
  221. IN USHORT Algorithm DEFAULT 0,
  222. OUT PULONG ExitStatus DEFAULT NULL,
  223. IN PCWSTRING DriveLetter DEFAULT NULL
  224. );
  225. VIRTUAL
  226. BOOLEAN
  227. RecoverFile(
  228. IN PCWSTRING FullPathFileName,
  229. IN OUT PMESSAGE Message
  230. );
  231. UNTFS_EXPORT
  232. BOOLEAN
  233. Read(
  234. );
  235. UNTFS_EXPORT
  236. BOOLEAN
  237. Read(
  238. IN OUT PMESSAGE Message
  239. );
  240. VIRTUAL
  241. BOOLEAN
  242. Write(
  243. );
  244. VIRTUAL
  245. BOOLEAN
  246. Write(
  247. IN OUT PMESSAGE Message
  248. );
  249. NONVIRTUAL
  250. BIG_INT
  251. QueryVolumeSectors(
  252. ) CONST;
  253. NONVIRTUAL
  254. VOID
  255. SetVolumeSectors(
  256. BIG_INT NewVolumeSectors
  257. );
  258. NONVIRTUAL
  259. UNTFS_EXPORT
  260. UCHAR
  261. QueryClusterFactor(
  262. ) CONST;
  263. NONVIRTUAL
  264. LCN
  265. QueryMftStartingLcn(
  266. ) CONST;
  267. NONVIRTUAL
  268. LCN
  269. QueryMft2StartingLcn(
  270. ) CONST;
  271. NONVIRTUAL
  272. VOID
  273. SetMftStartingLcn(
  274. IN LCN Lcn
  275. );
  276. NONVIRTUAL
  277. VOID
  278. SetMft2StartingLcn(
  279. IN LCN Lcn
  280. );
  281. UNTFS_EXPORT
  282. NONVIRTUAL
  283. BOOLEAN
  284. SetVolumeFlag(
  285. IN USHORT FlagsToSet,
  286. OUT PBOOLEAN CorruptVolume DEFAULT NULL
  287. );
  288. NONVIRTUAL
  289. ULONG
  290. QueryFrsSize(
  291. ) CONST;
  292. NONVIRTUAL
  293. PARTITION_SYSTEM_ID
  294. QuerySystemId(
  295. ) CONST;
  296. NONVIRTUAL
  297. LCN
  298. QueryCvtZone(
  299. ) CONST;
  300. NONVIRTUAL
  301. BIG_INT
  302. QueryCvtZoneSize(
  303. ) CONST;
  304. NONVIRTUAL
  305. UNTFS_EXPORT
  306. BOOLEAN
  307. WriteRemainingBootCode(
  308. );
  309. UNTFS_EXPORT
  310. NONVIRTUAL
  311. USHORT
  312. QueryVolumeFlagsAndLabel(
  313. OUT PBOOLEAN CorruptVolume DEFAULT NULL,
  314. OUT PUCHAR MajorVersion DEFAULT NULL,
  315. OUT PUCHAR MinorVersion DEFAULT NULL,
  316. OUT PWSTRING Label DEFAULT NULL
  317. );
  318. NONVIRTUAL
  319. BOOLEAN
  320. ClearVolumeFlag(
  321. IN USHORT FlagsToClear,
  322. IN OUT PNTFS_LOG_FILE LogFile OPTIONAL,
  323. IN BOOLEAN WriteSecondLogFilePage OPTIONAL,
  324. IN LSN LargestVolumeLsn OPTIONAL,
  325. OUT PBOOLEAN CorruptVolume DEFAULT NULL,
  326. IN BOOLEAN UpdateMirror DEFAULT FALSE
  327. );
  328. STATIC
  329. UCHAR
  330. PostReadMultiSectorFixup(
  331. IN OUT PVOID MultiSectorBuffer,
  332. IN ULONG BufferSize,
  333. IN OUT PIO_DP_DRIVE Drive,
  334. IN ULONG VaildSize DEFAULT MAXULONG
  335. );
  336. STATIC
  337. VOID
  338. PreWriteMultiSectorFixup(
  339. IN OUT PVOID MultiSectorBuffer,
  340. IN ULONG BufferSize
  341. );
  342. STATIC
  343. UNTFS_EXPORT
  344. BOOLEAN
  345. IsDosName(
  346. IN PCFILE_NAME FileName
  347. );
  348. STATIC
  349. BOOLEAN
  350. IsValidLabel(
  351. IN PCWSTRING Label
  352. );
  353. NONVIRTUAL
  354. UNTFS_EXPORT
  355. BOOLEAN
  356. QueryFrsFromPath(
  357. IN PCWSTRING FullPathFileName,
  358. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  359. IN OUT PNTFS_BITMAP VolumeBitmap,
  360. OUT PNTFS_FILE_RECORD_SEGMENT TargetFrs,
  361. OUT PBOOLEAN SystemFile,
  362. OUT PBOOLEAN InternalError
  363. );
  364. NONVIRTUAL
  365. UNTFS_EXPORT
  366. BOOLEAN
  367. TakeCensus(
  368. IN PNTFS_MASTER_FILE_TABLE Mft,
  369. IN ULONG ResidentSizeThreshhold,
  370. OUT PNTFS_CENSUS_INFO Census
  371. );
  372. STATIC
  373. VOID
  374. SetVersionNumber(
  375. IN UCHAR Major,
  376. IN UCHAR Minor
  377. );
  378. STATIC
  379. VOID
  380. QueryVersionNumber(
  381. OUT PUCHAR Major,
  382. OUT PUCHAR Minor
  383. );
  384. STATIC
  385. BOOLEAN
  386. DumpMessagesToFile(
  387. IN PCWSTRING FileName,
  388. IN OUT PNTFS_MFT_FILE MftFile,
  389. IN OUT PMESSAGE Message
  390. );
  391. NONVIRTUAL
  392. BOOLEAN
  393. ResizeCleanLogFile(
  394. IN OUT PMESSAGE Message,
  395. IN BOOLEAN AlwaysResize,
  396. IN ULONG DesiredSize
  397. );
  398. NONVIRTUAL
  399. BOOLEAN
  400. DownGradeNtfs(
  401. IN OUT PMESSAGE Message,
  402. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  403. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo
  404. );
  405. NONVIRTUAL
  406. UCHAR
  407. GetNumberOfStages(
  408. );
  409. NONVIRTUAL
  410. VOID
  411. SetNumberOfStages(
  412. IN UCHAR Number
  413. );
  414. NONVIRTUAL
  415. NTSTATUS
  416. FilesReadAhead(
  417. IN BIG_INT TotalNumberOfFrs,
  418. IN PVCN FirstFrsNumber,
  419. IN PULONG NumberOfFrsToRead,
  420. IN PNTFS_FRS_STRUCTURE FrsStruc1,
  421. IN PNTFS_FRS_STRUCTURE FrsStruc2,
  422. IN PHMEM Hmem1,
  423. IN PHMEM Hmem2,
  424. OUT HANDLE ReadAhead,
  425. IN HANDLE ReadReady,
  426. IN PNTFS_ATTRIBUTE MftData,
  427. IN PNTFS_UPCASE_TABLE UpCaseTable
  428. );
  429. NONVIRTUAL
  430. NTSTATUS
  431. SDReadAhead(
  432. IN BIG_INT TotalNumberOfFrs,
  433. IN PVCN FirstFrsNumber,
  434. IN PULONG NumberOfFrsToRead,
  435. IN PNTFS_FILE_RECORD_SEGMENT Frs1,
  436. IN PNTFS_FILE_RECORD_SEGMENT Frs2,
  437. OUT HANDLE ReadAhead,
  438. IN HANDLE ReadReady,
  439. IN PNTFS_MASTER_FILE_TABLE Mft
  440. );
  441. VOID
  442. PrintFormatReport (
  443. IN OUT PMESSAGE Message,
  444. IN PFILE_FS_SIZE_INFORMATION FsSizeInfo,
  445. IN PFILE_FS_VOLUME_INFORMATION FsVolInfo
  446. );
  447. private:
  448. NONVIRTUAL
  449. BOOLEAN
  450. FetchMftDataAttribute(
  451. IN OUT PMESSAGE Message,
  452. OUT PNTFS_ATTRIBUTE MftData
  453. );
  454. NONVIRTUAL
  455. BOOLEAN
  456. ValidateCriticalFrs(
  457. IN OUT PNTFS_ATTRIBUTE MftData,
  458. IN OUT PMESSAGE Message,
  459. IN FIX_LEVEL FixLevel
  460. );
  461. NONVIRTUAL
  462. BOOLEAN
  463. QueryDefaultAttributeDefinitionTable(
  464. OUT PNTFS_ATTRIBUTE_COLUMNS AttributeDefinitionTable,
  465. IN OUT PMESSAGE Message
  466. );
  467. NONVIRTUAL
  468. BOOLEAN
  469. FetchAttributeDefinitionTable(
  470. IN OUT PNTFS_ATTRIBUTE MftData,
  471. IN OUT PMESSAGE Message,
  472. OUT PNTFS_ATTRIBUTE_COLUMNS AttributeDefinitionTable
  473. );
  474. NONVIRTUAL
  475. BOOLEAN
  476. FetchUpcaseTable(
  477. IN OUT PNTFS_ATTRIBUTE MftData,
  478. IN OUT PMESSAGE Message,
  479. OUT PNTFS_UPCASE_TABLE UpcaseTable
  480. );
  481. NONVIRTUAL
  482. BOOLEAN
  483. VerifyAndFixMultiFrsFile(
  484. IN OUT PNTFS_FRS_STRUCTURE BaseFrs,
  485. IN OUT PNTFS_ATTRIBUTE_LIST AttributeList,
  486. IN PNTFS_ATTRIBUTE MftData,
  487. IN PCNTFS_ATTRIBUTE_COLUMNS AttributeDefTable,
  488. IN OUT PNTFS_BITMAP VolumeBitmap,
  489. IN OUT PNTFS_BITMAP MftBitmap,
  490. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  491. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  492. IN FIX_LEVEL FixLevel,
  493. IN OUT PMESSAGE Message,
  494. IN OUT PBOOLEAN DiskErrorsFound
  495. );
  496. NONVIRTUAL
  497. BOOLEAN
  498. QueryListOfFrs(
  499. IN PCNTFS_FRS_STRUCTURE BaseFrs,
  500. IN PCNTFS_ATTRIBUTE_LIST AttributeList,
  501. IN OUT PNTFS_ATTRIBUTE MftData,
  502. OUT PNUMBER_SET ChildFileNumbers,
  503. IN OUT PMESSAGE Message
  504. );
  505. NONVIRTUAL
  506. BOOLEAN
  507. VerifyAndFixChildFrs(
  508. IN PCNUMBER_SET ChildFileNumbers,
  509. IN PNTFS_ATTRIBUTE MftData,
  510. IN PCNTFS_ATTRIBUTE_COLUMNS AttributeDefTable,
  511. IN PNTFS_UPCASE_TABLE UpcaseTable,
  512. OUT PHMEM* ChildFrsHmemList,
  513. IN OUT PCONTAINER ChildFrsList,
  514. IN FIX_LEVEL FixLevel,
  515. IN OUT PMESSAGE Message,
  516. IN OUT PBOOLEAN DiskErrorsFound
  517. );
  518. NONVIRTUAL
  519. BOOLEAN
  520. EnsureWellDefinedAttrList(
  521. IN PNTFS_FRS_STRUCTURE BaseFrs,
  522. IN OUT PNTFS_ATTRIBUTE_LIST AttributeList,
  523. IN PCSEQUENTIAL_CONTAINER ChildFrsList,
  524. IN OUT PNTFS_BITMAP VolumeBitmap,
  525. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  526. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  527. IN FIX_LEVEL FixLevel,
  528. IN OUT PMESSAGE Message,
  529. IN OUT PBOOLEAN DiskErrorsFound
  530. );
  531. NONVIRTUAL
  532. BOOLEAN
  533. VerifyAndFixAttribute(
  534. IN PCLIST Attribute,
  535. IN OUT PNTFS_ATTRIBUTE_LIST AttributeList,
  536. IN OUT PNTFS_BITMAP VolumeBitmap,
  537. IN PCNTFS_FRS_STRUCTURE BaseFrs,
  538. OUT PBOOLEAN ErrorsFound,
  539. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  540. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  541. IN OUT PMESSAGE Message
  542. );
  543. NONVIRTUAL
  544. BOOLEAN
  545. EnsureSurjectiveAttrList(
  546. IN OUT PNTFS_FRS_STRUCTURE BaseFrs,
  547. IN PCNTFS_ATTRIBUTE_LIST AttributeList,
  548. IN OUT PSEQUENTIAL_CONTAINER ChildFrsList,
  549. IN FIX_LEVEL FixLevel,
  550. IN OUT PMESSAGE Message,
  551. IN OUT PBOOLEAN DiskErrorsFound
  552. );
  553. STATIC
  554. BOOLEAN
  555. AreBitmapsEqual(
  556. IN OUT PNTFS_ATTRIBUTE BitmapAttribute,
  557. IN PCNTFS_BITMAP Bitmap,
  558. IN BIG_INT MinimumBitmapSize OPTIONAL,
  559. IN OUT PMESSAGE Message,
  560. OUT PBOOLEAN CompleteFailure,
  561. OUT PBOOLEAN SecondIsSubset DEFAULT NULL
  562. );
  563. NONVIRTUAL
  564. BOOLEAN
  565. ValidateIndices(
  566. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  567. OUT PDIGRAPH DirectoryDigraph,
  568. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  569. IN PCNTFS_ATTRIBUTE_COLUMNS AttributeDefTable,
  570. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  571. IN OUT PNUMBER_SET BadClusters,
  572. IN USHORT Algorithm,
  573. IN BOOLEAN SkipEntriesScan,
  574. IN BOOLEAN SkipCycleScan,
  575. IN FIX_LEVEL FixLevel,
  576. IN OUT PMESSAGE Message,
  577. IN OUT PBOOLEAN DiskErrorsFound
  578. );
  579. NONVIRTUAL
  580. BOOLEAN
  581. VerifyAndFixIndex(
  582. IN PNTFS_CHKDSK_INFO ChkdskInfo,
  583. IN OUT PNTFS_ATTRIBUTE RootIndex,
  584. IN OUT PNTFS_ATTRIBUTE IndexAllocation OPTIONAL,
  585. OUT PNTFS_BITMAP AllocationBitmap OPTIONAL,
  586. IN VCN FileNumber,
  587. IN OUT PNUMBER_SET BadClusters,
  588. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  589. IN PCNTFS_ATTRIBUTE_COLUMNS AttributeDefTable,
  590. OUT PBOOLEAN Tube,
  591. IN OUT PLONG Order,
  592. IN FIX_LEVEL Fixlevel,
  593. IN OUT PMESSAGE Message,
  594. IN OUT PBOOLEAN DiskErrorsFound
  595. );
  596. NONVIRTUAL
  597. BOOLEAN
  598. TraverseIndexTree(
  599. IN OUT PINDEX_HEADER IndexHeader,
  600. IN ULONG IndexLength,
  601. IN OUT PNTFS_ATTRIBUTE IndexAllocation OPTIONAL,
  602. IN OUT PNTFS_BITMAP AllocationBitmap OPTIONAL,
  603. IN ULONG BytesPerBlock,
  604. OUT PBOOLEAN Tube,
  605. OUT PBOOLEAN Changes,
  606. IN VCN FileNumber,
  607. IN PCWSTRING AttributeName,
  608. IN INDEX_ENTRY_TYPE IndexEntryType,
  609. IN OUT PBOOLEAN RecoveredAttribute,
  610. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  611. IN OUT PNUMBER_SET BadClusters,
  612. OUT PINDEX_ENTRY FirstLeafIndexEntry,
  613. OUT PINDEX_ENTRY LastLeafIndexEntry,
  614. IN OUT PLONG Order,
  615. IN ULONG CollationRule,
  616. IN FIX_LEVEL FixLevel,
  617. IN OUT PMESSAGE Message,
  618. IN OUT PBOOLEAN DiskErrorsFound
  619. );
  620. NONVIRTUAL
  621. BOOLEAN
  622. ValidateEntriesInIndex(
  623. IN OUT PNTFS_INDEX_TREE Index,
  624. IN OUT PNTFS_FILE_RECORD_SEGMENT IndexFrs,
  625. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  626. IN OUT PDIGRAPH DirectoryDigraph,
  627. IN OUT PULONG PercentDone,
  628. IN OUT PBIG_INT NumFileNames,
  629. OUT PBOOLEAN Changes,
  630. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  631. IN BOOLEAN SkipEntriesScan,
  632. IN BOOLEAN SkipCycleScan,
  633. IN FIX_LEVEL FixLevel,
  634. IN OUT PMESSAGE Message,
  635. IN OUT PBOOLEAN DiskErrorsFound
  636. );
  637. NONVIRTUAL
  638. BOOLEAN
  639. ValidateEntriesInIndex(
  640. IN OUT PNTFS_INDEX_TREE Index,
  641. IN OUT PNTFS_FILE_RECORD_SEGMENT IndexFrs,
  642. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  643. IN PNTFS_MFT_INFO MftInfo,
  644. IN OUT PDIGRAPH DirectoryDigraph,
  645. IN OUT PULONG PercentDone,
  646. IN OUT PBIG_INT NumFileNames,
  647. OUT PBOOLEAN Changes,
  648. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  649. IN BOOLEAN SkipCycleScan,
  650. IN FIX_LEVEL FixLevel,
  651. IN OUT PMESSAGE Message,
  652. IN OUT PBOOLEAN DiskErrorsFound
  653. );
  654. NONVIRTUAL
  655. BOOLEAN
  656. ValidateEntriesInIndex2(
  657. IN OUT PNTFS_INDEX_TREE Index,
  658. IN OUT PNTFS_FILE_RECORD_SEGMENT IndexFrs,
  659. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  660. IN OUT PDIGRAPH DirectoryDigraph,
  661. OUT PBOOLEAN Changes,
  662. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  663. IN BOOLEAN SkipCycleScan,
  664. IN FIX_LEVEL FixLevel,
  665. IN OUT PMESSAGE Message,
  666. IN OUT PBOOLEAN DiskErrorsFound
  667. );
  668. NONVIRTUAL
  669. BOOLEAN
  670. ValidateEntriesInObjIdIndex(
  671. IN OUT PNTFS_INDEX_TREE Index,
  672. IN OUT PNTFS_FILE_RECORD_SEGMENT IndexFrs,
  673. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  674. OUT PBOOLEAN Changes,
  675. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  676. IN FIX_LEVEL FixLevel,
  677. IN OUT PMESSAGE Message,
  678. IN OUT PBOOLEAN DiskErrorsFound
  679. );
  680. NONVIRTUAL
  681. BOOLEAN
  682. ValidateEntriesInReparseIndex(
  683. IN OUT PNTFS_INDEX_TREE Index,
  684. IN OUT PNTFS_FILE_RECORD_SEGMENT IndexFrs,
  685. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  686. OUT PBOOLEAN Changes,
  687. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  688. IN FIX_LEVEL FixLevel,
  689. IN OUT PMESSAGE Message,
  690. IN OUT PBOOLEAN DiskErrorsFound
  691. );
  692. NONVIRTUAL
  693. BOOLEAN
  694. RecoverOrphans(
  695. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  696. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  697. IN OUT PDIGRAPH DirectoryDigraph,
  698. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  699. IN BOOLEAN SkipCycleScan,
  700. IN FIX_LEVEL FixLevel,
  701. IN OUT PMESSAGE Message
  702. );
  703. NONVIRTUAL
  704. BOOLEAN
  705. ProperOrphanRecovery(
  706. IN OUT PNUMBER_SET Orphans,
  707. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  708. IN OUT PDIGRAPH DirectoryDigraph,
  709. IN BOOLEAN SkipCycleScan,
  710. IN PCNTFS_CHKDSK_INFO ChkdskInfo,
  711. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  712. IN FIX_LEVEL FixLevel,
  713. IN OUT PMESSAGE Message
  714. );
  715. NONVIRTUAL
  716. BOOLEAN
  717. OldOrphanRecovery(
  718. IN OUT PNUMBER_SET Orphans,
  719. IN PCNTFS_CHKDSK_INFO ChkdskInfo,
  720. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  721. IN OUT PNTFS_FILE_RECORD_SEGMENT RootFrs,
  722. IN OUT PNTFS_INDEX_TREE RootIndex,
  723. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  724. IN FIX_LEVEL FixLevel,
  725. IN OUT PMESSAGE Message
  726. );
  727. NONVIRTUAL
  728. BOOLEAN
  729. HotfixMftData(
  730. IN OUT PNTFS_ATTRIBUTE MftData,
  731. IN OUT PNTFS_BITMAP VolumeBitmap,
  732. IN PNUMBER_SET UnreadableFrs,
  733. OUT PNUMBER_SET BadClusters,
  734. IN FIX_LEVEL FixLevel,
  735. IN OUT PMESSAGE Message
  736. );
  737. NONVIRTUAL
  738. BOOLEAN
  739. SynchronizeMft(
  740. IN OUT PNTFS_INDEX_TREE RootIndex,
  741. IN PNTFS_MASTER_FILE_TABLE InternalMft,
  742. OUT PBOOLEAN Errors,
  743. IN FIX_LEVEL FixLevel,
  744. IN OUT PMESSAGE Message,
  745. IN MessageMode MsgMode
  746. );
  747. NONVIRTUAL
  748. BOOLEAN
  749. CheckAllForData(
  750. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  751. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  752. IN FIX_LEVEL FixLevel,
  753. IN OUT PMESSAGE Message
  754. );
  755. NONVIRTUAL
  756. BOOLEAN
  757. ValidateSecurityDescriptors(
  758. IN PNTFS_CHKDSK_INFO ChkdskInfo,
  759. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  760. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  761. IN OUT PNUMBER_SET BadClusters,
  762. IN BOOLEAN SkipEntriesScan,
  763. IN FIX_LEVEL FixLevel,
  764. IN OUT PMESSAGE Message
  765. );
  766. NONVIRTUAL
  767. BOOLEAN
  768. ValidateUsnJournal(
  769. IN PNTFS_CHKDSK_INFO ChkdskInfo,
  770. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  771. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  772. IN OUT PNUMBER_SET BadClusters,
  773. IN FIX_LEVEL FixLevel,
  774. IN OUT PMESSAGE Message
  775. );
  776. NONVIRTUAL
  777. BOOLEAN
  778. CheckExtendSystemFiles(
  779. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  780. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  781. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  782. IN FIX_LEVEL FixLevel,
  783. IN OUT PMESSAGE Message
  784. );
  785. NONVIRTUAL
  786. BOOLEAN
  787. ResetLsns(
  788. IN OUT PMESSAGE Message,
  789. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  790. IN BOOLEAN SkipRootIndex
  791. );
  792. NONVIRTUAL
  793. BOOLEAN
  794. ResetUsns(
  795. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  796. IN FIX_LEVEL FixLevel,
  797. IN OUT PMESSAGE Message,
  798. IN OUT PNTFS_MASTER_FILE_TABLE Mft
  799. );
  800. NONVIRTUAL
  801. BOOLEAN
  802. FindHighestLsn(
  803. IN OUT PMESSAGE Message,
  804. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  805. OUT PLSN HighestLsn
  806. );
  807. NONVIRTUAL
  808. BOOLEAN
  809. LogFileMayNeedResize(
  810. );
  811. NONVIRTUAL
  812. BOOLEAN
  813. StartProcessingFiles(
  814. IN BIG_INT TotalNumberOfFrs,
  815. IN OUT PBOOLEAN DiskErrorFound,
  816. IN FIX_LEVEL FixLevel,
  817. IN OUT PNTFS_ATTRIBUTE MftData,
  818. IN OUT PNTFS_BITMAP MftBitmap,
  819. IN OUT PNTFS_BITMAP VolumeBitmap,
  820. IN OUT PNTFS_UPCASE_TABLE UpcaseTable,
  821. IN OUT PNTFS_ATTRIBUTE_COLUMNS AttributeDefTable,
  822. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  823. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  824. IN OUT PMESSAGE Message
  825. );
  826. NONVIRTUAL
  827. BOOLEAN
  828. ProcessFiles(
  829. IN BIG_INT TotalNumberOfFrs,
  830. OUT PVCN FirstFrsNumber,
  831. OUT PULONG NumberOfFrsToRead,
  832. IN OUT PBOOLEAN DiskErrorFound,
  833. IN PNTFS_FRS_STRUCTURE FrsStruc1,
  834. IN PNTFS_FRS_STRUCTURE FrsStruc2,
  835. IN HANDLE ReadReady,
  836. OUT HANDLE ReadAhead,
  837. IN HANDLE ThreadHandle,
  838. IN FIX_LEVEL FixLevel,
  839. IN OUT PNTFS_ATTRIBUTE MftData,
  840. IN OUT PNTFS_BITMAP MftBitmap,
  841. IN OUT PNTFS_BITMAP VolumeBitmap,
  842. IN OUT PNTFS_UPCASE_TABLE UpcaseTable,
  843. IN OUT PNTFS_ATTRIBUTE_COLUMNS AttributeDefTable,
  844. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  845. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  846. IN OUT PMESSAGE Message
  847. );
  848. NONVIRTUAL
  849. BOOLEAN
  850. StartProcessingSD(
  851. IN BIG_INT TotalNumberOfFrs,
  852. IN FIX_LEVEL FixLevel,
  853. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  854. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  855. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  856. IN OUT PNTFS_FILE_RECORD_SEGMENT SecurityFrs,
  857. IN OUT PNUMBER_SET BadClusters,
  858. IN OUT PULONG ErrFixedStatus,
  859. IN BOOLEAN SecurityDescriptorStreamPresent,
  860. IN OUT PNUMBER_SET SidEntries,
  861. IN OUT PNUMBER_SET SidEntries2,
  862. IN OUT PBOOLEAN HasErrors,
  863. IN BOOLEAN SkipEntriesScan,
  864. IN OUT PBOOLEAN ChkdskErrCouldNotFix,
  865. IN OUT PMESSAGE Message
  866. );
  867. NONVIRTUAL
  868. BOOLEAN
  869. ProcessSD(
  870. IN BIG_INT TotalNumberOfFrs,
  871. OUT PVCN FirstFrsNumber,
  872. OUT PULONG NumberOfFrsToRead,
  873. IN PNTFS_FILE_RECORD_SEGMENT Frs1,
  874. IN PNTFS_FILE_RECORD_SEGMENT Frs2,
  875. IN HANDLE ReadReady,
  876. OUT HANDLE ReadAhead,
  877. IN HANDLE ThreadHandle,
  878. IN FIX_LEVEL FixLevel,
  879. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  880. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  881. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  882. IN OUT PNTFS_FILE_RECORD_SEGMENT SecurityFrs,
  883. IN OUT PNUMBER_SET BadClusters,
  884. IN OUT PULONG ErrFixedStatus,
  885. IN BOOLEAN SecurityDescriptorStreamPresent,
  886. IN OUT PNUMBER_SET SidEntries,
  887. IN OUT PNUMBER_SET SidEntries2,
  888. IN OUT PBOOLEAN HasErrors,
  889. IN BOOLEAN SkipEntriesScan,
  890. IN OUT PBOOLEAN ChkdskErrCouldNotFix,
  891. IN OUT PMESSAGE Message
  892. );
  893. NONVIRTUAL
  894. BOOLEAN
  895. ProcessSD2(
  896. IN BIG_INT TotalNumberOfFrs,
  897. IN FIX_LEVEL FixLevel,
  898. IN OUT PNTFS_MASTER_FILE_TABLE Mft,
  899. IN OUT PNTFS_CHKDSK_REPORT ChkdskReport,
  900. IN OUT PNTFS_CHKDSK_INFO ChkdskInfo,
  901. IN OUT PNTFS_FILE_RECORD_SEGMENT SecurityFrs,
  902. IN OUT PNUMBER_SET BadClusters,
  903. IN OUT PULONG ErrFixedStatus,
  904. IN BOOLEAN SecurityDescriptorStreamPresent,
  905. IN OUT PNUMBER_SET SidEntries,
  906. IN OUT PNUMBER_SET SidEntries2,
  907. IN OUT PBOOLEAN HasErrors,
  908. IN BOOLEAN SkipEntriesScan,
  909. IN OUT PBOOLEAN ChkdskErrCouldNotFix,
  910. IN OUT PMESSAGE Message
  911. );
  912. HMEM _hmem; // memory for SECRUN
  913. PPACKED_BOOT_SECTOR _boot_sector; // packed boot sector
  914. BIOS_PARAMETER_BLOCK _bpb; // unpacked BPB
  915. BIG_INT _boot2; // alternate boot sector
  916. BIG_INT _boot3; // second alternate boot sector
  917. UCHAR _NumberOfStages;// minimum number of stages for chkdsk
  918. // to go thru
  919. NONVIRTUAL
  920. VOID
  921. Construct (
  922. );
  923. NONVIRTUAL
  924. VOID
  925. Destroy(
  926. );
  927. BOOLEAN _cleanup_that_requires_reboot;
  928. LCN _cvt_zone; // convert region for mft, logfile, etc.
  929. BIG_INT _cvt_zone_size; // convert region size in terms of clusters
  930. // This version number is used to determine what format
  931. // is used for the compressed mapping pairs of sparse
  932. // files. Ideally, this information should be tracked
  933. // on a per-volume basis; however, that would require
  934. // extensive changes to the UNTFS class interfaces.
  935. //
  936. STATIC UCHAR _MajorVersion, _MinorVersion;
  937. };
  938. INLINE
  939. PVOID
  940. NTFS_SA::GetBuf(
  941. )
  942. /*++
  943. Routine Description:
  944. This routine returns a pointer to the write buffer for the NTFS
  945. SUPERAREA. This routine also packs the bios parameter block.
  946. Arguments:
  947. None.
  948. Return Value:
  949. A pointer to the write buffer.
  950. --*/
  951. {
  952. PackBios(&_bpb, &(_boot_sector->PackedBpb));
  953. return SECRUN::GetBuf();
  954. }
  955. INLINE
  956. BOOLEAN
  957. NTFS_SA::Write(
  958. )
  959. /*++
  960. Routine Description:
  961. This routine simply calls the other write with the default message
  962. object.
  963. Arguments:
  964. None.
  965. Return Value:
  966. FALSE - Failure.
  967. TRUE - Success.
  968. --*/
  969. {
  970. MESSAGE msg;
  971. return Write(&msg);
  972. }
  973. INLINE
  974. BIG_INT
  975. NTFS_SA::QueryVolumeSectors(
  976. ) CONST
  977. /*++
  978. Routine Description:
  979. This routine returns the number of sectors on the volume as recorded in
  980. the boot sector.
  981. Arguments:
  982. None.
  983. Return Value:
  984. The number of volume sectors.
  985. --*/
  986. {
  987. return _boot_sector->NumberSectors;
  988. }
  989. INLINE
  990. VOID
  991. NTFS_SA::SetVolumeSectors(
  992. BIG_INT NewNumberOfSectors
  993. )
  994. /*++
  995. Routine Description:
  996. This routine sets the number of sectors on the volume
  997. in the boot sector.
  998. Arguments:
  999. NewVolumeSectors -- Supplies the new value of the number
  1000. of sectors on the volume.
  1001. Return Value:
  1002. None.
  1003. --*/
  1004. {
  1005. _boot_sector->NumberSectors.LowPart = NewNumberOfSectors.GetLowPart();
  1006. _boot_sector->NumberSectors.HighPart = NewNumberOfSectors.GetHighPart();
  1007. }
  1008. INLINE
  1009. LCN
  1010. NTFS_SA::QueryMftStartingLcn(
  1011. ) CONST
  1012. /*++
  1013. Routine Description:
  1014. This routine returns the starting logical cluster number
  1015. for the Master File Table.
  1016. Arguments:
  1017. None.
  1018. Return Value:
  1019. The starting LCN for the MFT.
  1020. --*/
  1021. {
  1022. return _boot_sector->MftStartLcn;
  1023. }
  1024. INLINE
  1025. LCN
  1026. NTFS_SA::QueryMft2StartingLcn(
  1027. ) CONST
  1028. /*++
  1029. Routine Description:
  1030. This routine returns the starting logical cluster number
  1031. for the mirror of the Master File Table.
  1032. Arguments:
  1033. None.
  1034. Return Value:
  1035. The starting LCN for the mirror of the MFT.
  1036. --*/
  1037. {
  1038. return _boot_sector->Mft2StartLcn;
  1039. }
  1040. INLINE
  1041. ULONG
  1042. NTFS_SA::QueryFrsSize(
  1043. ) CONST
  1044. /*++
  1045. Routine Description:
  1046. This routine computes the number of clusters per file record segment.
  1047. Arguments:
  1048. None.
  1049. Return Value:
  1050. The number of clusters per file record segment.
  1051. --*/
  1052. {
  1053. if (_boot_sector->ClustersPerFileRecordSegment < 0) {
  1054. LONG temp = LONG(_boot_sector->ClustersPerFileRecordSegment);
  1055. return 1 << -temp;
  1056. }
  1057. return _boot_sector->ClustersPerFileRecordSegment *
  1058. _bpb.SectorsPerCluster * _drive->QuerySectorSize();
  1059. }
  1060. INLINE
  1061. PARTITION_SYSTEM_ID
  1062. NTFS_SA::QuerySystemId(
  1063. ) CONST
  1064. /*++
  1065. Routine Description:
  1066. This routine computes the system ID for the volume.
  1067. Arguments:
  1068. None.
  1069. Return Value:
  1070. The system ID for the volume.
  1071. --*/
  1072. {
  1073. // unreferenced parameters
  1074. (void)(this);
  1075. return SYSID_IFS;
  1076. }
  1077. INLINE
  1078. LCN
  1079. NTFS_SA::QueryCvtZone(
  1080. ) CONST
  1081. /*++
  1082. Routine Description:
  1083. This routine returns the location of the convert zone.
  1084. Arguments:
  1085. None.
  1086. Return Value:
  1087. The LCN value of the convert zone.
  1088. --*/
  1089. {
  1090. return _cvt_zone;
  1091. }
  1092. INLINE
  1093. BIG_INT
  1094. NTFS_SA::QueryCvtZoneSize(
  1095. ) CONST
  1096. /*++
  1097. Routine Description:
  1098. This routine returns the size of the convert zone.
  1099. Arguments:
  1100. None.
  1101. Return Value:
  1102. The size of the convert zone.
  1103. --*/
  1104. {
  1105. return _cvt_zone_size;
  1106. }
  1107. INLINE
  1108. VOID
  1109. NTFS_SA::SetMftStartingLcn(
  1110. IN LCN Lcn
  1111. )
  1112. /*++
  1113. 836a861,879
  1114. Routine Description:
  1115. This routine sets the starting logical cluster number
  1116. for the Master File Table.
  1117. Arguments:
  1118. Lcn - The starting lcn.
  1119. Return Value:
  1120. None.
  1121. --*/
  1122. {
  1123. _boot_sector->MftStartLcn = Lcn;
  1124. }
  1125. INLINE
  1126. VOID
  1127. NTFS_SA::SetMft2StartingLcn(
  1128. IN LCN Lcn
  1129. )
  1130. /*++
  1131. Routine Description:
  1132. This routine sets the starting logical cluster number
  1133. for the mirror of the Master File Table.
  1134. Arguments:
  1135. Lcn - the starting lcn.
  1136. Return Value:
  1137. None.
  1138. --*/
  1139. {
  1140. _boot_sector->Mft2StartLcn = Lcn;
  1141. }
  1142. INLINE
  1143. UCHAR
  1144. NTFS_SA::GetNumberOfStages(
  1145. )
  1146. {
  1147. return _NumberOfStages;
  1148. }
  1149. INLINE
  1150. VOID
  1151. NTFS_SA::SetNumberOfStages(
  1152. IN UCHAR Number
  1153. )
  1154. {
  1155. _NumberOfStages = Number;
  1156. }
  1157. #endif // _NTFS_SUPERAREA_DEFN_