Insert an header into files

Hi,
I want to insert a static header into files that is not visible to user level application.
Is it possible with minifilter driver?
My idea is to write header during postcreate (fltwritefile), change file size (IRP_MN_QUERY_DIRECTORY or IRP_MJ_QUERY_INFORMATION) and modify bufferoffset in read/write operation. It is the correct way?

Thanks for all replies

You question is not complete. you want to write some header, correct? Try for footer, search archives.

What if some one opens the file and close and and never reads from it.(Explorer does it all the time). What about the file is already open\mapped?

What type of driver is it exactly, encryption?

My driver is an encryption driver.
I want to store some encryption information inside files like IV.

Informations inside file are static and driver must write only one time. Other time it only read information.

Do you think that a footer is more easy to develop?
How can i insert a footer on files?

Thanks

Check the archives, you have major challenges either way.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

xxxxx@gmail.com” wrote in message
news:xxxxx@ntfsd:

> My driver is an encryption driver.
> I want to store some encryption information inside files like IV.
>
> Informations inside file are static and driver must write only one time. Other time it only read information.
>
> Do you think that a footer is more easy to develop?
> How can i insert a footer on files?
>
> Thanks

>>How can i insert a footer on files?

Well at first, you need to learn the way it works. Otherwise you will be bewildered all the time by the behavior.

As said, check archives, here is one for you

>http://www.osronline.com/showthread.cfm?link=162962

learn about the way CC & MM interacts with FS and how filter comes in that.

Thanks,
Aditya

If it is NTFS you can simply use ADS, otherwise footer works provided you handle file size related issues properly.

Regards
Mohan

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Saturday, November 13, 2010 6:18 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Insert an header into files

My driver is an encryption driver.
I want to store some encryption information inside files like IV.

Informations inside file are static and driver must write only one time. Other time it only read information.

Do you think that a footer is more easy to develop?
How can i insert a footer on files?

Thanks


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer