Re[2]: WriteFile api and results in FileSpy.

> Could you point me where to start looking for relevant information

about at what point should the header be inserted? e.g. For trailer
this is during the cached setinformation and non paging writes.

The problem is there is no publicly available relevant
information about that. Not that I know of. Completing this task
if very difficult and everyone who did it keeps the know-how
for himself.

There is a Data Modification Kit though, sold by OSR guys;
it provides all you need, you just add your “store data”
and “retrieve data” callbacks and that’s it, you can have
your filter working the same day in the evening.

Yes, it’s expensive, but believe me, if you wanna
go that way on your own and discover all the caveats, it will be
even more expensive.

L.

Hi Ladislav,

Yes, the kit is very expensive. Yes it is a herculean task to support all the scenarios [network scenarios, integrating with 3rd party drivers, multiple threads etc]. But currently my client has some budget constraints and he wants me to support few editors.

I am also reading a book by mark russinovich http://book.itzero.com. Could you please give me some clue as to what I should start looking at so that I can insert header in the file in addition to the below?

  • Add 1 page size header.
  • Trap read, write and change the offsets. Also return correct value in the Information e.g. number of characters read.
  • Trap setinformation and queryinfo and modify the end of file. Also modify the allocation size (some articles mention this.)
  • Create a new temp buffer in write.
  • File size cannot be determined 100% correctly in paging write.
  • I have looked at the swapbuffer example. But it is wrong to assume that mere tinkering of it will give me desired results (from the articles).
  • File size can only be increased in cached setinfo [end of file] or cached write.

Also I have a very written a very simple test application that uses memory mapped way to write data into the file [Create mapping, map view of file, write, flush, unmap] . I observe following calls in the filespy corresponsing to the function calls.

Create file using the createfile function:

Create

Createfile mapping

Fast i/o Query end of file.
Set information with size = size of the buffer I will write into the file. Also this is a paging io. I cannot see the advance flag set to true. This is called since the intial size of the file was 0.

Write into the mapped area:

  1. Triggers a read. I assume this is the read ahead.

Flush:

  1. Writes the data. As expected this is a paging write.

Close:

  1. Cleanup / Close done.

In this flow there is no cached write nor cached set information. At what place can I increase the file size? Am I not looking at the right calls in this scenario.

Waiting for your reply :-|.

Thanks,
Trav