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.

887 lines
18 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. fatsa.hxx
  5. Abstract:
  6. --*/
  7. #ifndef FATSUPERA_DEFN
  8. #define FATSUPERA_DEFN
  9. #include "hmem.hxx"
  10. #include "supera.hxx"
  11. #include "message.hxx"
  12. #if defined ( _AUTOCHECK_ ) || defined( _EFICHECK_ )
  13. #define UFAT_EXPORT
  14. #elif defined ( _UFAT_MEMBER_ )
  15. #define UFAT_EXPORT __declspec(dllexport)
  16. #else
  17. #define UFAT_EXPORT __declspec(dllimport)
  18. #endif
  19. #define FAT_TYPE_UNKNOWN 42 // DRIVE where type wasn't known
  20. #define FAT_TYPE_FAT32 32 // FAT 32 with DWORD SCN and no EA
  21. #define FAT_TYPE_EAS_OKAY 16 // Fat drive with EA's OK
  22. //
  23. // Forward references
  24. //
  25. DECLARE_CLASS( ARRAY );
  26. DECLARE_CLASS( BITVECTOR );
  27. DECLARE_CLASS( EA_HEADER );
  28. DECLARE_CLASS( FAT );
  29. DECLARE_CLASS( FAT_SA );
  30. DECLARE_CLASS( FAT_DIRENT );
  31. DECLARE_CLASS( FATDIR );
  32. DECLARE_CLASS( GENERIC_STRING );
  33. #if !defined(_EFICHECK_)
  34. DECLARE_CLASS( INTSTACK );
  35. #endif
  36. DECLARE_CLASS( NUMBER_SET );
  37. DECLARE_CLASS( LOG_IO_DP_DRIVE );
  38. DECLARE_CLASS( MESSAGE );
  39. DECLARE_CLASS( ROOTDIR );
  40. DECLARE_CLASS( SORTED_LIST );
  41. DECLARE_CLASS( TIMEINFO );
  42. DECLARE_CLASS( WSTRING );
  43. DEFINE_POINTER_TYPES( PFATDIR );
  44. DECLARE_CLASS( FILEDIR );
  45. enum FATTYPE {
  46. SMALL, // 12 bit fat
  47. LARGE16, // 16 bit fat
  48. LARGE32, // 32 bit fat
  49. INVALID_FATTYPE // Invalid value
  50. };
  51. // the text for the oem data field
  52. #define OEMTEXT "MSDOS5.0"
  53. #define OEMTEXTLENGTH 8
  54. #define sigBOOTSTRAP (UCHAR)0x29 // boot strap signature
  55. CONST MaxSecPerClus = 128; // The maximum number of sectors per cluster.
  56. struct _EA_INFO {
  57. USHORT OwnHandle;
  58. ULONG PreceedingCn; // Clus num preceeding first cluster of set.
  59. ULONG LastCn; // The number of the last cluster in the set.
  60. STR OwnerFileName[14]; // Owner file name as found in ea set.
  61. UCHAR UsedCount; // Number of files using ea set.
  62. STR UserFileName[14]; // File name of ea set user.
  63. ULONG UserFileEntryCn; // Clus num of directory for file.
  64. ULONG UserFileEntryNumber; // Dirent num for file name.
  65. };
  66. DEFINE_TYPE( struct _EA_INFO, EA_INFO );
  67. struct _FATCHK_REPORT {
  68. ULONG HiddenEntriesCount;
  69. ULONG HiddenClusters;
  70. ULONG FileEntriesCount;
  71. ULONG FileClusters;
  72. ULONG DirEntriesCount;
  73. ULONG DirClusters;
  74. ULONG ExitStatus;
  75. };
  76. DEFINE_TYPE( struct _FATCHK_REPORT, FATCHK_REPORT );
  77. #if !defined(_EFICHECK_)
  78. struct _CENSUS_REPORT {
  79. ULONG FileEntriesCount;
  80. ULONG FileClusters;
  81. ULONG DirEntriesCount;
  82. ULONG DirClusters;
  83. ULONG EaClusters;
  84. };
  85. DEFINE_TYPE( struct _CENSUS_REPORT, CENSUS_REPORT );
  86. #endif
  87. class FAT_SA : public SUPERAREA {
  88. public:
  89. UFAT_EXPORT
  90. DECLARE_CONSTRUCTOR(FAT_SA);
  91. VIRTUAL
  92. UFAT_EXPORT
  93. ~FAT_SA(
  94. );
  95. VIRTUAL
  96. BOOLEAN
  97. Initialize(
  98. IN OUT PLOG_IO_DP_DRIVE Drive,
  99. IN OUT PMESSAGE Message,
  100. IN BOOLEAN Formatted
  101. ) PURE;
  102. VIRTUAL
  103. BOOLEAN
  104. Create(
  105. IN PCNUMBER_SET BadSectors,
  106. IN OUT PMESSAGE Message,
  107. IN PCWSTRING Label DEFAULT NULL,
  108. IN BOOLEAN BackwardCompatible DEFAULT TRUE,
  109. IN ULONG ClusterSize DEFAULT 0,
  110. IN ULONG VirtualSize DEFAULT 0
  111. ) PURE;
  112. NONVIRTUAL
  113. BOOLEAN
  114. VerifyAndFix(
  115. IN FIX_LEVEL FixLevel,
  116. IN OUT PMESSAGE Message,
  117. IN ULONG Flags DEFAULT 0,
  118. IN ULONG LogFileSize DEFAULT 0,
  119. OUT PULONG ExitStatus DEFAULT NULL,
  120. IN PCWSTRING DriveLetter DEFAULT NULL
  121. );
  122. NONVIRTUAL
  123. BOOLEAN
  124. RecoverFile(
  125. IN PCWSTRING FullPathFileName,
  126. IN OUT PMESSAGE Message
  127. );
  128. NONVIRTUAL
  129. BOOLEAN
  130. Read(
  131. );
  132. VIRTUAL
  133. BOOLEAN
  134. Read(
  135. IN OUT PMESSAGE Message
  136. ) PURE;
  137. NONVIRTUAL
  138. BOOLEAN
  139. Write(
  140. );
  141. VIRTUAL
  142. BOOLEAN
  143. Write(
  144. IN OUT PMESSAGE Message
  145. ) PURE;
  146. NONVIRTUAL
  147. PFAT
  148. GetFat(
  149. );
  150. NONVIRTUAL
  151. PROOTDIR
  152. GetRootDir(
  153. );
  154. NONVIRTUAL
  155. PFILEDIR
  156. GetFileDir(
  157. );
  158. VIRTUAL
  159. USHORT
  160. QuerySectorsPerCluster(
  161. ) CONST PURE;
  162. VIRTUAL
  163. ULONG
  164. QuerySectorsPerFat(
  165. ) CONST PURE;
  166. VIRTUAL
  167. ULONG
  168. QueryVirtualSectors(
  169. ) CONST PURE;
  170. VIRTUAL
  171. USHORT
  172. QueryFats(
  173. ) CONST PURE;
  174. VIRTUAL
  175. PARTITION_SYSTEM_ID
  176. QuerySystemId(
  177. ) CONST PURE;
  178. VIRTUAL
  179. LBN
  180. QueryStartDataLbn(
  181. ) CONST PURE;
  182. VIRTUAL
  183. ULONG
  184. QueryClusterCount(
  185. ) CONST PURE;
  186. NONVIRTUAL
  187. SECTORCOUNT
  188. QueryFreeSectors(
  189. ) CONST;
  190. NONVIRTUAL
  191. FATTYPE
  192. QueryFatType(
  193. ) CONST;
  194. VIRTUAL
  195. BYTE
  196. QueryVolumeFlags(
  197. ) CONST PURE;
  198. VIRTUAL
  199. VOID
  200. SetVolumeFlags(
  201. BYTE Flags,
  202. BOOLEAN ResetFlags
  203. ) PURE;
  204. VIRTUAL
  205. BOOLEAN
  206. RecoverChain(
  207. IN OUT PULONG StartingCluster,
  208. OUT PBOOLEAN ChangesMade,
  209. IN ULONG EndingCluster DEFAULT 0,
  210. IN BOOLEAN Replace DEFAULT FALSE
  211. ) PURE;
  212. VIRTUAL
  213. BOOLEAN
  214. QueryLabel(
  215. OUT PWSTRING Label
  216. ) CONST;
  217. NONVIRTUAL
  218. BOOLEAN
  219. QueryLabel(
  220. OUT PWSTRING Label,
  221. OUT PTIMEINFO TimeInfo
  222. ) CONST;
  223. NONVIRTUAL
  224. BOOLEAN
  225. SetLabel(
  226. IN PCWSTRING NewLabel
  227. );
  228. NONVIRTUAL
  229. UFAT_EXPORT
  230. ULONG
  231. QueryFileStartingCluster(
  232. IN PCWSTRING FullPathFileName,
  233. OUT PHMEM Hmem DEFAULT NULL,
  234. OUT PPFATDIR Directory DEFAULT NULL,
  235. OUT PBOOLEAN DeleteDirectory DEFAULT NULL,
  236. OUT PFAT_DIRENT DirEntry DEFAULT NULL
  237. );
  238. #if !defined(_EFICHECK_)
  239. NONVIRTUAL
  240. UFAT_EXPORT
  241. BOOLEAN
  242. QueryCensusAndRelocate (
  243. OUT PCENSUS_REPORT CensusReport DEFAULT NULL,
  244. IN OUT PINTSTACK RelocationStack DEFAULT NULL,
  245. OUT PBOOLEAN Relocated DEFAULT NULL
  246. );
  247. #endif
  248. STATIC
  249. USHORT
  250. ComputeSecClus(
  251. IN SECTORCOUNT Sectors,
  252. IN FATTYPE FatType,
  253. #if defined(FE_SB) && defined(_X86_)
  254. IN MEDIA_TYPE MediaType,
  255. IN ULONG SectorSize = 512 /* FMR */
  256. #else
  257. IN MEDIA_TYPE MediaType
  258. #endif
  259. );
  260. VIRTUAL
  261. BOOLEAN
  262. IsCompressed(
  263. ) CONST PURE;
  264. VIRTUAL
  265. BOOLEAN
  266. ReadSectorZero(
  267. ) PURE;
  268. STATIC BOOLEAN
  269. FAT_SA::IsValidString(
  270. IN PCWSTRING String
  271. );
  272. //
  273. // These routines are used to access the CVF_EXTENSIONS on
  274. // FATDB, and they do the minimal thing on REAL_FAT.
  275. //
  276. VIRTUAL
  277. ULONG
  278. QuerySectorFromCluster(
  279. IN ULONG Cluster,
  280. OUT PUCHAR NumSectors DEFAULT NULL
  281. ) PURE;
  282. VIRTUAL
  283. BOOLEAN
  284. IsClusterCompressed(
  285. IN ULONG Cluster
  286. ) CONST PURE;
  287. VIRTUAL
  288. VOID
  289. SetClusterCompressed(
  290. IN ULONG Cluster,
  291. IN BOOLEAN fCompressed
  292. ) PURE;
  293. VIRTUAL
  294. UCHAR
  295. QuerySectorsRequiredForPlainData(
  296. IN ULONG Cluster
  297. ) PURE;
  298. //
  299. // These routines are used to manage the sector heap for
  300. // FATDB, and do nothing on REAL_FAT.
  301. //
  302. VIRTUAL
  303. BOOLEAN
  304. FreeClusterData(
  305. IN ULONG Cluster
  306. ) PURE;
  307. VIRTUAL
  308. BOOLEAN
  309. AllocateClusterData(
  310. IN ULONG Cluster,
  311. IN UCHAR NumSectors,
  312. IN BOOLEAN bCompressed,
  313. IN UCHAR PlainSize
  314. ) PURE;
  315. protected:
  316. PFAT _fat; // Pointer to FAT;
  317. FATTYPE _ft; // fat type required by area
  318. PROOTDIR _dir; // Pointer to Root directory
  319. PFILEDIR _dirF32; // Pointer to FAT 32 Root dir
  320. PHMEM _hmem_F32; // Pointer to the Fat 32 Root dir data
  321. VIRTUAL
  322. BOOLEAN
  323. SetBpb(
  324. ) PURE;
  325. VIRTUAL
  326. ULONG
  327. SecPerBoot(
  328. ) PURE;
  329. VIRTUAL
  330. VOLID
  331. QueryVolId(
  332. ) CONST PURE;
  333. VIRTUAL
  334. VOLID
  335. SetVolId(
  336. IN VOLID VolId
  337. ) PURE;
  338. VIRTUAL
  339. UCHAR
  340. QueryMediaByte(
  341. ) CONST PURE;
  342. VIRTUAL
  343. VOID
  344. SetMediaByte(
  345. UCHAR MediaByte
  346. ) PURE;
  347. NONVIRTUAL
  348. PARTITION_SYSTEM_ID
  349. ComputeSystemId(
  350. ) CONST;
  351. NONVIRTUAL
  352. FATTYPE
  353. ComputeFatType(
  354. ) CONST;
  355. NONVIRTUAL
  356. BOOLEAN
  357. RecoverOrphans(
  358. IN OUT PBITVECTOR FatBitMap,
  359. IN FIX_LEVEL FixLevel,
  360. IN OUT PMESSAGE Message,
  361. IN OUT PBOOLEAN NeedErrorsMessage,
  362. IN OUT PFATCHK_REPORT Report,
  363. OUT PBOOLEAN Changes
  364. );
  365. VIRTUAL
  366. BOOLEAN
  367. VerifyFatExtensions(
  368. IN FIX_LEVEL FixLevel,
  369. IN PMESSAGE Message,
  370. IN PBOOLEAN pfNeedMsg
  371. ) PURE;
  372. VIRTUAL
  373. VOID
  374. SetFat32RootDirStartingCluster (
  375. IN ULONG RootCluster
  376. ) PURE;
  377. VIRTUAL
  378. ULONG
  379. QueryFat32RootDirStartingCluster (
  380. ) PURE;
  381. VIRTUAL
  382. BOOLEAN
  383. CheckSectorHeapAllocation(
  384. IN FIX_LEVEL FixLevel,
  385. IN PMESSAGE Message,
  386. IN PBOOLEAN pfNeedMsg
  387. ) PURE;
  388. private:
  389. NONVIRTUAL
  390. VOID
  391. Construct(
  392. );
  393. NONVIRTUAL
  394. VOID
  395. Destroy(
  396. );
  397. NONVIRTUAL
  398. ULONG
  399. ComputeRootEntries(
  400. ) CONST;
  401. NONVIRTUAL
  402. BOOLEAN
  403. PerformEaLogOperations(
  404. IN ULONG EaFileCn,
  405. IN FIX_LEVEL FixLevel,
  406. IN OUT PMESSAGE Message,
  407. IN OUT PBOOLEAN NeedErrorsMessage
  408. );
  409. NONVIRTUAL
  410. PEA_INFO
  411. RecoverEaSets(
  412. IN ULONG EaFileCn,
  413. OUT PUSHORT NumEas,
  414. IN FIX_LEVEL FixLevel,
  415. IN OUT PMESSAGE Message,
  416. IN OUT PBOOLEAN NeedErrorsMessage
  417. );
  418. NONVIRTUAL
  419. ULONG
  420. VerifyAndFixEaSet(
  421. IN ULONG PreceedingCluster,
  422. OUT PEA_INFO EaInfo,
  423. IN FIX_LEVEL FixLevel,
  424. IN OUT PMESSAGE Message,
  425. IN OUT PBOOLEAN NeedErrorsMessage
  426. );
  427. NONVIRTUAL
  428. BOOLEAN
  429. VerifyAndFixFat32RootDir (
  430. IN OUT PBITVECTOR FatBitMap,
  431. IN PMESSAGE Message,
  432. IN OUT PFATCHK_REPORT Report,
  433. IN OUT PBOOLEAN NeedErrorMessage
  434. );
  435. NONVIRTUAL
  436. BOOLEAN
  437. RelocateNewFat32RootDirectory (
  438. IN OUT PFATCHK_REPORT Report,
  439. IN OUT PBITVECTOR FatBitMap,
  440. IN PMESSAGE Message
  441. );
  442. NONVIRTUAL
  443. BOOLEAN
  444. EaSort(
  445. IN OUT PEA_INFO EaInfos,
  446. IN ULONG NumEas,
  447. IN OUT PMESSAGE Message,
  448. IN OUT PBOOLEAN NeedErrorsMessage
  449. );
  450. NONVIRTUAL
  451. BOOLEAN
  452. RebuildEaHeader(
  453. IN OUT PULONG StartingCluster,
  454. IN OUT PEA_INFO EaInfos,
  455. IN ULONG NumEas,
  456. IN OUT PMEM EaHeaderMem,
  457. OUT PEA_HEADER EaHeader,
  458. IN OUT PBITVECTOR FatBitMap,
  459. IN FIX_LEVEL FixLevel,
  460. IN OUT PMESSAGE Message,
  461. IN OUT PBOOLEAN NeedErrorsMessage
  462. );
  463. NONVIRTUAL
  464. BOOLEAN
  465. WalkDirectoryTree(
  466. IN OUT PEA_INFO EaInfos,
  467. IN OUT PUSHORT NumEas,
  468. IN OUT PBITVECTOR FatBitMap,
  469. OUT PFATCHK_REPORT Report,
  470. IN FIX_LEVEL FixLevel,
  471. IN BOOLEAN RecoverAlloc,
  472. IN OUT PMESSAGE Message,
  473. IN BOOLEAN Verbose,
  474. IN OUT PBOOLEAN NeedErrorsMessage
  475. );
  476. NONVIRTUAL
  477. BOOLEAN
  478. ValidateDirent(
  479. IN OUT PFAT_DIRENT Dirent,
  480. IN PCWSTRING FilePath,
  481. IN FIX_LEVEL FixLevel,
  482. IN BOOLEAN RecoverAlloc,
  483. IN OUT PMESSAGE Message,
  484. IN OUT PBOOLEAN NeedErrorsMessage,
  485. IN OUT PBITVECTOR FatBitMap,
  486. OUT PBOOLEAN CrossLinkDetected,
  487. OUT PULONG CrossLinkPreviousCluster,
  488. OUT PULONG ExitStatus
  489. );
  490. NONVIRTUAL
  491. BOOLEAN
  492. EraseEaHandle(
  493. IN PEA_INFO EaInfos,
  494. IN USHORT NumEasLeft,
  495. IN USHORT NumEas,
  496. IN FIX_LEVEL FixLevel,
  497. IN OUT PMESSAGE Message
  498. );
  499. NONVIRTUAL
  500. BOOLEAN
  501. ValidateEaHandle(
  502. IN OUT PFAT_DIRENT Dirent,
  503. IN ULONG DirClusterNumber,
  504. IN ULONG DirEntryNumber,
  505. IN OUT PEA_INFO EaInfos,
  506. IN USHORT NumEas,
  507. IN PCWSTRING FilePath,
  508. IN FIX_LEVEL FixLevel,
  509. IN OUT PMESSAGE Message,
  510. IN OUT PBOOLEAN NeedErrorsMessage
  511. );
  512. NONVIRTUAL
  513. BOOLEAN
  514. CopyClusters(
  515. IN ULONG SourceChain,
  516. OUT PULONG DestChain,
  517. IN OUT PBITVECTOR FatBitMap,
  518. IN FIX_LEVEL FixLevel,
  519. IN OUT PMESSAGE Message
  520. );
  521. NONVIRTUAL
  522. BOOLEAN
  523. ValidateDirent(
  524. IN OUT PFAT_DIRENT Dirent,
  525. IN PCWSTRING FilePath,
  526. IN FIX_LEVEL FixLevel,
  527. IN BOOLEAN RecoverAlloc,
  528. IN OUT PMESSAGE Message,
  529. IN OUT PBOOLEAN NeedErrorsMessage,
  530. IN OUT PBITVECTOR FatBitMap,
  531. OUT PBOOLEAN CrossLinkDetected,
  532. OUT PUSHORT CrossLinkPreviousCluster,
  533. OUT PULONG ExitStatus
  534. );
  535. NONVIRTUAL
  536. BOOLEAN
  537. ValidateEaHandle(
  538. IN OUT PFAT_DIRENT Dirent,
  539. IN USHORT DirClusterNumber,
  540. IN ULONG DirEntryNumber,
  541. IN OUT PEA_INFO EaInfos,
  542. IN USHORT NumEas,
  543. IN PCWSTRING FilePath,
  544. IN FIX_LEVEL FixLevel,
  545. IN OUT PMESSAGE Message,
  546. IN OUT PBOOLEAN NeedErrorsMessage
  547. );
  548. NONVIRTUAL
  549. BOOLEAN
  550. CopyClusters(
  551. IN USHORT SourceChain,
  552. OUT PUSHORT DestChain,
  553. IN OUT PBITVECTOR FatBitMap,
  554. IN FIX_LEVEL FixLevel,
  555. IN OUT PMESSAGE Message
  556. );
  557. NONVIRTUAL
  558. BOOLEAN
  559. PurgeEaFile(
  560. IN PEA_INFO EaInfos,
  561. IN USHORT NumEas,
  562. IN OUT PBITVECTOR FatBitMap,
  563. IN FIX_LEVEL FixLevel,
  564. IN OUT PMESSAGE Message,
  565. IN OUT PBOOLEAN NeedErrorsMessage
  566. );
  567. #if !defined(_EFICHECK_)
  568. NONVIRTUAL
  569. BOOLEAN
  570. InitRelocationList(
  571. IN OUT PINTSTACK RelocationStack,
  572. IN OUT PULONG RelocatedChain,
  573. IN OUT PSORTED_LIST ClustersToRelocate,
  574. OUT PBOOLEAN Relocated
  575. );
  576. NONVIRTUAL
  577. BOOLEAN
  578. RelocateFirstCluster(
  579. IN OUT PFAT_DIRENT Dirent
  580. );
  581. NONVIRTUAL
  582. ULONG
  583. RelocateOneCluster(
  584. IN ULONG Cluster,
  585. IN ULONG Previous
  586. );
  587. NONVIRTUAL
  588. BOOLEAN
  589. DoDirectoryCensusAndRelocation(
  590. IN OUT PFATDIR Directory,
  591. IN OUT PCENSUS_REPORT CensusReport,
  592. IN OUT PSORTED_LIST ClustersToRelocate,
  593. IN OUT PULONG RelocatedChain,
  594. OUT PBOOLEAN Relocated
  595. );
  596. NONVIRTUAL
  597. BOOLEAN
  598. DoVolumeCensusAndRelocation(
  599. IN OUT PCENSUS_REPORT CensusReport,
  600. IN OUT PSORTED_LIST ClustersToRelocate,
  601. IN OUT PULONG RelocatedChain,
  602. OUT PBOOLEAN Relocated
  603. );
  604. #endif
  605. NONVIRTUAL
  606. BOOLEAN
  607. RecoverFreeSpace(
  608. IN OUT PMESSAGE Message
  609. );
  610. NONVIRTUAL
  611. BOOLEAN
  612. AllocSectorsForChain(
  613. IN ULONG StartingCluster
  614. );
  615. };
  616. INLINE
  617. BOOLEAN
  618. FAT_SA::Read(
  619. )
  620. /*++
  621. Routine Description:
  622. This routine simply calls the other read with the default message
  623. object.
  624. Arguments:
  625. None.
  626. Return Value:
  627. FALSE - Failure.
  628. TRUE - Success.
  629. --*/
  630. {
  631. MESSAGE msg;
  632. return Read(&msg);
  633. }
  634. INLINE
  635. BOOLEAN
  636. FAT_SA::Write(
  637. )
  638. /*++
  639. Routine Description:
  640. This routine simply calls the other write with the default message
  641. object.
  642. Arguments:
  643. None.
  644. Return Value:
  645. FALSE - Failure.
  646. TRUE - Success.
  647. --*/
  648. {
  649. MESSAGE msg;
  650. return Write(&msg);
  651. }
  652. INLINE
  653. PFAT
  654. FAT_SA::GetFat(
  655. )
  656. /*++
  657. Routine Description:
  658. This routine returns a pointer to the FAT maintained by this class.
  659. It is not necessary to read or write this FAT since it shares memory
  660. with the FAT_SA class and thus performing FAT_SA::Read will read in
  661. the FAT and performing FAT_SA::Write will write the FAT. Additionally,
  662. performing a FAT_SA::Write will duplicate the information in the local
  663. FAT object to all other FATs on the disk.
  664. Arguments:
  665. None.
  666. Return Value:
  667. A pointer to the FAT super area's FAT.
  668. --*/
  669. {
  670. return _fat;
  671. }
  672. INLINE
  673. PROOTDIR
  674. FAT_SA::GetRootDir(
  675. )
  676. /*++
  677. Routine Description:
  678. This routine return a pointer to the FAT super area's root directory.
  679. The memory of this root directory is shared with the FAT super area.
  680. Hence, as with 'GetFat' it is not necessary to read or write the
  681. root directory returned by this routine if a FAT_SA::Read or
  682. FAT_SA::Write is being performed respecively.
  683. Arguments:
  684. None.
  685. Return Value:
  686. A pointer to the FAT super area's root directory.
  687. --*/
  688. {
  689. return _dir;
  690. }
  691. INLINE
  692. PFILEDIR
  693. FAT_SA::GetFileDir(
  694. )
  695. /*++
  696. Routine Description:
  697. This routine return a pointer to the FAT super area's root directory.
  698. The memory of this root directory is shared with the FAT super area.
  699. Hence, as with 'GetFat' it is not necessary to read or write the
  700. root directory returned by this routine if a FAT_SA::Read or
  701. FAT_SA::Write is being performed respecively.
  702. NOTE: Compiler refused to let me return either type FILE or ROOT DIR
  703. as a FATDIR from GetRootDir() above, so I made this parallel function,
  704. and coded a call to both in the FAT 32 cases that called GetRootDir.
  705. Arguments:
  706. None.
  707. Return Value:
  708. A pointer to the FAT 32 super area's FILEDIR type root directory.
  709. --*/
  710. {
  711. return _dirF32;
  712. }
  713. extern BOOLEAN
  714. IsValidString(
  715. IN PCWSTRING String
  716. );
  717. #endif // FATSUPERA_DEFN
  718. extern VOID
  719. dofmsg(
  720. IN PMESSAGE Message,
  721. IN OUT PBOOLEAN NeedErrorsMessage
  722. );