Ravi,
I think the confusion (on my part) is that he refers to
Parameters.QueryDirectory.Length, which immediately made me think he was
using an IRP_MJ_DIRECTORY_CONTROL/IRP_MN_QUERY_DIRECTORY.
Upon further reading (and a quick peek at DFS) I would note that I think
this is just some very fundamental level of confusion. DFS does not handle
IRP_MJ_DIRECTORY_CONTROL in any case, as you note.
Greg - can you tell us what operation you are performing? If you are trying
IRP_MJ_QUERY_INFORMATION or IRP_MJ_SET_INFORMATION, you cannot use the
MdlAddress, no matter that you are setting the DO_DIRECT_IO option.
The DeviceObject->Flags field is only used for a subset of operations
(notably, those that transfer large data elements between user/kernel
memory) and not for ALL operations. I listed these operations earlier, but
I’ll list them again.
IRP_MJ_READ
IRP_MJ_WRITE
IRP_MJ_QUERY_SECURITY
IRP_MJ_SET_SECURITY
IRP_MJ_QUERY_EA
IRP_MJ_SET_EA
IRP_MJ_DIRECTORY_CONTROL
And, on a per control-code basis:
IRP_MJ_DEVICE_CONTROL
IRP_MJ_INTERNAL_DEVICE_CONTROL
IRP_MJ_FILE_SYSTEM_CONTROL
ALL other operations are done via buffered I/O, no matter what it says in
the DeviceObject->Flags field.
Look at Irp->AssociatedIrp.SystemBuffer for these other cases.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: Ravisankar Pudipeddi [mailto:xxxxx@windows.microsoft.com]
Sent: Thursday, March 14, 2002 11:54 AM
To: File Systems Developers
Subject: [ntfsd] Re: which buffer to use?
While what you say may or may not be true regarding DFS, Greg’s problem
is different.
QUERY_INFORMATION & SET_INFORMATION are always buffered by NT i/o
manager regardless of what kind of i/o you support - the device object
flags don’t matter.
Use AssociatedIrp.SystemBuffer always.
I/O manager does initialize the Irp->UserBuffer field to the original
user buffer. The MdlAddress can be NULL because i/o doesn’t allocate MDL
for it - since this operation is buffered always.
If you want the MDL for some reason you can always allocate it.
Ravi
-----Original Message-----
From: Tony Mason [mailto:xxxxx@osr.com]
Sent: Wednesday, March 13, 2002 2:47 PM
To: File Systems Developers
Subject: [ntfsd] Re: which buffer to use?
Greg,
Of course you would have a problem with DFS - I bet it has never been
tested against anything OTHER than a NEITHER I/O file system! The I/O
Manager does handle such a case.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: Greg Pearce [mailto:xxxxx@filetek.com]
Sent: Wednesday, March 13, 2002 4:14 PM
To: File Systems Developers
Subject: [ntfsd] Re: which buffer to use?
Hi Tony,
Thanks for the info - I am setting DO_DIRECT_IO in the DeviceObject when
I create it, so I should be able to use the MDL address for this Irp,
right?
Sometimes the MDL address is NULL (Is this because the Irp is from my
FSP queue or from a filter driver above mine in the stack? I really see
this access violation frequently when DFS is running (this doesn’t
happen in win2k pro).
I found a tip in your book on page 325 that states that it is possible
to get a zero length buffer. Is the user buffer length found in
IrpSp->Parameters.QueryDirectory.Length, and if so, is it valid for
whichever buffer I get (either MDLAddress buffer or Irp->UserBuffer)?
I was not checking for this possibility before, but now I am and maybe
my test will survive the night! 
Thanks and regards,
Greg
You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to %%email.unsub%%