Re: problem to understand behavior of I/O manager



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.

.



Relevant Pages

  • Re: how to determine if given IRP is completed?
    ... > to determine if the IRP is completed and my approach was wrong. ... but the installation of that driver seems to ... > different (it requires using device manager, ... >> all of this complexity goes away if you use kbfiltr and just invoke the ...
    (microsoft.public.development.device.drivers)
  • Re: Creating an IRP in serial filter driver, and using IoCallDriver
    ... there's not a file object set. ... > wild goose chase and compared the IRP and IO_STACK_LOCATION ... > to generate my IRP_MJ_WRITE request to the lower driver. ...
    (microsoft.public.development.device.drivers)
  • Re: DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS
    ... cancelling all timers, cancelling all DPCs queued, as per Walter Oneys ... IO manager, before it unlolads the driver. ... a devioctl Irp to a driver that was unloaded. ...
    (microsoft.public.development.device.drivers)
  • Re: Bug in PartMgr
    ... Not dereferencing the file object prevents the safe removal icon from ... My driver does need to send IOCTL_STORAGE_CHECK_VERIFY without the file ... 0: kd>!devobj 0x888eba10 ...
    (microsoft.public.development.device.drivers)
  • Re: system just recoered from a serious error
    ... App/Device Driver File Name Manufacturer Help ... Network Card Supported Not Required Troubleshooter ... Local Disk 34% More Info ... Are there any yellow question marks in Device Manager? ...
    (microsoft.public.windowsxp.basics)

Loading