strange SetFileEndOfFileInformation on NTFS

In my test filter,I found a very strange problem.
In the last file handle is closed(IRP_MJ_CLEANUP) with write access,I will add a tail to the file.So,in my IRP_MJ_CLEANUP handler,I will roll a IRP: IRP_MJ_SetInformation(the class is FileEndOfFileInformation),the filesize is (the original size+ the tail size).this IRP is not paging IRP.
And then,after this,the system will send a Paging IRP_MJ_SetInformation(the class is FileEndOfFileInformation).

On FAT32,in the Paging IRP_MJ_SetInformation the system sended,the EndOfFile is (the original size+ the tail size).
This is correct! Because I have roll my not-paging IRP_MJ_SetInformation to set the filesize,the system should know the filesize(have added the tail).So,the system send the paging IRP_MJ_SetInformation(the class is FileEndOfFileInformation) with (the original size+ the tail size) is correct!

But on NTFS,in the Paging IRP_MJ_SetInformation the system sended,the EndOfFile is (the original size).Why?I have setted the filesize is (the original size+ the tail size)!
the system should know it!

anyone can explain it?thanks ~~~~~~~~~

According to the above description ,in NTFS the file’s tail will zero(I have observed the case),and in FAT32 the file’s tail is OK(I added a tail,it’s a description info for the file).

So,I adjusted the paging IRP_MJ_SetInformation,if EndOfFile < (RealFileSize+TailSize),I adjusted it to the (RealFileSize+TailSize).
I think it will be OK in NTFS,because I have handled the Paging IRP_MJ_SetInformation.But it still can’t work,the tail still is zero!

Why?It’s very strange!thanks for any help~~

In the last file handle is closed(IRP_MJ_CLEANUP) with write access,I will add a
tail to the file:
1.roll a IRP_MJ_SetInformation(the class is FileEndOfFileInformation) IRP to SetFileSize.

In the paging IRP_MJ_WRITE,I will add my tail according to the offset and size.Yes,I’m sure I have add my tail to the buffer before IoCallDriver!So,I can say,the file length is modified,and the tail data have added.
But,in NTFS,the tail still zero!
Why?

My other solution for adding the tail is OK in NTFS,but it can’t work for byte range lock.
In the last file handle is closed(IRP_MJ_CLEANUP) with write access,I will add a
tail to the file:
I roll my not paging IRP_MJ_Write.

anybody can explain it?thanks.

Dude, what the hell is your problem. Everyone on the list has already
viewed your question or it’s sitting in their inbox; most people here in
the western world are asleep, it’s the weekend.

Quite posting the same damn question every 2 hours.

m.

xxxxx@hotmail.com wrote:

In the last file handle is closed(IRP_MJ_CLEANUP) with write access,I will add a
tail to the file:
1.roll a IRP_MJ_SetInformation(the class is FileEndOfFileInformation) IRP to SetFileSize.

In the paging IRP_MJ_WRITE,I will add my tail according to the offset and size.Yes,I’m sure I have add my tail to the buffer before IoCallDriver!So,I can say,the file length is modified,and the tail data have added.
But,in NTFS,the tail still zero!
Why?

My other solution for adding the tail is OK in NTFS,but it can’t work for byte range lock.
In the last file handle is closed(IRP_MJ_CLEANUP) with write access,I will add a
tail to the file:
I roll my not paging IRP_MJ_Write.

anybody can explain it?thanks.


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

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

I think maybe is because NTFS is smart:
I can’t roll my IRP_MJ_WRITE,so I just roll my IRP_MJ_SetInformation(SetEndOfFile).So,NTFS think the file just write these data(not including my tail).
Though I have modified the write buffer in paging IRP_MJ_WRITE according to write offset and length,NTFS think these data(my tail) is useless.So,NTFS still zero the tail region.

But,my another solution is:
In the last file handle is closed(IRP_MJ_CLEANUP) with write access,I will add a
tail to the file:
1.roll a IRP_MJ_SetInformation(the class is FileEndOfFileInformation) IRP to
SetFileSize.
2.use MmCreateSection from the fileobject,and MmMapViewOfSection.
and I write my tail data.
this solution can’t work too.In NTFS,the tail data still is zero.

I just want to described the problem detailly.
What’s the problem with you?
I post a thread,and I think my descirption is not complete.
I want to give more details ,my trace info and my guess,so I reply a thread.
It’s a normal behavior!

And,your thread and this thread is nothing really.

xxxxx@hotmail.com wrote:

I just want to described the problem detailly.

You did good enough the first time.

What’s the problem with you?

I’m trying to work and keep getting the same damn email from you.

I post a thread,and I think my descirption is not complete.

So you decided to generate 20,000+ emails…

I want to give more details ,my trace info and my guess,so I reply a thread.

You were replying to yourself, no one wants to hear (read) you thinking
aloud (it’s not pleasant).

It’s a normal behavior!

That’s what Kenneth Pinyan said.

And,your thread and this thread is nothing really.

My threads purpose was to tell YOU everyone got it in your first post.
You need to understand that if your using
the web forum, every post you make still gets delivered to thousands of
people via email. This exact topic is
discussed many times in the archive.

m.


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

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