(1) When we are initialising DeviceObject flags, should we choose only
one of three I/O options. What if I ORed them?

DeviceObject->Flags |= deviceExtension->StackDeviceObject->Flags &
(DO_BUFFERED_IO | DO_DIRECT_IO );

(2) Some IOCTLs I use buffered I/O and some I use Direct I/O. They are
working fine.

What is the purpose of initialising in DeviceObject? We are anyway
pointing in IOCTL.

Thanks.

Re: direct I/O, buffered I/O by Maxim

Maxim
Wed Aug 13 09:47:01 CDT 2003

> one of three I/O options. What if I ORed them?
>
> DeviceObject->Flags |= deviceExtension->StackDeviceObject->Flags &
> (DO_BUFFERED_IO | DO_DIRECT_IO );

Ha-ha-ha. Dunno, but I'm sure nothing good will result.

> What is the purpose of initialising in DeviceObject? We are anyway
> pointing in IOCTL.

This governs reads and writes, IOCTLs are governed by IOCTL code bits.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com




Re: direct I/O, buffered I/O by Calvin

Calvin
Thu Aug 14 08:14:52 CDT 2003

>
> DeviceObject->Flags |= deviceExtension->StackDeviceObject->Flags &
> (DO_BUFFERED_IO | DO_DIRECT_IO );

You are copying whatever buffering bit from lower driver, aren't you?
I think the lower driver wouldn't have both bits set.

> (2) Some IOCTLs I use buffered I/O and some I use Direct I/O. They are
> working fine.

Each IOCTL code has fields to tell IO manager what buffering method it's
using.

> What is the purpose of initialising in DeviceObject? We are anyway
> pointing in IOCTL.

These bits in DevObject tell IO manager what buffering method is used for
IRP_MJ_READ and IRP_MJ_WRITE.

Calvin