Hi All
What i want to do is to encrypt at sector level. For that
I have modified the diskperf example provided with win2k DDK. I have
changed the dispatch routine for IRP_MJ_WRITE for encrypting the data
before writing to disk and I/O completion routine for decrypting the
data after reading from disk but before the data is provided to any
application. I/O completion routine is set in the dispatch routine for
IRP_MJ_READ. Now i open the notepad and saved the data in some file.
The data stored is encrypted. When i again open the same file
previously saved ,The data displayed in that file is encrypted. The
dispatch routine for IRP_MJ_READ is also not called. May be it is
reading from cache. Then i reboot the system and again open the file
and now this time file opened is not encrypted and routrine for
IRP_MJ_READ is also got called.
What’s the solution of this problem so that whenever i read ,i get
decrypted data. i.e whether it reads from cache or from disk, The
request should pass through my driver
Any help is appreciated
Thanks
Rohit
You’re encrypting the buffer in place, aren’t you? You’ve just
corrupted the caller’s buffer - in this case the file system cache.
This is why you’re reading back encrypted data.
You need to allocate a new buffer, encrypt into that buffer, then write
that buffer to disk.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Rohit Gauba,
Noida
Sent: Tuesday, June 21, 2005 11:07 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] cache creating problem
Hi All
What i want to do is to encrypt at sector level. For that
I have modified the diskperf example provided with win2k DDK. I have
changed the dispatch routine for IRP_MJ_WRITE for encrypting the data
before writing to disk and I/O completion routine for decrypting the
data after reading from disk but before the data is provided to any
application. I/O completion routine is set in the dispatch routine for
IRP_MJ_READ. Now i open the notepad and saved the data in some file.
The data stored is encrypted. When i again open the same file previously
saved ,The data displayed in that file is encrypted. The dispatch
routine for IRP_MJ_READ is also not called. May be it is reading from
cache. Then i reboot the system and again open the file and now this
time file opened is not encrypted and routrine for IRP_MJ_READ is also
got called.
What’s the solution of this problem so that whenever i read ,i get
decrypted data. i.e whether it reads from cache or from disk, The
request should pass through my driver
Any help is appreciated
Thanks
Rohit
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com