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.

211 lines
3.5 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. fs_rec.h
  5. Abstract:
  6. This module contains the main header file for the mini-file system
  7. recognizer driver.
  8. Author:
  9. Darryl E. Havens (darrylh) 22-nov-1993
  10. Environment:
  11. Kernel mode, local to I/O system
  12. Revision History:
  13. --*/
  14. #include "ntifs.h"
  15. #include "ntdddisk.h"
  16. #include "ntddcdrm.h"
  17. //
  18. // Define the debug trace levels.
  19. //
  20. #define FSREC_DEBUG_LEVEL_FSREC 0x00000001
  21. #define FSREC_DEBUG_LEVEL_NTFS 0x00000002
  22. #define FSREC_DEBUG_LEVEL_CDFS 0x00000004
  23. #define FSREC_DEBUG_LEVEL_UDFS 0x00000008
  24. #define FSREC_DEBUG_LEVEL_FAT 0x00000010
  25. #define FSREC_POOL_TAG 'crsF'
  26. //#ifndef SetFlag
  27. //#define SetFlag(Flags,SingleFlag) ( \
  28. // (Flags) |= (SingleFlag) \
  29. //)
  30. //#endif
  31. //#ifndef ClearFlag
  32. //#define ClearFlag(Flags,SingleFlag) ( \
  33. // (Flags) &= ~(SingleFlag) \
  34. //)
  35. //#endif
  36. //
  37. // Define the file system types for the device extension.
  38. //
  39. typedef enum _FILE_SYSTEM_TYPE {
  40. CdfsFileSystem = 1,
  41. FatFileSystem,
  42. HpfsFileSystem,
  43. NtfsFileSystem,
  44. UdfsFileSystem
  45. } FILE_SYSTEM_TYPE, *PFILE_SYSTEM_TYPE;
  46. //
  47. // Define the device extension for this driver.
  48. //
  49. typedef enum _RECOGNIZER_STATE {
  50. Active,
  51. Transparent,
  52. FastUnload
  53. } RECOGNIZER_STATE, *PRECOGNIZER_STATE;
  54. typedef struct _DEVICE_EXTENSION {
  55. PDEVICE_OBJECT CoRecognizer;
  56. FILE_SYSTEM_TYPE FileSystemType;
  57. RECOGNIZER_STATE State;
  58. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  59. //
  60. // Define the functions provided by this driver.
  61. //
  62. NTSTATUS
  63. DriverEntry(
  64. IN PDRIVER_OBJECT DriverObject,
  65. IN PUNICODE_STRING RegistryPath
  66. );
  67. NTSTATUS
  68. FsRecCleanupClose(
  69. IN PDEVICE_OBJECT DeviceObject,
  70. IN PIRP Irp
  71. );
  72. NTSTATUS
  73. FsRecShutdown(
  74. IN PDEVICE_OBJECT DeviceObject,
  75. IN PIRP Irp
  76. );
  77. NTSTATUS
  78. FsRecCreate(
  79. IN PDEVICE_OBJECT DeviceObject,
  80. IN PIRP Irp
  81. );
  82. NTSTATUS
  83. FsRecCreateAndRegisterDO(
  84. IN PDRIVER_OBJECT DriverObject,
  85. IN PDEVICE_OBJECT HeadRecognizer OPTIONAL,
  86. OUT PDEVICE_OBJECT *NewRecognizer OPTIONAL,
  87. IN PWCHAR RecFileSystem,
  88. IN PWCHAR FileSystemName,
  89. IN FILE_SYSTEM_TYPE FileSystemType,
  90. IN DEVICE_TYPE DeviceType
  91. );
  92. NTSTATUS
  93. FsRecFsControl(
  94. IN PDEVICE_OBJECT DeviceObject,
  95. IN PIRP Irp
  96. );
  97. VOID
  98. FsRecUnload(
  99. IN PDRIVER_OBJECT DriverObject
  100. );
  101. NTSTATUS
  102. FsRecLoadFileSystem (
  103. IN PDEVICE_OBJECT DeviceObject,
  104. IN PWCHAR DriverServiceKey
  105. );
  106. BOOLEAN
  107. FsRecGetDeviceSectorSize (
  108. IN PDEVICE_OBJECT DeviceObject,
  109. OUT PULONG BytesPerSector
  110. );
  111. BOOLEAN
  112. FsRecGetDeviceSectors (
  113. IN PDEVICE_OBJECT DeviceObject,
  114. IN ULONG BytesPerSector,
  115. OUT PLARGE_INTEGER NumberOfSectors
  116. );
  117. BOOLEAN
  118. FsRecReadBlock(
  119. IN PDEVICE_OBJECT DeviceObject,
  120. IN PLARGE_INTEGER ByteOffset,
  121. IN ULONG MinimumBytes,
  122. IN ULONG BytesPerSector,
  123. OUT PVOID *Buffer,
  124. OUT PBOOLEAN IsDeviceFailure OPTIONAL
  125. );
  126. #if DBG
  127. extern LONG FsRecDebugTraceLevel;
  128. extern LONG FsRecDebugTraceIndent;
  129. BOOLEAN
  130. FsRecDebugTrace (
  131. LONG IndentIncrement,
  132. ULONG TraceMask,
  133. PCHAR Format,
  134. ...
  135. );
  136. #define DebugTrace(M) FsRecDebugTrace M
  137. #else
  138. #define DebugTrace(M) TRUE
  139. #endif
  140. //
  141. // Define the per-type recognizers.
  142. //
  143. NTSTATUS
  144. CdfsRecFsControl(
  145. IN PDEVICE_OBJECT DeviceObject,
  146. IN PIRP Irp
  147. );
  148. NTSTATUS
  149. UdfsRecFsControl(
  150. IN PDEVICE_OBJECT DeviceObject,
  151. IN PIRP Irp
  152. );
  153. NTSTATUS
  154. FatRecFsControl(
  155. IN PDEVICE_OBJECT DeviceObject,
  156. IN PIRP Irp
  157. );
  158. NTSTATUS
  159. NtfsRecFsControl(
  160. IN PDEVICE_OBJECT DeviceObject,
  161. IN PIRP Irp
  162. );