Can I change Write.Length in PAGING_IO?

I’m developing a filter based on minifilter.
I encounter a problem which is related with STATUS_FILE_LOCK_CONFLICT.I know this is often caused by length and byteOffset, so I did some change in my code.
My filter add a header to each file it filtered, it works well when I just create and write something to the file, but when I open a file and write someting(length of the new content is bigger than the previous content) into it, my filter will get a STATUS_FILE_LOCK_CONFLICT in the post routine of PAGING_IO write.
As I have mentioned, I add a header to each file and write content with the following codes:
Write.ByteOffset += headerSize;
After I making Write.Length -= headerSize(When I encounter STATUS_FILE_LOCK_CONFLICT, my filter did not have this line), my filter was ok. But I don’t understand why the content of the file was right, it should have left some part(the last headerSize part), right? Or the lower dirver just check the Write.Length, but Write.Length does not really take effect(I mean may be the Write.Length of the PagingIO was not really changed)?

Try to do file size manipulation in prewrite for different kind of Io cached,non cached and paging.
See the fastfat code to get an idea.

Thanks for your help :slight_smile:
But the same Error does not appear on the FAT, my filter goes well.(It doesn’t matter whether I add Write.ByteOffset += headerSize or not, the result of my filter always be right)?(?_?)?
So, any different ideas?