Re: problem to understand behavior of I/O manager
- From: "Maxim S. Shatskih" <maxim@xxxxxxxxxxxxxxxx>
- Date: Sat, 23 Feb 2008 00:33:09 +0300
IO manager calls the "current" driver which which the file object is
associated (IoGetRelatedDeviceObject is used to get the "current" device
object), it can be FSD, can be not an FSD.
Tasks of IO manager in NtRead/Write/DeviceIoControlFile paths:
- deref the file handle to the file object using ObReferenceObjectByHandle
- deal with the buffering, create a system buffer and copy the data if
necessary, create and lock a MDL if necessary
- get the device object by IoGetRelatedDeviceObject
- allocate an IRP for this device object and associate it with the buffer
- IoCallDriver
- IopSynchronousServiceTail
IopSynchronousServiceTail does
- if not STATUS_PENDING is returned by IoCallDriver - call
IopCompleteRequest
- if STATUS_PENDING is returned AND if the file object is not overlapped -
wait for the IRP to be completed
- handle cancellation issues and thread kill issues in this wait
IopCompleteRequest does:
- copy the data back to user buffer if this is a buffered read
- free the ->MdlAddress or the ->AssociatedIrp.SystemBuffer if needed
- copy the ->IoStatus to *(->UserIosb) under a __try/__except block
- signal ->UserEvent if any
- deliver the IRP to the IOCP's queue if any
- queue a user APC using KAPC at IRPs tail if Read/WriteFileEx were used
- otherwise, just free the IRP
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com
"R2" <gamiravi.d@xxxxxxxxx> wrote in message
news:abd52740-b8a0-406c-87ad-5fffeefb6311@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi All,
As one driver can communicate to other driver with the help this
data structure called IRP.(I/O request packets).
when user application perform any I/O request.I/O manager get
control and forms IRPs for that request . Here first of all I/O
manager calls file sytem driver then it calls for our appropriate
driver. Question is that what are the activities that are perform when
I/O manager calls for file system driver?
Thanks,
Ravi.
.
- Follow-Ups:
- Re: problem to understand behavior of I/O manager
- From: Kalle Olavi Niemitalo
- Re: problem to understand behavior of I/O manager
- References:
- Prev by Date: Re: Regarding IA64 bit driver
- Next by Date: Re: Strange CmResourceTypeInterrupt Level & Vector values
- Previous by thread: Re: problem to understand behavior of I/O manager
- Next by thread: Re: problem to understand behavior of I/O manager
- Index(es):
Relevant Pages
|
Loading