One simple solution is not let the rename request go to the file system driver.
Following are the 2 options i would choose from.
-
Rename only the file @ C:\windows\dirA. To do this you will have to have some complex way of detecting need for redirection so that after the rename you can redirect requests for C:\windows\dirA to D:\cache\windows\dirA.
-
Complete the rename request and do not let it pass thru to the FS Driver. For this, catch the set name request and rename both C:\windows\dirA to C:\windows\dirB and D:\cache\windows\dirA to D:\cache\windows\dirB. Ideally, this should be a transaction.
In both the solutions, you would need to explicitly rename C:\windows\dirA, else directory enumerations will still show the old name.
Thanks divya.
The focus is I willnot receive the rename irp, for the target parent and the
source directory are not in same volume 
I think user-mode hook maybe the best solution 
Alex.
On Thu, Oct 29, 2009 at 1:36 PM, wrote:
> One simple solution is not let the rename request go to the file system
> driver.
> Following are the 2 options i would choose from.
>
> 1. Rename only the file @ C:\windows\dirA. To do this you will have to have
> some complex way of detecting need for redirection so that after the rename
> you can redirect requests for C:\windows\dirA to D:\cache\windows\dirA.
>
> 2. Complete the rename request and do not let it pass thru to the FS
> Driver. For this, catch the set name request and rename both C:\windows\dirA
> to C:\windows\dirB and D:\cache\windows\dirA to D:\cache\windows\dirB.
> Ideally, this should be a transaction.
>
> In both the solutions, you would need to explicitly rename C:\windows\dirA,
> else directory enumerations will still show the old name.
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> non-redirected -> redirected
Attempt of cross-volume rename, at least in some old Windows (XP), was caught in IO manager before sending an IRP to the driver and, without hooking, there was no way of handling this in a sane way.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
>I think user-mode hook maybe the best solution 
Yes, hook MoveFile(Ex) and let it fall back to stupid copy of the whole file.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
Maxim,
I don’t have to change rename to copy.
Parameter of MoveFile(Ex) tell me the path of source object, so I can decide
whch target parent to open, or other, I can make the source object and
target parent in same volume. It is a really rename 
Thanks!
Alex.
On Fri, Oct 30, 2009 at 1:00 AM, Maxim S. Shatskih
wrote:
> >I think user-mode hook maybe the best solution 
>
> Yes, hook MoveFile(Ex) and let it fall back to stupid copy of the whole
> file.
>
> –
> Maxim S. Shatskih
> Windows DDK MVP
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>