Multi FCB with a same FileName,why?

Multi FCB with a same FileName,why?
I notify a situation:
one application will do a fullrename,And the SourceFileName is the same with the TargetFileName.
the following is the steps by FileSpy:
1.Open the SourceFile,with the FileName: E:\TESTXXX.TXT
the FileObject is 0x88F10E80 , the FCB is 0xE29999D8
2.Open the TargetFile,with the same FileName: E:\TESTXXX.TXT
the FileObject is 0x89094A30, the FCB is 0xE18E84F0
3.FullRename(SourceFile->TargetFile)
4.Cleanup 0x89094A30 (TargetFile)
5.Close 0x89094A30 (TargetFile)
6.Cleanup 0x88F10E80 (SourceFile)
7.Close 0x88F10E80 (SouceFile)

Why?anybody can tell me the cause and how to verify the situation?
Thanks.

The second create should have the IO_OPEN_TARGET_DIRECTORY flag set in the
IRP. It is not opening the file to be renamed, it is opening the directory
which is the target of the rename, i.e. E:.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Monday, October 15, 2007 12:42 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Multi FCB with a same FileName,why?

Multi FCB with a same FileName,why?
I notify a situation:
one application will do a fullrename,And the SourceFileName is the same with
the TargetFileName.
the following is the steps by FileSpy:
1.Open the SourceFile,with the FileName: E:\TESTXXX.TXT
the FileObject is 0x88F10E80 , the FCB is 0xE29999D8 2.Open the
TargetFile,with the same FileName: E:\TESTXXX.TXT
the FileObject is 0x89094A30, the FCB is 0xE18E84F0
3.FullRename(SourceFile->TargetFile)
4.Cleanup 0x89094A30 (TargetFile)
5.Close 0x89094A30 (TargetFile)
6.Cleanup 0x88F10E80 (SourceFile)
7.Close 0x88F10E80 (SouceFile)

Why?anybody can tell me the cause and how to verify the situation?
Thanks.


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars (including our new fs
mini-filter seminar) visit:
http://www.osr.com/seminars

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

Thank you.Yes,the second IRP_CREATEF is with IO_OPEN_TARGET_DIRECTORY flag.
But ,question 2:
Why do that?
Open a File,and then Open a Directory(Name is E:\TESTXXX.TXT,but with IO_OPEN_TARGET_DIRECTORY flag).
And ,Rename the File to the Directory???and the result is STATUS_SUCCESS!

Be aware that UNICODE_STRING are not zero terminated, but the valid
string length is determined by structure length member (in bytes). So it
could be that the name of open directory has length of 6 bytes (3 wchar_t).
WBR Primoz

xxxxx@hotmail.com wrote:

Thank you.Yes,the second IRP_CREATEF is with IO_OPEN_TARGET_DIRECTORY flag.
But ,question 2:
Why do that?
Open a File,and then Open a Directory(Name is E:\TESTXXX.TXT,but with IO_OPEN_TARGET_DIRECTORY flag).
And ,Rename the File to the Directory???and the result is STATUS_SUCCESS!


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

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

no,the filename( unicode ) is exactly E:\TESTXXX.TXT

Yes, that’s how open target directory works. Nevertheless, because of the
flag, the filesystem treats this in a special way (and exactly what it does
with it is file system specific). The goal of it is to get a file object to
the directory into which the file is being renamed.

Most file system filter drivers can safely ignore creates with
IO_OPEN_TARGET_DIRECTORY set. It’s an internal I/O manager and file system
housekeeping thing.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Tuesday, October 16, 2007 9:22 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Multi FCB with a same FileName,why?

no,the filename( unicode ) is exactly E:\TESTXXX.TXT


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars (including our new fs
mini-filter seminar) visit:
http://www.osr.com/seminars

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