Problem in Byte offset managment

Hi
I am a novice to file system filter driver. I have written a file system filter driver. My objective is to write a my own header (let say my name RAGHWENDRA) at the starting of any file which is generating from any application. First i am trying on applications which are not using file memory mapped.

Following to this i am doing few things

  1. I am writting my header data as and when any file is created by the application using ZwWrite, just after NtCreateFile and before to IRP_MJ_CREATE calls.
  2. Since ZwWrite moves the file pointer by no of bytes written, i am setting back the file poiner using ZwSetFileInformation at the 0th position.
  3. Now the 10 bytes(RAGHWENDRA) data is in file and the file pointer is in 0th location.
  4. After that i am trapping QueryInformation, SetInformation Read, Write IRP calls and moving the pointer accordingly.
    But then i am not getting proper data on the file.

My question is do i need to trapp any thing else appart form the above liasted calles. If no then how should i play with the file pointer.

Thanx in advance
Raghwendra

*********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use

********************************************************

Your header must have page-aligned size. At least 1 page. After this - have fun with 2 notions of the file size - real and “with header”.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Raghwendra
To: Windows File Systems Devs Interest List
Sent: Thursday, May 26, 2005 7:26 PM
Subject: [ntfsd] Problem in Byte offset managment

Hi
I am a novice to file system filter driver. I have written a file system filter driver. My objective is to write a my own header (let say my name RAGHWENDRA) at the starting of any file which is generating from any application. First i am trying on applications which are not using file memory mapped.

Following to this i am doing few things

  1. I am writting my header data as and when any file is created by the application using ZwWrite, just after NtCreateFile and before to IRP_MJ_CREATE calls.
  2. Since ZwWrite moves the file pointer by no of bytes written, i am setting back the file poiner using ZwSetFileInformation at the 0th position.
  3. Now the 10 bytes(RAGHWENDRA) data is in file and the file pointer is in 0th location.
  4. After that i am trapping QueryInformation, SetInformation Read, Write IRP calls and moving the pointer accordingly.
    But then i am not getting proper data on the file.

My question is do i need to trapp any thing else appart form the above liasted calles. If no then how should i play with the file pointer.

Thanx in advance
Raghwendra

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 *********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use

********************************************************

Just curious, why do you need page-aligned size? I believe that
sector-aligned should work just fine.

Alexei.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Thursday, May 26, 2005 8:34 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Problem in Byte offset managment

Your header must have page-aligned size. At least 1 page. After this -
have fun with 2 notions of the file size - real and “with header”.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: Raghwendra mailto:xxxxx
To: Windows File Systems Devs Interest mailto:xxxxx List
Sent: Thursday, May 26, 2005 7:26 PM
Subject: [ntfsd] Problem in Byte offset managment

Hi
I am a novice to file system filter driver. I have written a file system
filter driver. My objective is to write a my own header (let say my name
RAGHWENDRA) at the starting of any file which is generating from any
application. First i am trying on applications which are not using file
memory mapped.

Following to this i am doing few things
1. I am writting my header data as and when any file is created by the
application using ZwWrite, just after NtCreateFile and before to
IRP_MJ_CREATE calls.
2. Since ZwWrite moves the file pointer by no of bytes written, i am setting
back the file poiner using ZwSetFileInformation at the 0th position.
3. Now the 10 bytes(RAGHWENDRA) data is in file and the file pointer is in
0th location.
4. After that i am trapping QueryInformation, SetInformation Read, Write IRP
calls and moving the pointer accordingly.
But then i am not getting proper data on the file.

My question is do i need to trapp any thing else appart form the above
liasted calles. If no then how should i play with the file pointer.

Thanx in advance
Raghwendra

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
*
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or
attachment(s) if any) are privileged and confidential material of MBT and
should not be disclosed to, used by or copied in any manner by anyone other
than the intended addressee(s). In case you are not the desired addressee,
you should delete this message and/or re-direct it to the sender. The views
expressed in this E-mail message (including the enclosure(s) or attachment(s)
if any) are those of the individual sender, except where the sender
expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free
of any virus. However, it is the responsibility of the recipient to ensure
that it is virus free and MBT is not responsible for any loss or damage
arising in any way from its use




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</mailto:xxxxx></mailto:xxxxx>

Hi Max
as you have suggested to page-aligned my header. should i user #pragma for doing so or is there some other way for DDK.
I am sorry it could be a silly question, but i wants to be sure on this.

Regards
Raghwendra
----- Original Message -----
From: Maxim S. Shatskih
To: Windows File Systems Devs Interest List
Sent: Friday, May 27, 2005 9:04 AM
Subject: Re: [ntfsd] Problem in Byte offset managment

Your header must have page-aligned size. At least 1 page. After this - have fun with 2 notions of the file size - real and “with header”.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Raghwendra
To: Windows File Systems Devs Interest List
Sent: Thursday, May 26, 2005 7:26 PM
Subject: [ntfsd] Problem in Byte offset managment

Hi
I am a novice to file system filter driver. I have written a file system filter driver. My objective is to write a my own header (let say my name RAGHWENDRA) at the starting of any file which is generating from any application. First i am trying on applications which are not using file memory mapped.

Following to this i am doing few things

  1. I am writting my header data as and when any file is created by the application using ZwWrite, just after NtCreateFile and before to IRP_MJ_CREATE calls.
  2. Since ZwWrite moves the file pointer by no of bytes written, i am setting back the file poiner using ZwSetFileInformation at the 0th position.
  3. Now the 10 bytes(RAGHWENDRA) data is in file and the file pointer is in 0th location.
  4. After that i am trapping QueryInformation, SetInformation Read, Write IRP calls and moving the pointer accordingly.
    But then i am not getting proper data on the file.

My question is do i need to trapp any thing else appart form the above liasted calles. If no then how should i play with the file pointer.

Thanx in advance
Raghwendra

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 *********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use

********************************************************


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

*********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use

********************************************************

> Your header must have page-aligned size. At least 1 page. After this

  • have fun with 2 notions of the file size - real and “with header”.

I don’t think so. I’ve already seen an encryption software
with file header 0x40 bytes long. Another thing is that Paging I/O
path will be more difficult to handle.

I’d recommend to use file tail instead of file header.

L.

Thanx Max,
after aligning my header with paze size i am able to write it for those applications which do not use much FASTIO calls. But for other application which usages many FASTIO calls like MSWORD i am still finding problem. Currently I am trapping FastIORead,FastIOWrite,FastIOQueryStanderedInformation and managing the ByteOffSet. Do i require to trap any other FAST IO Calls to manage this.

Regards
Raghwendra

----- Original Message -----
From: Maxim S. Shatskih
To: Windows File Systems Devs Interest List
Sent: Friday, May 27, 2005 9:04 AM
Subject: Re: [ntfsd] Problem in Byte offset managment

Your header must have page-aligned size. At least 1 page. After this - have fun with 2 notions of the file size - real and “with header”.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Raghwendra
To: Windows File Systems Devs Interest List
Sent: Thursday, May 26, 2005 7:26 PM
Subject: [ntfsd] Problem in Byte offset managment

Hi
I am a novice to file system filter driver. I have written a file system filter driver. My objective is to write a my own header (let say my name RAGHWENDRA) at the starting of any file which is generating from any application. First i am trying on applications which are not using file memory mapped.

Following to this i am doing few things

  1. I am writting my header data as and when any file is created by the application using ZwWrite, just after NtCreateFile and before to IRP_MJ_CREATE calls.
  2. Since ZwWrite moves the file pointer by no of bytes written, i am setting back the file poiner using ZwSetFileInformation at the 0th position.
  3. Now the 10 bytes(RAGHWENDRA) data is in file and the file pointer is in 0th location.
  4. After that i am trapping QueryInformation, SetInformation Read, Write IRP calls and moving the pointer accordingly.
    But then i am not getting proper data on the file.

My question is do i need to trapp any thing else appart form the above liasted calles. If no then how should i play with the file pointer.

Thanx in advance
Raghwendra

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 *********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use

********************************************************


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

*********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use

********************************************************