IRP_NOCACHE has no bearing on where the data for the operation is stored;
this is a function of the Flags field in the DeviceObject (and is well
documented in the DDK.)
The default is to use neither I/O transfer, in which case Irp->UserBuffer is
the address of the user buffer containing the data. Of course, the buffer
might not be valid (it has not been validated by the OS, that is your
driver’s responsibility.)
If DO_DIRECT_IO is set in the Flags field, then the device uses direct I/O
and you can find the data as Irp->MdlAddress (and Irp->UserBuffer will point
to the original address from user mode, but of course it may not be valid at
the point you access it.) The MDL memory has been validated by the I/O
Manager.
If DO_BUFFERED_IO is set in the Flags field, then the device uses buffered
I/O and you can find the data as Irp->AssociatedIrp.SystemBuffer (again,
Irp->UserBuffer may point to something, but it may not be valid at the point
you access it.) The system buffer is allocated from nonpaged pool.
The Flags field of the device object applies to: IRP_MJ_READ, IRP_MJ_WRITE,
IRP_MJ_QUERY_SECURITY, IRP_MJ_SET_SECURITY, IRP_MJ_QUERY_EA, IRP_MJ_SET_EA
and IRP_MJ_DIRECTORY_CONTROL. There are special rules (based upon the I/O
control code) for IRP_MJ_DEVICE_CONTROL, IRP_MJ_INTERNAL_DEVICE_CONTROL, and
IRP_MJ_FILE_SYSTEM_CONTROL. All other operations use buffered I/O (so the
data is in Irp->AssociatedIrp.SystemBuffer).
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: Zhong Jim [mailto:xxxxx@hotmail.com]
Sent: Monday, May 26, 2003 2:00 AM
To: File Systems Developers
Subject: [ntfsd] Question about IRP_NOCACHE
Hi all:
In an IRP_MJ_READ,if IRP_NOCACHE is not
setted(Irp->Flags&IRP_NOCACHE=0),where can I get the pointer to the buffer
that stores the file content.(I notice that PtrIrp->MdlAddress=0x00000000.)
Thanks!
Jim
???ѽ??н???ʹ?? MSN Messenger: http://messenger.msn.com/cn
You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com