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.

787 lines
20 KiB

  1. /*++
  2. Copyright (c) 1992-2001 Microsoft Corporation
  3. Module Name:
  4. ifssys.cxx
  5. --*/
  6. #include <pch.cxx>
  7. #define _NTAPI_ULIB_
  8. #define _IFSUTIL_MEMBER_
  9. #include "ulib.hxx"
  10. #include "ifsutil.hxx"
  11. #include "ifssys.hxx"
  12. #include "bigint.hxx"
  13. #include "wstring.hxx"
  14. #include "drive.hxx"
  15. #include "secrun.hxx"
  16. #include "hmem.hxx"
  17. #include "bpb.hxx"
  18. #include "volume.hxx"
  19. #if !defined( _EFICHECK_ )
  20. #include "untfs2.hxx"
  21. #endif
  22. BOOLEAN
  23. IFS_SYSTEM::IsThisFat(
  24. IN BIG_INT Sectors,
  25. IN PVOID BootSectorData
  26. )
  27. /*++
  28. Routine Description:
  29. This routine determines if the given boot sector is a FAT
  30. boot sector.
  31. Arguments:
  32. Sectors - Supplies the number of sectors on this drive.
  33. BootSector - Supplies the boot sector data.
  34. Return Value:
  35. FALSE - This is not a FAT boot sector.
  36. TRUE - This is a FAT boot sector.
  37. --*/
  38. {
  39. PPACKED_EXTENDED_BIOS_PARAMETER_BLOCK BootSector =
  40. (PPACKED_EXTENDED_BIOS_PARAMETER_BLOCK)BootSectorData;
  41. BOOLEAN r;
  42. USHORT bytes_per_sector, reserved_sectors, root_entries, sectors;
  43. USHORT sectors_per_fat;
  44. ULONG large_sectors;
  45. r = TRUE;
  46. DEBUG((D_INFO,(CHAR8*)"IsFAT: checking for FAT.\n"));
  47. memcpy(&bytes_per_sector, BootSector->Bpb.BytesPerSector, sizeof(USHORT));
  48. memcpy(&reserved_sectors, BootSector->Bpb.ReservedSectors, sizeof(USHORT));
  49. memcpy(&root_entries, BootSector->Bpb.RootEntries, sizeof(USHORT));
  50. memcpy(&sectors, BootSector->Bpb.Sectors, sizeof(USHORT));
  51. memcpy(&large_sectors, BootSector->Bpb.LargeSectors, sizeof(ULONG));
  52. memcpy(&sectors_per_fat, BootSector->Bpb.SectorsPerFat, sizeof(USHORT));
  53. #if defined(FE_SB) && defined(_X86_)
  54. //
  55. // 3mode PC/AT support 'I' of 'IPL1'
  56. //
  57. if (BootSector->IntelNearJumpCommand[0] != 0xeb &&
  58. BootSector->IntelNearJumpCommand[0] != 0xe9 &&
  59. BootSector->IntelNearJumpCommand[0] != 0x49) { // FMR 'I' of 'IPL1'
  60. #else
  61. if (BootSector->IntelNearJumpCommand[0] != 0xeb &&
  62. BootSector->IntelNearJumpCommand[0] != 0xe9) {
  63. #endif
  64. r = FALSE;
  65. DEBUG((D_INFO,(CHAR8*)"IsFAT: no jmp.\n"));
  66. } else if ((bytes_per_sector != 128) &&
  67. (bytes_per_sector != 256) &&
  68. (bytes_per_sector != 512) &&
  69. (bytes_per_sector != 1024) &&
  70. (bytes_per_sector != 2048) &&
  71. (bytes_per_sector != 4096)) {
  72. DEBUG((D_INFO,(CHAR8*)"IsFAT: Bytes/sector is wrong.\n"));
  73. r = FALSE;
  74. } else if ((BootSector->Bpb.SectorsPerCluster[0] != 1) &&
  75. (BootSector->Bpb.SectorsPerCluster[0] != 2) &&
  76. (BootSector->Bpb.SectorsPerCluster[0] != 4) &&
  77. (BootSector->Bpb.SectorsPerCluster[0] != 8) &&
  78. (BootSector->Bpb.SectorsPerCluster[0] != 16) &&
  79. (BootSector->Bpb.SectorsPerCluster[0] != 32) &&
  80. (BootSector->Bpb.SectorsPerCluster[0] != 64) &&
  81. (BootSector->Bpb.SectorsPerCluster[0] != 128)) {
  82. DEBUG((D_INFO,(CHAR8*)"IsFAT: sectors/cluster is wrong.\n"));
  83. r = FALSE;
  84. } else if (reserved_sectors == 0) {
  85. DEBUG((D_INFO,(CHAR8*)"IsFAT: no resrved sectors.\n"));
  86. r = FALSE;
  87. } else if (BootSector->Bpb.Fats[0] == 0) {
  88. DEBUG((D_INFO,(CHAR8*)"IsFAT: no fats.\n"));
  89. r = FALSE;
  90. } else if (root_entries == 0) {
  91. DEBUG((D_INFO,(CHAR8*)"IsFAT: no root entries is wrong.\n"));
  92. r = FALSE;
  93. } else if (Sectors.GetHighPart() != 0) {
  94. DEBUG((D_INFO,(CHAR8*)"IsFAT: Sectors.GetHighPart() != 0.\n"));
  95. r = FALSE;
  96. } else if (sectors != 0 && sectors > Sectors.GetLowPart()) {
  97. DEBUG((D_INFO,(CHAR8*)"IsFAT: (sectors != 0 && sectors > Sectors.GetLowPart()).\n"));
  98. r = FALSE;
  99. } else if (sectors == 0 && large_sectors > Sectors.GetLowPart()) {
  100. DEBUG((D_INFO,(CHAR8*)"IsFAT: (sectors == 0 && large_sectors > Sectors.GetLowPart()).\n"));
  101. r = FALSE;
  102. } else if (sectors == 0 && large_sectors == 0) {
  103. DEBUG((D_INFO,(CHAR8*)"IsFAT: (sectors == 0 && large_sectors == 0).\n"));
  104. r = FALSE;
  105. } else if (sectors_per_fat == 0) {
  106. DEBUG((D_INFO,(CHAR8*)"IsFAT: sectors/fat is 0.\n"));
  107. r = FALSE;
  108. }
  109. DEBUG((D_INFO,(CHAR8*)"IsFAT: is it? %d.\n",r));
  110. return r;
  111. }
  112. BOOLEAN
  113. IFS_SYSTEM::IsThisFat32(
  114. IN BIG_INT Sectors,
  115. IN PVOID BootSectorData
  116. )
  117. /*++
  118. Routine Description:
  119. This routine determines if the given boot sector is a FAT32
  120. boot sector.
  121. Arguments:
  122. Sectors - Supplies the number of sectors on this drive.
  123. BootSector - Supplies the boot sector data.
  124. Return Value:
  125. FALSE - This is not a FAT32 boot sector.
  126. TRUE - This is a FAT32 boot sector.
  127. --*/
  128. {
  129. PPACKED_EXTENDED_BIOS_PARAMETER_BLOCK BootSector =
  130. (PPACKED_EXTENDED_BIOS_PARAMETER_BLOCK)BootSectorData;
  131. BOOLEAN r;
  132. USHORT bytes_per_sector, reserved_sectors, sectors;
  133. ULONG root_entries, sectors_per_fat;
  134. ULONG large_sectors;
  135. r = TRUE;
  136. root_entries=0;
  137. memcpy(&root_entries, BootSector->Bpb.RootEntries, sizeof(USHORT));
  138. memcpy(&bytes_per_sector, BootSector->Bpb.BytesPerSector, sizeof(USHORT));
  139. memcpy(&reserved_sectors, BootSector->Bpb.ReservedSectors, sizeof(USHORT));
  140. memcpy(&sectors, BootSector->Bpb.Sectors, sizeof(USHORT));
  141. memcpy(&large_sectors, BootSector->Bpb.LargeSectors, sizeof(ULONG));
  142. memcpy(&sectors_per_fat, BootSector->Bpb.BigSectorsPerFat, sizeof(ULONG));
  143. #if defined(FE_SB) && defined(_X86_)
  144. //
  145. // 3mode PC/AT support 'I' of 'IPL1'
  146. //
  147. if (BootSector->IntelNearJumpCommand[0] != 0xeb &&
  148. BootSector->IntelNearJumpCommand[0] != 0xe9 &&
  149. BootSector->IntelNearJumpCommand[0] != 0x49) { // FMR 'I' of 'IPL1'
  150. #else
  151. if (BootSector->IntelNearJumpCommand[0] != 0xeb &&
  152. BootSector->IntelNearJumpCommand[0] != 0xe9) {
  153. #endif
  154. DEBUG((D_INFO,(CHAR8*)"IsFAT32: No JMP.\n"));
  155. r = FALSE;
  156. } else if ((bytes_per_sector != 128) &&
  157. (bytes_per_sector != 256) &&
  158. (bytes_per_sector != 512) &&
  159. (bytes_per_sector != 1024) &&
  160. (bytes_per_sector != 2048) &&
  161. (bytes_per_sector != 4096)) {
  162. DEBUG((D_INFO,(CHAR8*)"IsFAT32: Bytes/sector is wrong.\n"));
  163. r = FALSE;
  164. } else if ((BootSector->Bpb.SectorsPerCluster[0] != 1) &&
  165. (BootSector->Bpb.SectorsPerCluster[0] != 2) &&
  166. (BootSector->Bpb.SectorsPerCluster[0] != 4) &&
  167. (BootSector->Bpb.SectorsPerCluster[0] != 8) &&
  168. (BootSector->Bpb.SectorsPerCluster[0] != 16) &&
  169. (BootSector->Bpb.SectorsPerCluster[0] != 32) &&
  170. (BootSector->Bpb.SectorsPerCluster[0] != 64) &&
  171. (BootSector->Bpb.SectorsPerCluster[0] != 128)) {
  172. DEBUG((D_INFO,(CHAR8*)"IsFAT32: Sectors/cluster is wrong.\n"));
  173. r = FALSE;
  174. } else if ( sectors_per_fat == 0 || (0 != BootSector->Bpb.SectorsPerFat[0] &&
  175. 0 != BootSector->Bpb.SectorsPerFat[1]) ) {
  176. DEBUG((D_INFO,(CHAR8*)"IsThisFat32() not fat 32 sectors/fat value\n"));
  177. r = FALSE;
  178. } else {
  179. if (reserved_sectors == 0) {
  180. DEBUG((D_INFO,(CHAR8*)"IsFAT32: No reserved sectors.\n"));
  181. r = FALSE;
  182. } else if (BootSector->Bpb.Fats[0] == 0) {
  183. DEBUG((D_INFO,(CHAR8*)"IsFAT32: No FATS.\n"));
  184. r = FALSE;
  185. } else if (root_entries != 0) {
  186. DEBUG((D_INFO,(CHAR8*)"IsFAT32: root entries exist, this isn't FAT32.\n"));
  187. r = FALSE;
  188. } else if (Sectors.GetHighPart() != 0) {
  189. DEBUG((D_INFO,(CHAR8*)"IsFAT32: Sectors.GetHighPart() != 0.\n"));
  190. r = FALSE;
  191. } else if (sectors != 0 && sectors > Sectors.GetLowPart()) {
  192. DEBUG((D_INFO,(CHAR8*)"IsFAT32: sectors != 0 && sectors > Sectors.GetLowPart()\n"));
  193. r = FALSE;
  194. } else if (sectors == 0 && large_sectors > Sectors.GetLowPart()) {
  195. DEBUG((D_INFO,(CHAR8*)"IsFAT32: sectors == 0 && large_sectors(%d) > Sectors.GetLowPart()(%d)\n",large_sectors,Sectors.GetLowPart()));
  196. r = FALSE;
  197. } else if (sectors == 0 && large_sectors == 0) {
  198. DEBUG((D_INFO,(CHAR8*)"IsFAT32: both sectors and large_sectors are zero\n"));
  199. r = FALSE;
  200. }
  201. }
  202. DEBUG((D_INFO,(CHAR8*)"IsFAT32: is it? %d.\n",r));
  203. return r;
  204. }
  205. BOOLEAN
  206. IFS_SYSTEM::IsThisHpfs(
  207. IN BIG_INT Sectors,
  208. IN PVOID BootSectorData,
  209. IN PULONG SuperBlock,
  210. IN PULONG SpareBlock
  211. )
  212. /*++
  213. Routine Description:
  214. This routine determines whether or not the given structures
  215. are part of an HPFS file system.
  216. Arguments:
  217. Sectors - Supplies the number of sectors on the volume.
  218. BootSector - Supplies the unaligned boot sector.
  219. SuperBlock - Supplies the super block.
  220. SpareBlock - Supplies the spare block.
  221. Return Value:
  222. FALSE - The given structures are not part on an HPFS volume.
  223. TRUE - The given structures are part of an HPFS volume.
  224. --*/
  225. {
  226. return FALSE;
  227. }
  228. IFSUTIL_EXPORT
  229. BOOLEAN
  230. IFS_SYSTEM::IsThisNtfs(
  231. IN BIG_INT Sectors,
  232. IN ULONG SectorSize,
  233. IN PVOID BootSectorData
  234. )
  235. /*++
  236. Routine Description:
  237. This routine determines whether or not the given structure
  238. is part of an NTFS partition.
  239. Arguments:
  240. Sectors - Supplies the number of sectors on the drive.
  241. SectorSize - Supplies the number of bytes per sector.
  242. BootSectorData
  243. - Supplies an unaligned boot sector.
  244. Return Value:
  245. FALSE - The supplied boot sector is not part of an NTFS
  246. TRUE - The supplied boot sector is part of an NTFS volume.
  247. --*/
  248. {
  249. return FALSE;
  250. }
  251. #define BOOTBLKSECTORS 4
  252. typedef int DSKPACKEDBOOTSECT;
  253. BOOLEAN
  254. IsThisOfs(
  255. IN LOG_IO_DP_DRIVE * Drive,
  256. IN DSKPACKEDBOOTSECT * PackedBootSect
  257. )
  258. {
  259. return(FALSE);
  260. }
  261. IFSUTIL_EXPORT
  262. BOOLEAN
  263. IFS_SYSTEM::QueryNtfsVersion(
  264. OUT PUCHAR Major,
  265. OUT PUCHAR Minor,
  266. IN PLOG_IO_DP_DRIVE Drive,
  267. IN PVOID BootSectorData
  268. )
  269. /*++
  270. Routine Description:
  271. This routine extracts the version number of the NTFS partition.
  272. Note: Caller should call IsThisNtfs() first.
  273. Arguments:
  274. Major - Receives the major version number of NTFS partition.
  275. Minor - Receives the minor version number of NTFS partition.
  276. Drive - Supplies the drive that partition is on.
  277. BootSectorData
  278. - Supplies an unaligned boot sector.
  279. Return Value:
  280. FALSE - The supplied boot sector is not part of an NTFS
  281. TRUE - The supplied boot sector is part of an NTFS volume.
  282. --*/
  283. {
  284. return FALSE;
  285. }
  286. IFSUTIL_EXPORT
  287. BOOLEAN
  288. IFS_SYSTEM::QueryFileSystemName(
  289. IN PCWSTRING NtDriveName,
  290. OUT PWSTRING FileSystemName,
  291. OUT PNTSTATUS ErrorCode,
  292. OUT PWSTRING FileSystemNameAndVersion
  293. )
  294. /*++
  295. Routine Description:
  296. This routine computes the file system name for the drive specified.
  297. Arguments:
  298. NtDriveName - Supplies an NT style drive name.
  299. FileSystemName - Returns the file system name for the drive.
  300. ErrorCode - Receives an error code (if the method fails).
  301. Note that this may be NULL, in which case the
  302. exact error is not reported.
  303. FileSystemNameAndVersion
  304. - Returns the file system name and version for the drive.
  305. Return Value:
  306. FALSE - Failure.
  307. TRUE - Success.
  308. --*/
  309. {
  310. LOG_IO_DP_DRIVE drive;
  311. HMEM bootsec_hmem;
  312. SECRUN bootsec;
  313. HMEM super_hmem;
  314. SECRUN super_secrun;
  315. HMEM spare_hmem;
  316. SECRUN spare;
  317. BOOLEAN could_be_fat;
  318. BOOLEAN could_be_hpfs;
  319. BOOLEAN could_be_ntfs;
  320. BOOLEAN could_be_ofs;
  321. ULONG num_boot_sectors;
  322. BOOLEAN first_read_failed = FALSE;
  323. DSTRING fs_name_version;
  324. if (ErrorCode) {
  325. *ErrorCode = 0;
  326. }
  327. if (FileSystemNameAndVersion == NULL)
  328. FileSystemNameAndVersion = &fs_name_version;
  329. if (!drive.Initialize(NtDriveName)) {
  330. if (ErrorCode) {
  331. *ErrorCode = drive.QueryLastNtStatus();
  332. }
  333. return FALSE;
  334. }
  335. could_be_fat = could_be_hpfs = could_be_ntfs = could_be_ofs = TRUE;
  336. DEBUG((D_INFO,(CHAR8*)"In IFS_SYSTEM::QueryFileSystemName\n"));
  337. if (drive.QueryMediaType() == Unknown) {
  338. return FileSystemName->Initialize("RAW") &&
  339. FileSystemNameAndVersion->Initialize("RAW");
  340. }
  341. DEBUG((D_INFO,(CHAR8*)"Got Media Type. IFS_SYSTEM::QueryFileSystemName\n"));
  342. num_boot_sectors = max(1, BYTES_PER_BOOT_SECTOR/drive.QuerySectorSize());
  343. if (!bootsec_hmem.Initialize() ||
  344. !bootsec.Initialize(&bootsec_hmem, &drive, 0, num_boot_sectors)) {
  345. return FileSystemName->Initialize("RAW") &&
  346. FileSystemNameAndVersion->Initialize("RAW");
  347. }
  348. DEBUG((D_INFO,(CHAR8*)"Read Bootsec. IFS_SYSTEM::QueryFileSystemName\n"));
  349. if (!bootsec.Read()) {
  350. DEBUG((D_INFO,(CHAR8*)"Failed 1st Bootsect read. IFS_SYSTEM::QueryFileSystemName\n"));
  351. could_be_fat = could_be_hpfs = FALSE;
  352. DEBUG((D_INFO,(CHAR8*)"Not HPFS or FAT. IFS_SYSTEM::QueryFileSystemName\n"));
  353. first_read_failed = TRUE;
  354. bootsec.Relocate(drive.QuerySectors());
  355. if (!bootsec.Read()) {
  356. DEBUG((D_INFO,(CHAR8*)"Failed 2st Bootsect read. IFS_SYSTEM::QueryFileSystemName\n"));
  357. bootsec.Relocate(drive.QuerySectors()/2);
  358. if (!bootsec.Read()) {
  359. DEBUG((D_ERROR,(CHAR8*)"Failed 3rd Bootsect read. IFS_SYSTEM::QueryFileSystemName\n"));
  360. could_be_ntfs = FALSE;
  361. DEBUG((D_INFO,(CHAR8*)"Not NTFS. IFS_SYSTEM::QueryFileSystemName\n"));
  362. }
  363. }
  364. }
  365. DEBUG((D_INFO,(CHAR8*)"Read Bootsec Success. IFS_SYSTEM::QueryFileSystemName\n"));
  366. DEBUG((D_INFO,(CHAR8*)"Check for FAT. IFS_SYSTEM::QueryFileSystemName\n"));
  367. if (could_be_fat &&
  368. IsThisFat(drive.QuerySectors(),
  369. (PPACKED_EXTENDED_BIOS_PARAMETER_BLOCK)bootsec.GetBuf())) {
  370. return FileSystemName->Initialize("FAT") &&
  371. FileSystemNameAndVersion->Initialize("FAT");
  372. }
  373. DEBUG((D_INFO,(CHAR8*)"Check for FAT32. IFS_SYSTEM::QueryFileSystemName\n"));
  374. if (could_be_fat &&
  375. IsThisFat32(drive.QuerySectors(),
  376. (PPACKED_EXTENDED_BIOS_PARAMETER_BLOCK)bootsec.GetBuf())) {
  377. return FileSystemName->Initialize("FAT32") &&
  378. FileSystemNameAndVersion->Initialize("FAT32");
  379. }
  380. DEBUG((D_INFO,(CHAR8*)"FS is RAW. IFS_SYSTEM::QueryFileSystemName\n"));
  381. return FileSystemName->Initialize("RAW") &&
  382. FileSystemNameAndVersion->Initialize("RAW");
  383. }
  384. IFSUTIL_EXPORT
  385. BOOLEAN
  386. IFS_SYSTEM::DosDriveNameToNtDriveName(
  387. IN PCWSTRING DosDriveName,
  388. OUT PWSTRING NtDriveName
  389. )
  390. /*++
  391. Routine Description:
  392. This routine converts a dos style drive name to an NT style drive
  393. name.
  394. Arguments:
  395. DosDriveName - Supplies the dos style drive name.
  396. NtDriveName - Supplies the nt style drive name.
  397. Return Value:
  398. FALSE - Failure.
  399. TRUE - Success.
  400. --*/
  401. {
  402. WSTR buffer[80];
  403. // EFI doesn't use ntpaths or dospaths
  404. return NtDriveName->Initialize(DosDriveName->QueryWSTR(0, TO_END,buffer, 80));
  405. }
  406. IFSUTIL_EXPORT
  407. BOOLEAN
  408. IFS_SYSTEM::NtDriveNameToDosDriveName(
  409. IN PCWSTRING NtDriveName,
  410. OUT PWSTRING DosDriveName
  411. )
  412. /*++
  413. Routine Description:
  414. This routine converts an NT style drive name to a DOS style drive
  415. name.
  416. Arguments:
  417. NtDriveName - Supplies the nt style drive name.
  418. DosDriveName - Receives the dos style drive name.
  419. Return Value:
  420. FALSE - Failure.
  421. TRUE - Success.
  422. --*/
  423. {
  424. return FALSE;
  425. }
  426. VOID
  427. IFS_SYSTEM::Reboot (
  428. IN BOOLEAN PowerOff
  429. )
  430. /*++
  431. Routine Description:
  432. Reboots the machine
  433. Arguments:
  434. PowerOff -- if TRUE, we will ask the system to shut down and
  435. power off.
  436. Return Value:
  437. Only returns in case of error.
  438. --*/
  439. {
  440. // BUGBUG we should not need this on EFI
  441. return;
  442. }
  443. PCANNED_SECURITY IFS_SYSTEM::_CannedSecurity = NULL;
  444. IFSUTIL_EXPORT
  445. PCANNED_SECURITY
  446. IFS_SYSTEM::GetCannedSecurity(
  447. )
  448. /*++
  449. Routine Description:
  450. This method fetches the canned security object.
  451. Arguments:
  452. None.
  453. Return Value:
  454. A pointer to the canned security object; NULL to indicate
  455. failure.
  456. --*/
  457. {
  458. // we do not need to bother with NT security in EFI
  459. return NULL;
  460. }
  461. IFSUTIL_EXPORT
  462. BOOLEAN
  463. IFS_SYSTEM::QueryFreeDiskSpace(
  464. IN PCWSTRING DosDriveName,
  465. OUT PBIG_INT BytesFree
  466. )
  467. /*++
  468. Routine Description:
  469. Returns the amount of free space in a volume (in bytes).
  470. Arguments:
  471. DosDrivename - Supplies the DOS name of the drive
  472. BytesFree - Supplies the BIG_INT in which the result
  473. is returned.
  474. Return Value:
  475. BOOLEAN - TRUE if the amount of free space was obtained.
  476. --*/
  477. {
  478. BOOLEAN Ok = FALSE;
  479. return Ok;
  480. }
  481. BOOLEAN
  482. QueryDriverName(
  483. IN PCWSTRING FileSystemName,
  484. OUT PWSTRING DriverName
  485. )
  486. /*++
  487. Routine Description:
  488. This routine computes the driver name corresponding to the
  489. given file system name.
  490. Arguments:
  491. FileSystemName - Supplies the name of the file system.
  492. DriverName - Returns the name of the corresponding driver.
  493. Return Value:
  494. FALSE - Failure.
  495. TRUE - Success.
  496. --*/
  497. {
  498. DSTRING fat_name, hpfs_name;
  499. if (!fat_name.Initialize("FAT") || !hpfs_name.Initialize("HPFS")) {
  500. return FALSE;
  501. }
  502. if (!FileSystemName->Stricmp(&fat_name)) {
  503. return DriverName->Initialize("FASTFAT");
  504. } else if (!FileSystemName->Stricmp(&hpfs_name)) {
  505. return DriverName->Initialize("PINBALL");
  506. }
  507. return DriverName->Initialize(FileSystemName);
  508. }
  509. IFSUTIL_EXPORT
  510. BOOLEAN
  511. IFS_SYSTEM::EnableFileSystem(
  512. IN PCWSTRING FileSystemName
  513. )
  514. /*++
  515. Routine Description:
  516. This routine will simply return TRUE because file systems are
  517. enabled automatically due to a recent IO system change.
  518. Formerly, this routine used to enable the file system in
  519. the registry.
  520. Arguments:
  521. FileSystemName - Supplies the name of the file system to enable.
  522. Return Value:
  523. FALSE - Failure.
  524. TRUE - Success.
  525. --*/
  526. {
  527. UNREFERENCED_PARAMETER(FileSystemName);
  528. return TRUE;
  529. }
  530. IFSUTIL_EXPORT
  531. BOOLEAN
  532. IFS_SYSTEM::IsFileSystemEnabled(
  533. IN PCWSTRING FileSystemName,
  534. OUT PBOOLEAN Error
  535. )
  536. /*++
  537. Routine Description:
  538. This routine will always return TRUE now that the IO
  539. system will automatically load file systems when needed.
  540. Formerly, this method used to examine the registry
  541. for this information.
  542. Argument:
  543. FileSystemName - Supplies the name of the file system.
  544. Error - Returns whether or not an error occurred.
  545. Return Value:
  546. FALSE - The file system is not enabled.
  547. TRUE - The file system is enabled.
  548. --*/
  549. {
  550. UNREFERENCED_PARAMETER(FileSystemName);
  551. if (Error) {
  552. *Error = FALSE;
  553. }
  554. return TRUE;
  555. }
  556. IFSUTIL_EXPORT
  557. VOID
  558. IFS_SYSTEM::QueryNtfsTime(
  559. OUT PLARGE_INTEGER NtfsTime
  560. )
  561. /*++
  562. Routine Description:
  563. This method returns the current time in NTFS (ie. NT) format.
  564. Arguments
  565. NtfsTime -- receives the current time in NTFS format.
  566. Return Value:
  567. None.
  568. --*/
  569. {
  570. EfiQuerySystemTime( NtfsTime );
  571. }
  572. IFSUTIL_EXPORT
  573. ULONG
  574. IFS_SYSTEM::QueryPageSize(
  575. )
  576. /*++
  577. Routine Description:
  578. This method determines the page size of the system.
  579. Arguments:
  580. None.
  581. Return Value:
  582. The system page size. A return value of 0 indicates error.
  583. --*/
  584. {
  585. // BUGBUG do I need this in EFI?
  586. return 0x1000;
  587. }