I use MyShadowDO to implement IoCreateFileSpecifyDeviceObjectHint.
It works well.
But when I ZwClose it.I found that :
the IRP_MJ_CLEANUP is send to the top of StorageDeviceStack.not
MyShadowDO.
I think I ZwCreateFile by MyShadowDO,then the Cleanup IRP should send to
MyShadowDO too.but,the result is StorageDeviceStack(my FS filter device
object will receive the Cleanup IRP).
Why?anybody can explain it.thanks!
Its because how the DeleteObject method for a file object is implemented.
----- Original Message -----
From: āecoreā
To: āWindows File Systems Devs Interest Listā
Sent: Thursday, October 02, 2003 4:33 PM
Subject: [ntfsd] This Cleanup IRP will send to
ā¦ifsfaq#34IoCreateFileSpecifyDeviceObjectHint
> I use MyShadowDO to implement IoCreateFileSpecifyDeviceObjectHint.
> It works well.
> But when I ZwClose it.I found that :
> the IRP_MJ_CLEANUP is send to the top of StorageDeviceStack.not
> MyShadowDO.
> I think I ZwCreateFile by MyShadowDO,then the Cleanup IRP should send to
> MyShadowDO too.but,the result is StorageDeviceStack(my FS filter device
> object will receive the Cleanup IRP).
> Why?anybody can explain it.thanks!
>
> ā
> You are currently subscribed to ntfsd as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Correction to previous post: CloseObject method, not DeleteObject.
----- Original Message -----
From: āecoreā
To: āWindows File Systems Devs Interest Listā
Sent: Thursday, October 02, 2003 4:33 PM
Subject: [ntfsd] This Cleanup IRP will send to
ā¦ifsfaq#34IoCreateFileSpecifyDeviceObjectHint
> I use MyShadowDO to implement IoCreateFileSpecifyDeviceObjectHint.
> It works well.
> But when I ZwClose it.I found that :
> the IRP_MJ_CLEANUP is send to the top of StorageDeviceStack.not
> MyShadowDO.
> I think I ZwCreateFile by MyShadowDO,then the Cleanup IRP should send to
> MyShadowDO too.but,the result is StorageDeviceStack(my FS filter device
> object will receive the Cleanup IRP).
> Why?anybody can explain it.thanks!
>
> ā
> You are currently subscribed to ntfsd as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Thatās because file system associates VPB with file object which points to
the highest device in file system device stack. NTI/O Manager uses device
object pointer from VPB wherever it is possible. One possible trick is to
replace VPB pointer with your own in your shadow deviceās IRP_MJ_CREATE
dispatch routine. Be careful with reference counting though.
-htfv
āecoreā wrote in message news:xxxxx@ntfsdā¦
>
> I use MyShadowDO to implement IoCreateFileSpecifyDeviceObjectHint.
> It works well.
> But when I ZwClose it.I found that :
> the IRP_MJ_CLEANUP is send to the top of StorageDeviceStack.not
> MyShadowDO.
> I think I ZwCreateFile by MyShadowDO,then the Cleanup IRP should send to
> MyShadowDO too.but,the result is StorageDeviceStack(my FS filter device
> object will receive the Cleanup IRP).
> Why?anybody can explain it.thanks!
>
>
All requests, other than the IRP_MJ_CREATE, will be sent to your
ānormalā device and not the shadow device. This is because after the
underlying FSD sets up the VPB the IO Mgr uses this to determine where
to send the request.
The idea here is that you setup your context structures in the
IRP_MJ_CREATE handler. Since these are not processed by the ānormalā
pathway but by your shadow device pathway, then the context structure
will not be setup and thus the context will not be located for
subsequent requests.
If you need to process other requests in the Shadow device path, then
create a āshadow device processedā tree in the IRP_MJ_CREATE processing.
If in the latter requests you find it in your Shadow tree then pass it
to the shadow device routine. Otherwise process it by the ānormalā path.
Of course there are many other options here as well!
Pete
Peter Scott
xxxxx@KernelDrivers.com
www.KernelDrivers.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alexey Logachyov
Sent: Thursday, October 02, 2003 10:33 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Re: This Cleanup IRP will send to
ā¦ifsfaq#34IoCreateFileSpecifyDeviceObjectHint
Thatās because file system associates VPB with file object which points
to
the highest device in file system device stack. NTI/O Manager uses
device
object pointer from VPB wherever it is possible. One possible trick is
to
replace VPB pointer with your own in your shadow deviceās IRP_MJ_CREATE
dispatch routine. Be careful with reference counting though.
-htfv
āecoreā wrote in message news:xxxxx@ntfsdā¦
>
> I use MyShadowDO to implement IoCreateFileSpecifyDeviceObjectHint.
> It works well.
> But when I ZwClose it.I found that :
> the IRP_MJ_CLEANUP is send to the top of StorageDeviceStack.not
> MyShadowDO.
> I think I ZwCreateFile by MyShadowDO,then the Cleanup IRP should send
to
> MyShadowDO too.but,the result is StorageDeviceStack(my FS filter
device
> object will receive the Cleanup IRP).
> Why?anybody can explain it.thanks!
>
>
ā
You are currently subscribed to ntfsd as: xxxxx@kerneldrivers.com
To unsubscribe send a blank email to xxxxx@lists.osr.com