Although I’ve never had to implement such functionality, it’s been
suggested on this list that you return STATUS_NOT_SAME_DEVICE to hint to
the caller that the file should be copied. Since it’s up to the caller
to take this hint (apparently they must pass the MOVEFILE_COPY_ALLOWED
flag to the MoveFileEx API), there’s no guarantee this will always work,
so if I were you I’d just perform the copy myself.
Rolling your own copy routine is an unholy bitch, however - you have to
copy the data, file attributes, file times, all 4 categories of security
information, alternate streams, extended attributes, etc. The CopyFile
API in user-mode handles all this ugliness for you - you may want to
consider having a user-mode app perform the copy on the driver’s behalf
(but watch out for potential deadlocks if you do this while blocking the
rename).
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Randy Cook
Sent: Tuesday, February 25, 2003 4:54 PM
To: File Systems Developers
Subject: [ntfsd] Copy on rename
I am writing a filter driver. In some cases when I
see a RENAME request, I would like to do a COPY
operation instead, but make it look like a rename to
everyone above me. I only want to do this if the
rename would have succeeded.
I think I know how to do the copy when the src file is
already open (by rolling read irps). But how can I
tell if the rename would work?
Should I let the rename work (or not) and then copy
back?
Just wondering what people have been able to get
working.
Thanks,
Randy
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
You are currently subscribed to ntfsd as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com