IRP write + cache

if i use the following for encryption with irp_mj_write

"

  1. Application: WriteFile
  2. Filter: Allocates new buffer and copies data there, passes
    the new buffer
    down
  3. FSD: Wites encrypted data
  4. Filter: does nothing at this point
  5. Applicarion: Return frm WriteFile, application’s buffer
    unchanged.
    "

Does this mean that the file on the disk will have the
encrypted data but the cache will have the non-encrypted
data ? (becouse after irp is completed is when cache manager
reads the buffer ??)

If you do this during IRP_NOCACHE flagged writes only - yes.

xxxxx@uow.edu.au wrote:

if i use the following for encryption with irp_mj_write

"

  1. Application: WriteFile
  2. Filter: Allocates new buffer and copies data there, passes
    the new buffer
    down
  3. FSD: Wites encrypted data
  4. Filter: does nothing at this point
  5. Applicarion: Return frm WriteFile, application’s buffer
    unchanged.
    "

Does this mean that the file on the disk will have the
encrypted data but the cache will have the non-encrypted
data ? (becouse after irp is completed is when cache manager
reads the buffer ??)


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

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


Kind regards, Dejan M.
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32 developers.
Alfa File Monitor - File monitoring library for Win32 developers.

If you choose to apply your encrypt/decrypt logic *only* on IRP_MJ_WRITE
which are going to disk ( IRPS with flags IRP_NOCAHCE, IRP_PAGING_IO). It
should work OK.

-----Original Message-----
From: xxxxx@uow.edu.au [mailto:xxxxx@uow.edu.au]
Sent: Thursday, September 29, 2005 5:57 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IRP write + cache

if i use the following for encryption with irp_mj_write

"

  1. Application: WriteFile
  2. Filter: Allocates new buffer and copies data there, passes
    the new buffer
    down
  3. FSD: Wites encrypted data
  4. Filter: does nothing at this point
  5. Applicarion: Return frm WriteFile, application’s buffer
    unchanged.
    "

Does this mean that the file on the disk will have the
encrypted data but the cache will have the non-encrypted
data ? (becouse after irp is completed is when cache manager
reads the buffer ??)


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

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

i created a pool of data with

buffer=ExAllocatePool(NonPagedPool,length);

length is size of

length = PtrCurrentStackLocation->Parameters.Write.Length;

i copy data in the irp mdl and i edit the new buffer, the
problem is i dont know how to replace the mdl in the irp with
the new buffer ?

i am guessing that

Irp->MdlAddress = buffer;

is incorrect ?