Problem with MoveFile IRP_MJ_SET_INFORMATION::FileRenameInformation

Need help.

when I use the API MoveFile or MoveFileEx, the IOCTL function IRP_MJ_SET_INFORMATION::FileRenameInformation is not called , but called if destination file exists.
GetLastError returns GetlastError = 2.
The source file exists !

Can you help me?

i think solved this problem , i’am not sure.

In IRP_MJ_CREATE , I should return STATUS_SUCCESS if file not exist and (irpstack->flags&SL_OPEN_TARGET_DIRECTORY)==SL_OPEN_TARGET_DIRECTORY.

Why ? i don’t know.

Of course you would - so long as the parent directory exists…

http://msdn.microsoft.com/en-us/library/ff548630(VS.85).aspx

“SL_OPEN_TARGET_DIRECTORY - If this flag is set, the file’s parent
directory should be opened.”

In general the rename/hardlink API is rather “rich” and I’d advise you to
play around with it. If you are running over the network you will find some
interesting behaviors in Vista…


Rod Widdowson
Consulting Partner
Steading System Software LLP
+44 1368 850217 +1 508 915 4790

wrote in message news:xxxxx@ntfsd…
>i think solved this problem , i’am not sure.
>
> In IRP_MJ_CREATE , I should return STATUS_SUCCESS if file not exist and
> (irpstack->flags&SL_OPEN_TARGET_DIRECTORY)==SL_OPEN_TARGET_DIRECTORY.
>
> Why ? i don’t know.
>