Equivalent of MoveFileEx

Hi All,
Is there an equivalent of MoveFileEx. I want to use it at the driver
entry. How can I.
Regards,
Lalit.

Open the file with ZwCreate and rename it with ZwSetInformationFile
(info class FileRenameInformation). This will fail if the target is on a
different volume.

Lalit S. Rana wrote:

Hi All,
Is there an equivalent of MoveFileEx. I want to use it at the driver
entry. How can I.
Regards,
Lalit.


You are currently subscribed to ntfsd as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

  • Nick Ryan (MVP for DDK)

Similarly I can do for moving the files from one drive to another, would
it give some problem if I am applying this mechanism in the DriverEntry.
Isn’t there a function to do it.

Thanks
Lalit.

No function that I’m aware of.

Don’t forget to copy attributes, security, streams and
EAs.

Randy

— “Lalit S. Rana” wrote:
>
> Similarly I can do for moving the files from one
> drive to another, would
> it give some problem if I am applying this mechanism
> in the DriverEntry.
> Isn’t there a function to do it.
>
> Thanks
> Lalit.
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

In general, you don’t want to be doing i/o in driver entry at all. You
will need a worker thread to kick off something you want to do at load
time. You may also have to wait for file system to be mounted and such
depending on when your driver loads.

In kernel mode, there generally aren’t such high level functions as
MoveFileEx(). You can write it yourself, using ZwCreate … through
ZwClose. You have to build and copy all the components of the file,
including named streams, security etc. If you want the deferred (copy
on reboot) move file capability, you will have to handle this yourself
in an early load driver (system, boot) or figure out a way to integrate
this with Microsoft’s engine for this purpose. I am not sure exactly
where Microsoft stores the files to be handle on reboot - you would need
to do this research.

-----Original Message-----
From: Lalit S. Rana [mailto:xxxxx@epatra.com]
Sent: Thursday, July 17, 2003 7:50 AM
To: File Systems Developers
Subject: [ntfsd] Re: Equivalent of MoveFileEx

Similarly I can do for moving the files from one drive to another, would
it give some problem if I am applying this mechanism in the DriverEntry.
Isn’t there a function to do it.

Thanks
Lalit.


You are currently subscribed to ntfsd as: xxxxx@exagrid.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

On NT platforms pending moves/deletes on reboot are stored in a registry
entry (documented in the MoveFileEx MSDN entry).

Tom Hansen wrote:

In general, you don’t want to be doing i/o in driver entry at all. You
will need a worker thread to kick off something you want to do at load
time. You may also have to wait for file system to be mounted and such
depending on when your driver loads.

In kernel mode, there generally aren’t such high level functions as
MoveFileEx(). You can write it yourself, using ZwCreate … through
ZwClose. You have to build and copy all the components of the file,
including named streams, security etc. If you want the deferred (copy
on reboot) move file capability, you will have to handle this yourself
in an early load driver (system, boot) or figure out a way to integrate
this with Microsoft’s engine for this purpose. I am not sure exactly
where Microsoft stores the files to be handle on reboot - you would need
to do this research.

-----Original Message-----
From: Lalit S. Rana [mailto:xxxxx@epatra.com]
Sent: Thursday, July 17, 2003 7:50 AM
To: File Systems Developers
Subject: [ntfsd] Re: Equivalent of MoveFileEx

Similarly I can do for moving the files from one drive to another, would
it give some problem if I am applying this mechanism in the DriverEntry.
Isn’t there a function to do it.

Thanks
Lalit.


You are currently subscribed to ntfsd as: xxxxx@exagrid.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

  • Nick Ryan (MVP for DDK)