which kind of request determine the length of the file?

I developed a filter and try to make the length of the file smaller.
I mean if the origin file was 712bytes, I want to cut the last 700bytes and just return the first 12bytes to user mode.
My filter has dispatch routine about IRP_MJ_READ, IRP_DIRECTORY_CONTROL, IRP_QUERY_INFORMATION, but after filter all these three kinds of requests, the length of the file opened by wordpad.exe still remains 712bytes.(the first 12bytes are right, the last 700bytes are spaces)
So I wonder how can I make the length of the file opened by wordpad.exe smaller?

You’re missing something. Use FileSpy and/or Process Monitor to see all of
the requests that occur prior to the opening of the file:

http://www.zezula.net/en/fstools/filespy.html
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

-scott
OSR
@OSRDrivers

wrote in message news:xxxxx@ntfsd…

I developed a filter and try to make the length of the file smaller.
I mean if the origin file was 712bytes, I want to cut the last 700bytes and
just return the first 12bytes to user mode.
My filter has dispatch routine about IRP_MJ_READ, IRP_DIRECTORY_CONTROL,
IRP_QUERY_INFORMATION, but after filter all these three kinds of requests,
the length of the file opened by wordpad.exe still remains 712bytes.(the
first 12bytes are right, the last 700bytes are spaces)
So I wonder how can I make the length of the file opened by wordpad.exe
smaller?