Confusion regarding buffering stratergy

I have three device objects stack on the top of another. Since for read
write request, all device object choose their own strategy for doing the IO.
They can do direct IO, buffered IO or neither IO. Now suppose device objects
are A,B & C. B on the top of A and C on the top of B. suppose all are FSFD
so the calls comes direct from IO Manager, I mean to say they are the first
driver to get the IRP. Suppose A choose to have buffered Io B chose for
direct IO and C again wants buffered IO. In this scenario how the IO manager
manages the flow of data between the drivers. Now first C recieves the
IRP, IO mgr copies the buffer from user location to kernel location.
Again C calls B through IOCallDriver. Now B expects MDL. Do the IO mgr
creates the mdl for Driver B. Again it calls driver A, it expects again
buffer for IO. So who is going to make all the changes.


Regards
Rohit Gauba

Surely for read and write requests each of A, B and C are obliged to handle
all of the different possible presentations of the “buffer” which are
possible for read and write requests?

“Rohit” wrote in message news:xxxxx@ntfsd…
I have three device objects stack on the top of another. Since for read
write request, all device object choose their own strategy for doing the IO.
They can do direct IO, buffered IO or neither IO. Now suppose device objects
are A,B & C. B on the top of A and C on the top of B. suppose all are FSFD
so the calls comes direct from IO Manager, I mean to say they are the first
driver to get the IRP. Suppose A choose to have buffered Io B chose for
direct IO and C again wants buffered IO. In this scenario how the IO manager
manages the flow of data between the drivers. Now first C recieves the IRP,
IO mgr copies the buffer from user location to kernel location. Again C
calls B through IOCallDriver. Now B expects MDL. Do the IO mgr creates the
mdl for Driver B. Again it calls driver A, it expects again buffer for IO.
So who is going to make all the changes.


Regards
Rohit Gauba

What i got from your answer is that driver itself is responsible for
preparing the IO (MDL or Buffer) as required by lower level driver. It does
not matter what IO it is using. If driver is using the same IO as required
by lower level driver, then simply pass the mdl address in IRP or buffer
address in AssociatedIRP field and if it is using different IO mechanism
then create the MDL or Buiffer for lower level driver.


Regards
Rohit Gauba