Changing Irp->UserBuffer

There’s not enough detail in this question to give a complete answer, but here are few things to keep in mind:

Notepad uses memory mapped i/o. So notepad just creates a section & maps a view of foo1.txt and uses the pointer to directly change the contents of the pages.

So you are in the same boat as encryption drivers : you will need to filter all non-cached i/o (both paging and non-paging) so that you can decide to stream to/fro foo2.txt or foo1.txt. There are a bunch of more things you need to filter - such as file size queries. The cached view of foo2.txt will be coherent - your challenge is to keep that of foo1.txt coherent.

Extending writes would be a problem for you for obvious reasons - you need to figure out where to direct them (probably end of foo2, with a linear split?).

Detecting extending writes to foo1.txt is quite easy, you know that from the IRP parameters, they are all documented in IFSKit.

Deletion of foo2.txt will leave your state inconsistent, so you should have a plan for recovery - even if you are just talking about reading. The cached view of the file can persist long after both handles have been closed.

Ravi


From: xxxxx@lists.osr.com on behalf of Gaurav Gore
Sent: Sat 3/26/2005 2:54 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Changing Irp->UserBuffer

Hi,

I have to resolve the following issue. I have a text file split into two fragments, say foo1.txt and foo2.txt. When foo1.txt is opened in notepad, i want both foo1.txt’s and foo2.txt’s data to be shown in notepad.

Is this possible?

I am currently doing something like this. When I get a READ on foo1.txt, I open a handle to foo2.txt using ZwCreateFile() and want to subsequently read this file(ZwRead()) and write the data into foo1.txt’s Irp->Userbuffer. How can I detect when the end of file for foo1.txt is reached? (STATUS_END_OF_FILE ??) I am using the “sfilter” as a base driver with Neither I/O. Moreover how can I modify the buffer at Irp->Userbuffer with the text from foo2.txt.
What other changes will I have to make to the READ IRP on foo1.txt ? (IoStatus.Status && IoStatus.Information etc ??)

Is there a simpler procedure?

Regards,
~Gaurav

http: — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank email to xxxxx@lists.osr.com</http:>