Dear NFSD,
My onfly encryption driver is launched in BOOT time, but I need to have the
opportunity to
enable/disable encryption on the fly for a certain folder specified by the
user.
As far as I understand, it cannot be implemented completely, for example,
if the file is still in USE (FileMapped).
So here is my question - is it possible to exactly determine the moment
when the file is mapped into the memory and also the moment when this
mapping is closed?
Regards,
Vitaliy Perepelkin
Vitaly
Did you consider this program? The file might be unmapped but … is the
update data written out of the cache yet … try it and see?
hFile = CreateFile(filename, GENERIC_ALL, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
hFileMapping = CreateFileMapping(hFile, NULL, PAGE_READWRITE, 0, Size,
NULL);
lpMapAddress = MapViewOfFile(hFileMapping, FILE_MAP_READ | FILE_MAP_WRITE,
0, 0, 0);
CloseHandle(hFile);
Update(lpMapAddress, Size);
UnmapViewOfFile(lpMapAddress);
CloseHandle(hFileMapping);
Lyndon
“Vitaliy Perepelkin” wrote in message news:xxxxx@ntfsd…
> Dear NFSD,
>
> My onfly encryption driver is launched in BOOT time, but I need to have
> the
> opportunity to
> enable/disable encryption on the fly for a certain folder specified by the
> user.
> As far as I understand, it cannot be implemented completely, for example,
> if the file is still in USE (FileMapped).
> So here is my question - is it possible to exactly determine the moment
> when the file is mapped into the memory and also the moment when this
> mapping is closed?
>
> Regards,
> Vitaliy Perepelkin
>
>
>
>
No need in this. You can switch crypto off, and the subsequent FCB opens in
this folder will make the file unencrypted.
You can also use CcPurgeCacheSection to force Cc to forget the cache maps
and release the FCB.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Vitaliy Perepelkin”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Wednesday, April 06, 2005 6:31 PM
Subject: [ntfsd] when the file is mapped into the memory
> Dear NFSD,
>
> My onfly encryption driver is launched in BOOT time, but I need to have the
> opportunity to
> enable/disable encryption on the fly for a certain folder specified by the
> user.
> As far as I understand, it cannot be implemented completely, for example,
> if the file is still in USE (FileMapped).
> So here is my question - is it possible to exactly determine the moment
> when the file is mapped into the memory and also the moment when this
> mapping is closed?
>
> Regards,
> Vitaliy Perepelkin
>
>
>
>
> —
> 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
All you need to do is to handle paging I/Os correctly.
If done, you must not care about the moment when/if
the file is mapped to memory.
L.