EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Callback filter and encryption

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#7401
Posted: 08/21/2008 18:39:55
by Joe Portman (Basic support level)
Joined: 05/28/2008
Posts: 21

My target application does "on the fly" encryption/decryption of protected files.
This works well enough as long as the filter is started before any encrypted files are created or written.

The problem:

1. There is no way to ensure that the data being written will ever be flushed to disk before the filter is terminated.

An example:

I am encrypting doc file in C:\tmp

I copy an unencrypted version from C:\my documents using Explorer.

I see the open callbacks and the close callbackss. I may or may not _ever_ see the write callbacks, as they are "cached" by windows.

If my filter is terminated before windows "Decides" to flush my data to disk, I am SOL and the UNENCRYPTED data will be written to disk.

If I "shutdown and reboot" it appears that my filter process is killed well before my buffers are flushed to disk, rendering my exercise pointless.

There must be a cure for this? Surely. Perhaps a new method call to "flush files to disk?"

Help.
JP
#7414
Posted: 08/22/2008 06:11:51
by Vladimir Cherniga (EldoS Corp.)

We planing to add mechanism that will flush cashed files at the filter detachment stage. Could you try to initiate file flushing by call to the FlushFileBuffers win32 api. Try to use it with handle opened by CallbackFilter.OpenFile() api.
#7415
Posted: 08/22/2008 10:38:40
by Joe Portman (Basic support level)
Joined: 05/28/2008
Posts: 21

Quote
Vladimir Cherniga wrote:
We planing to add mechanism that will flush cashed files at the filter detachment stage. Could you try to initiate file flushing by call to the FlushFileBuffers win32 api. Try to use it with handle opened by CallbackFilter.OpenFile() api.


I'll give that a try. I tried using the example given by MSDN to flush all files on a particular disk, but to no avail.

IE

hanlde h = CreateFile("\\\\.\\C:",...blah).
FlushFileBuffers(h);
CloseHandle(h);

Thanks for the suggestion, I will try it and report back.
#7420
Posted: 08/25/2008 06:38:06
by Joe Portman (Basic support level)
Joined: 05/28/2008
Posts: 21

Quote
Joe Portman wrote:
Quote
Vladimir Cherniga wrote:
We planing to add mechanism that will flush cashed files at the filter detachment stage. Could you try to initiate file flushing by call to the FlushFileBuffers win32 api. Try to use it with handle opened by CallbackFilter.OpenFile() api.


I'll give that a try. I tried using the example given by MSDN to flush all files on a particular disk, but to no avail.

IE

hanlde h = CreateFile("\\\\.\\C:",...blah).
FlushFileBuffers(h);
CloseHandle(h);

Thanks for the suggestion, I will try it and report back.




Calling Win32 API FlushFileBuffers with the aforementioned handle seems to have no effect. IE,buffers are not flushed.

Reply

Statistics

Topic viewed 4196 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!