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.

178 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. RawProcs.h
  5. Abstract:
  6. This module defines all of the globally used procedures in the Raw
  7. file system.
  8. Author:
  9. David Goebel [DavidGoe] 18-Mar-91
  10. Revision History:
  11. --*/
  12. #ifndef _RAWPROCS_
  13. #define _RAWPROCS_
  14. #pragma warning(disable:4214) // bit field types other than int
  15. #pragma warning(disable:4201) // nameless struct/union
  16. #pragma warning(disable:4324) // alignment sensitive to declspec
  17. #pragma warning(disable:4127) // condition expression is constant
  18. #pragma warning(disable:4115) // named type definition in parentheses
  19. #include <string.h>
  20. #include <ntos.h>
  21. #include <zwapi.h>
  22. #include <FsRtl.h>
  23. #include <ntdddisk.h>
  24. #include "nodetype.h"
  25. #include "RawStruc.h"
  26. //
  27. // This is the main entry point to the Raw File system.
  28. //
  29. NTSTATUS
  30. RawDispatch (
  31. IN PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
  32. IN PIRP Irp
  33. );
  34. //
  35. // MAJOR FUNCTIONS
  36. //
  37. // These routines are called by RawDispatch via the I/O system via the
  38. // dispatch table in the Driver Object. If the status returned is not
  39. // STATUS_PENDING, the Irp will be complete with this status.
  40. //
  41. NTSTATUS
  42. RawCleanup ( // implemented in Cleanup.c
  43. IN PVCB Vcb,
  44. IN PIRP Irp,
  45. IN PIO_STACK_LOCATION IrpSp
  46. );
  47. NTSTATUS
  48. RawClose ( // implemented in Close.c
  49. IN PVCB Vcb,
  50. IN PIRP Irp,
  51. PIO_STACK_LOCATION IrpSp
  52. );
  53. NTSTATUS
  54. RawCreate ( // implemented in Create.c
  55. IN PVCB Vcb,
  56. IN PIRP Irp,
  57. PIO_STACK_LOCATION IrpSp
  58. );
  59. NTSTATUS
  60. RawFileSystemControl ( // implemented in FsCtrl.c
  61. IN PVCB Vcb,
  62. IN PIRP Irp,
  63. PIO_STACK_LOCATION IrpSp
  64. );
  65. NTSTATUS
  66. RawReadWriteDeviceControl ( // implemented in ReadWrit.c
  67. IN PVCB Vcb,
  68. IN PIRP Irp,
  69. PIO_STACK_LOCATION IrpSp
  70. );
  71. NTSTATUS
  72. RawQueryInformation ( // implemented in FileInfo.c
  73. IN PVCB Vcb,
  74. IN PIRP Irp,
  75. PIO_STACK_LOCATION IrpSp
  76. );
  77. NTSTATUS
  78. RawSetInformation ( // implemented in FileInfo.c
  79. IN PVCB Vcb,
  80. IN PIRP Irp,
  81. PIO_STACK_LOCATION IrpSp
  82. );
  83. NTSTATUS
  84. RawQueryVolumeInformation ( // implemented in VolInfo.c
  85. IN PVCB Vcb,
  86. IN PIRP Irp,
  87. PIO_STACK_LOCATION IrpSp
  88. );
  89. //
  90. // Miscellaneous support routines
  91. //
  92. //
  93. // Completion routine for read, write, and device control to deal with
  94. // verify issues. Implemented in RawDisp.c
  95. //
  96. NTSTATUS
  97. RawCompletionRoutine(
  98. IN PDEVICE_OBJECT DeviceObject,
  99. IN PIRP Irp,
  100. IN PVOID Context
  101. );
  102. //
  103. // In-memory structure support routines, implemented in StrucSup.c
  104. //
  105. NTSTATUS
  106. RawInitializeVcb (
  107. IN OUT PVCB Vcb,
  108. IN PDEVICE_OBJECT TargetDeviceObject,
  109. IN PVPB Vpb
  110. );
  111. BOOLEAN
  112. RawCheckForDismount (
  113. PVCB Vcb,
  114. BOOLEAN CalledFromCreate
  115. );
  116. //
  117. // This macro returns TRUE if a flag in a set of flags is on and FALSE
  118. // otherwise
  119. //
  120. #define BooleanFlagOn(Flags,SingleFlag) ( \
  121. ((Flags) & (SingleFlag)) != 0 ? TRUE : FALSE)
  122. //
  123. // This macro just returns the particular flag if its set
  124. //
  125. #define FlagOn(F,SF) ( \
  126. (((F) & (SF))) \
  127. )
  128. //
  129. // This macro completes a request
  130. //
  131. #define RawCompleteRequest(IRP,STATUS) { \
  132. \
  133. (IRP)->IoStatus.Status = (STATUS); \
  134. \
  135. IoCompleteRequest( (IRP), IO_DISK_INCREMENT ); \
  136. }
  137. #endif // _RAWPROCS_