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.

127 lines
3.5 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1992, Microsoft Corporation.
  4. //
  5. // File: attach.h
  6. //
  7. // Contents: This module defines the data structures used in attaching
  8. // to an existing file system volume.
  9. //
  10. // Functions:
  11. //
  12. //-----------------------------------------------------------------------------
  13. #ifndef _ATTACH_
  14. #define _ATTACH_
  15. //
  16. // For each local file system volume on which there exists a local
  17. // DFS volume, a DFS volume device object is created, and attached
  18. // to the local file system volume device object via
  19. // IoAttachDeviceByPointer. This permits the DFS driver to
  20. // pre-screen any I/O which takes place on the local volume
  21. // and adjust it for DFS file I/O semantics.
  22. //
  23. // In many cases, the I/O can simply be passed through to the local
  24. // file system for handling. In some cases, parameters of the I/O
  25. // request must be examined and possibly modified before passing it
  26. // along to the underlying file system. In some cases, e.g., an attempt
  27. // to rename a directory along an exit path, the I/O request may be
  28. // returned with an error status.
  29. //
  30. //
  31. // The Volume device object is associated with every volume to which this
  32. // file system has been attached.
  33. //
  34. typedef struct _DFS_VOLUME_OBJECT {
  35. DEVICE_OBJECT DeviceObject; // simple device object.
  36. ULONG AttachCount; // count of attachments
  37. LIST_ENTRY VdoLinks; // links for DfsData.AVdoQueue
  38. PROVIDER_DEF Provider; // provider definition for passthrough
  39. PDEVICE_OBJECT RealDevice; // The bottommost device in
  40. // the chain of attached
  41. // devices.
  42. BOOLEAN DfsEnable; // Dfs Enabled or disable
  43. } DFS_VOLUME_OBJECT, *PDFS_VOLUME_OBJECT;
  44. //
  45. // The File System Attach device object is associated with every File
  46. // System Device Object that is available in the system
  47. //
  48. typedef struct _DFS_ATTACH_FILE_SYSTEM_OBJECT {
  49. DEVICE_OBJECT DeviceObject; // simple device object.
  50. LIST_ENTRY FsoLinks; // links for DfsData.AFsoQueue
  51. PDEVICE_OBJECT TargetDevice; // The one we are attached to
  52. } DFS_ATTACH_FILE_SYSTEM_OBJECT, *PDFS_ATTACH_FILE_SYSTEM_OBJECT;
  53. //
  54. // Public function prototypes in attach.c
  55. //
  56. NTSTATUS
  57. DfsGetAttachName(
  58. IN PUNICODE_STRING LocalVolumeStorageId,
  59. OUT PUNICODE_STRING LocalVolumeRelativeName
  60. );
  61. NTSTATUS
  62. DfsSetupVdo(
  63. IN PUNICODE_STRING RootName,
  64. IN PDEVICE_OBJECT ptargetVdo,
  65. IN PDEVICE_OBJECT realDevice,
  66. IN ULONG pVolNameLen,
  67. OUT PDFS_VOLUME_OBJECT *pdfsVdo);
  68. NTSTATUS
  69. DfsAttachVolume(
  70. IN PUNICODE_STRING RootName,
  71. OUT PPROVIDER_DEF *ppProvider
  72. );
  73. NTSTATUS
  74. DfsDetachVolume(
  75. IN PUNICODE_STRING TargetName
  76. );
  77. NTSTATUS
  78. DfsDetachVolumeForDelete(
  79. IN PDEVICE_OBJECT DfsVdo
  80. );
  81. VOID
  82. DfsReattachToMountedVolume(
  83. IN PDEVICE_OBJECT TargetDevice,
  84. IN PVPB Vpb
  85. );
  86. VOID
  87. DfsFsNotification(
  88. IN PDEVICE_OBJECT FileSystemObject,
  89. IN BOOLEAN fLoading
  90. );
  91. VOID
  92. DfsDetachAllFileSystems(
  93. VOID
  94. );
  95. NTSTATUS
  96. DfsVolumePassThrough(
  97. IN PDEVICE_OBJECT DeviceObject,
  98. IN PIRP Irp
  99. );
  100. NTSTATUS
  101. DfsCompleteVolumePassThrough(
  102. IN PDEVICE_OBJECT pDevice,
  103. IN PIRP Irp,
  104. IN PVOID Context
  105. );
  106. #endif // _ATTACH