buffers at read/write completion routines

I have a file system filter driver that implements read and write completion
routines. In these routines I need to look at the data being read or written.
According to the Nagar book I should be able to either use the buffer in
irp.AssociatedIrp.SystemBuffer or in Irp.MdlAddress. Is one of these “buffers”
going to be valid at the completion routine?

On a related note, the book says you must use
MmGetSystenAddressForMdl(irp.MdlAddress), but then a few sentences later says
to avoid MmGetSystenAddressForMdl. Can someone explain this?

Thanks.

Neil

irp.AssociatedIrp.SystemBuffer is used with Buffered I/O while
Irp.MdlAddress is used with Direct I/O. however, file systems like NTFS
implements Neither I/O so if you want to access the buffer, use
Irp.UserBuffer instead. however, when you want to access this buffer in an
arbitrary thread context, like in completion routines, you will have to
allocate a Mdl for this buffer and lock the pages in this Mdl during the
dispatch routine so that you can call MmGetSystemAddressForMdl with this
Mdl.

i hope this helps as i do not have the book with me now so am not able to
know what exactly you wanted.

Ho Mun Chuen
@@ “Not everything that counts can be counted;
<” )~ and not everything that can be counted counts"
//\ … Albert Einstein
----- Original Message -----
From: Neil Weicher
To: File Systems Developers
Sent: Sunday, May 14, 2000 4:46 AM
Subject: [ntfsd] buffers at read/write completion routines

I have a file system filter driver that implements read and write completion
routines. In these routines I need to look at the data being read or
written.
According to the Nagar book I should be able to either use the buffer in
irp.AssociatedIrp.SystemBuffer or in Irp.MdlAddress. Is one of these
“buffers”
going to be valid at the completion routine?

On a related note, the book says you must use
MmGetSystenAddressForMdl(irp.MdlAddress), but then a few sentences later
says
to avoid MmGetSystenAddressForMdl. Can someone explain this?

Thanks.

Neil


You are currently subscribed to ntfsd as: xxxxx@pmail.ntu.edu.sg
To unsubscribe send a blank email to $subst(‘Email.Unsub’)