Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
Hello All,
I am not sure if it is a bug for FileTest tool or the normal file system behavior. If I open the file with FileTest tool with write access, and SetEndOfFile with some value, from the filespy it always shows the EndOfFile value is 0 instead of the value I set, but if I write data first, then set the set length of the current file, the I will see the correct value.
Does anyone know if this is the bug or I was doing something wrong?
Regards
victorR
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Writing WDF Drivers | 7 Dec 2020 | LIVE ONLINE |
Internals & Software Drivers | 25 Jan 2021 | LIVE ONLINE |
Developing Minifilters | 8 March 2021 | LIVE ONLINE |
Comments
Do you mean on the ‘write’ tab? I never use that button - it’s wired to WIN32 so it could be doing any number of weird things, including what you say.
I always use FileEofInforation on the file info tab and that does work
I meant I used SetEndOfFile on the ReadWrite tab, this is the latest versionv 2.7.0.581FileTest tool. It can't set the right value to the file.
SetEndOfFile sets the EOF based on the current file pointer. You need to call SetFilePointer to move the file pointer out and then call SetEndOfFile. This is all just wacky Win32 stuff, it would work "as expected" if you used the native API.
-scott
OSR
Thanks Scott, you are right, the SetEndOfFile in the ReadWrite tag only set the end of file for the current file pointer. To test the SetEndOfFileInfo, it needs to go to the NtFileInfoTag.
VictorR