Why the DeviceObject->Flags = 0?

In DeviceTree, I noticed that the Flags of all Fastfat device is 0.
For example: \Device\HarddiskVolume3 (Flags = 0x0).

So after my IFS filter driver attached to it, the filter device’s
DeviceObject->Flags = 0x0. This cause a problem, in my IRP_MJ_WRITE/READ
function, I can not get the user buffer, sometimes the Irp->UserBuffer =
NULL,
but the write length is still looks valid.

Anyone can explain this? where to get the real buffer if DeviceObject->Flags
= 0 and
Irp->UserBuffer = NULL?

thanks in advance,

AFei

File systems don’t really fit well into the simplistic
buffered/direct/neither model. Paging I/O is done using direct I/O
(MDLs) and user I/O is done using buffered I/O, but the file system may
post user requests, in which case it converts from neither to direct (by
constructing an MDL). I generally suggest:

  • Check Irp->MdlAddress FIRST
  • Use Irp->UserBuffer SECOND

Of course, this is for IRP_MJ_READ, IRP_MJ_WRITE, IRP_MJ_QUERY_EA,
IRP_MJ_SET_EA, IRP_MJ_DIRECTORY_CONTROL/IRP_MN_QUERY_DIRECTORY,
IRP_MJ_QUERY_QUOTA, IRP_MJ_SET_QUOTA. These are controlled by the Flags
field in the device object.

IRP_MJ_QUERY_SECURITY and IRP_MJ_SET_SECURITY are always neither
(Irp->UserBuffer) no matter what the device object flags are set to.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of AFei
Sent: Friday, July 23, 2004 9:07 PM
To: ntfsd redirect
Subject: [ntfsd] Why the DeviceObject->Flags = 0?

In DeviceTree, I noticed that the Flags of all Fastfat device is 0.
For example: \Device\HarddiskVolume3 (Flags = 0x0).

So after my IFS filter driver attached to it, the filter device’s
DeviceObject->Flags = 0x0. This cause a problem, in my IRP_MJ_WRITE/READ
function, I can not get the user buffer, sometimes the Irp->UserBuffer =
NULL, but the write length is still looks valid.

Anyone can explain this? where to get the real buffer if
DeviceObject->Flags = 0 and
Irp->UserBuffer = NULL?

thanks in advance,

AFei


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com To unsubscribe
send a blank email to xxxxx@lists.osr.com

Thanks Tony,
Yes, in that case, the MDLAddress contain the real buffer.

AFei

“Tony Mason” wrote in message news:xxxxx@ntfsd…
File systems don’t really fit well into the simplistic
buffered/direct/neither model. Paging I/O is done using direct I/O
(MDLs) and user I/O is done using buffered I/O, but the file system may
post user requests, in which case it converts from neither to direct (by
constructing an MDL). I generally suggest:

- Check Irp->MdlAddress FIRST
- Use Irp->UserBuffer SECOND

Of course, this is for IRP_MJ_READ, IRP_MJ_WRITE, IRP_MJ_QUERY_EA,
IRP_MJ_SET_EA, IRP_MJ_DIRECTORY_CONTROL/IRP_MN_QUERY_DIRECTORY,
IRP_MJ_QUERY_QUOTA, IRP_MJ_SET_QUOTA. These are controlled by the Flags
field in the device object.

IRP_MJ_QUERY_SECURITY and IRP_MJ_SET_SECURITY are always neither
(Irp->UserBuffer) no matter what the device object flags are set to.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of AFei
Sent: Friday, July 23, 2004 9:07 PM
To: ntfsd redirect
Subject: [ntfsd] Why the DeviceObject->Flags = 0?

In DeviceTree, I noticed that the Flags of all Fastfat device is 0.
For example: \Device\HarddiskVolume3 (Flags = 0x0).

So after my IFS filter driver attached to it, the filter device’s
DeviceObject->Flags = 0x0. This cause a problem, in my IRP_MJ_WRITE/READ
function, I can not get the user buffer, sometimes the Irp->UserBuffer =
NULL, but the write length is still looks valid.

Anyone can explain this? where to get the real buffer if
DeviceObject->Flags = 0 and
Irp->UserBuffer = NULL?

thanks in advance,

AFei


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com To unsubscribe
send a blank email to xxxxx@lists.osr.com