IRP-Based I/O Operations That Obey Device Object Flags
The buffering method for the following IRP-based I/O operations is determined by the value of the Flags member of the DEVICE_OBJECT structure for the file system volume:
IRP_MJ_DIRECTORY_CONTROL
IRP_MJ_QUERY_EA
IRP_MJ_QUERY_QUOTA
IRP_MJ_READ
IRP_MJ_SET_EA
IRP_MJ_SET_QUOTA
IRP_MJ_WRITE
The DO_BUFFERED_IO and DO_DIRECT_IO flags in the Flags member are used as follows:
If the DO_BUFFERED_IO flag is set, the operation uses buffered I/O.
If the DO_DIRECT_IO flag is set and the DO_BUFFERED_IO flag is not set, the operation uses direct I/O.
If neither flag is set, the operation uses neither buffered nor direct I/O.
For more information about device object flags, see DEVICE_OBJECT and Initializing a Device Object.
Note that IRP_MJ_READ and IRP_MJ_WRITE can be IRP-based or fast I/O operations. When they are IRP-based, the buffering method is determined by the device object flags as described above. When these operations are fast I/O, they always use neither buffered nor direct I/O. For more information about I/O operations that can be IRP-based or fast I/O operations, see Operations That Can Be IRP-Based or Fast I/O.