> Subject: RE: Rename on LanmanRedirector problem…
From: Alexandru Carp
> Date: Thu, 28 May 2009 08:34:54 -0700
> X-Message-Number: 11
>
> Hi Michael,
> Well, from your description it looks like it’s working exactly as local renames do:
>
> Say you want to rename file A to file B. The IRP_MJ_SET_INFORMATION operation is sent for file A and the FILE_RENAME_INFORMATION structure has a RootDirectory member which is a handle to the parent directory of file B. Traditionally, this handle is created by issuing an IRP_MJ_CREATE for file B with SL_OPEN_TARGET_DIRECTORY (so in this case the create means: “give me a handle for the parent directory of this file”). Please note that the call will succeed even if file B does not exist because the open is actually meant for the parent directory.
>
> So for a rename for file A to file B by means of IRP_MJ_SET_INFORMATION this is what you should normally see (step 1 and 2 do not necessarily happen in this order):
> 1. an IRP_MJ_CREATE for file A
> 2. an IRP_MJ_CREATE for file B with SL_OPEN_TARGET_DIRECTORY 3. and IRP_MJ_SET_INFORMATION on FILE_OBJECT A (from the create in step 1) with the RootDirectory member set to a handle to the FILE_OBJECT B (from step 2).
>
> Issuing an IRP_MJ_QUERY_INFORMATION in the completion of the create in step 2 should work just fine except you are not actually querying “file B” but rather “parent directory of file B”.
>
> So could you please explain exactly how IRP_MJ_QUERY_INFORMATION fails ?
>
> Regards,
> Alex.
Alex,
Thanks a lot for good developed answer!
Now I understand the internal logic of Rename operation and meaning of SL_OPEN_TARGET_DIRECTORY flag.
I have not yet solution, but it will be.
The answer on your question.
IRP_MJ_QUERY_INFORMATION fails with error code STATUS_INVALID_PARAMETER (0xC000000DL).
The procedure of request is standard - generate IRP using received pFileObject.
I guess it’s the problem. FileObject has been received for file and has target file name, but it is FileObject for directory, not file and IRP_MJ_SET_INFORMATION does not issued yet.
Over more, it is strange, that it has worked for local volumes…
Regards,
MG.