The issue of Encrypting Data in IRP_MJ_WRITE

Hi,all
In my encrypt/decrypt minifilter, encrypting data in the pre-write routine
of IRP_MJ_WRITE,the fast i/o operation was be block,if encrypt cached IRP
and NON_cache IRP,the file may be encrypted double times(this phenomena be
found when system restart,maybe the other times encrypting when the io
manager write the cache to the disk),if only encrypt the NON_Cache IRP,some
files will not be encrypt.if only encrypt the cached IRP,what about the file
with out cached write?how to resolve this issue??

Best Regards!

Why not read the archives? Do you think you are the first person to ask
this question? Have you read the IFS FAQ on www.osronline.com, too?

“Murphy Wang” wrote in message news:xxxxx@ntfsd…
> Hi,all
> In my encrypt/decrypt minifilter, encrypting data in the pre-write
> routine of IRP_MJ_WRITE,the fast i/o operation was be block,if encrypt
> cached IRP and NON_cache IRP,the file may be encrypted double times(this
> phenomena be found when system restart,maybe the other times encrypting
> when the io manager write the cache to the disk),if only encrypt the
> NON_Cache IRP,some files will not be encrypt.if only encrypt the cached
> IRP,what about the file with out cached write?how to resolve this issue??
>
>
> Best Regards!
>
>

Encrypt any non-cached write. Fast I/O by its nature is not non-cached.
User I/O might be non-cached, but is not generally non-cached. Paging
I/O is always non-cached.

This determination is easy for local file systems, and more challenging
for network file systems (network FSDs can change their caching policy
based upon interactions with other systems outside the visibility of the
filter driver.)

And this HAS all been covered before - over and over and over again.
I’d strongly encourage you to read the archives.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

Looking forward to seeing you at the next OSR File Systems class in
Boston, MA April 24-27, 2006.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Murphy Wang
Sent: Tuesday, January 03, 2006 10:53 PM
To: ntfsd redirect
Subject: [ntfsd] The issue of Encrypting Data in IRP_MJ_WRITE

Hi,all
In my encrypt/decrypt minifilter, encrypting data in the pre-write
routine
of IRP_MJ_WRITE,the fast i/o operation was be block,if encrypt cached
IRP
and NON_cache IRP,the file may be encrypted double times(this phenomena
be
found when system restart,maybe the other times encrypting when the io
manager write the cache to the disk),if only encrypt the NON_Cache
IRP,some
files will not be encrypt.if only encrypt the cached IRP,what about the
file
with out cached write?how to resolve this issue??

Best Regards!


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Never block FastIo calls, instead, return “fast IO is not possible” to the
IO manager. In usual old-style code, this is done by returning FALSE from fast
IO routine. Dunno about FltMgr.

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

----- Original Message -----
From: “Murphy Wang”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Wednesday, January 04, 2006 6:52 AM
Subject: [ntfsd] The issue of Encrypting Data in IRP_MJ_WRITE

> Hi,all
> In my encrypt/decrypt minifilter, encrypting data in the pre-write routine
> of IRP_MJ_WRITE,the fast i/o operation was be block,if encrypt cached IRP
> and NON_cache IRP,the file may be encrypted double times(this phenomena be
> found when system restart,maybe the other times encrypting when the io
> manager write the cache to the disk),if only encrypt the NON_Cache IRP,some
> files will not be encrypt.if only encrypt the cached IRP,what about the file
> with out cached write?how to resolve this issue??
>
>
> Best Regards!
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

It’s easy in mini-filters. In the pre-write callback:

if( FLT_IS_FASTIO_OPERATION( Data ) )
return FLT_PREOP_DISALLOW_FASTIO;

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Wednesday, January 04, 2006 11:37 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] The issue of Encrypting Data in IRP_MJ_WRITE

Never block FastIo calls, instead, return “fast IO is not possible” to
the
IO manager. In usual old-style code, this is done by returning FALSE from
fast
IO routine. Dunno about FltMgr.

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

----- Original Message -----
From: “Murphy Wang”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Wednesday, January 04, 2006 6:52 AM
Subject: [ntfsd] The issue of Encrypting Data in IRP_MJ_WRITE

> Hi,all
> In my encrypt/decrypt minifilter, encrypting data in the pre-write
routine
> of IRP_MJ_WRITE,the fast i/o operation was be block,if encrypt cached IRP
> and NON_cache IRP,the file may be encrypted double times(this phenomena be
> found when system restart,maybe the other times encrypting when the io
> manager write the cache to the disk),if only encrypt the NON_Cache
IRP,some
> files will not be encrypt.if only encrypt the cached IRP,what about the
file
> with out cached write?how to resolve this issue??
>
>
> Best Regards!
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com