EldoS | Feel safer!

Software components for data protection, secure storage and transfer

PreCreate callback

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#35463
Posted: 01/08/2016 09:58:02
by vandernyt (Basic support level)
Joined: 09/16/2015
Posts: 10

Hello!

I have a problem which I described before:
https://www.eldos.com/forum/read.php?FID=13&TID=6393
In a few words with a little update:
1. I want to show my dialog with question: "Do you want to encrypt the file?".
2. If result is "Yes" - proceed copy operation with encryption. Else - proceed usual copy operation.

I noticed that cbfs filter has PreCreate and PostCreate callbacks.
Can I do this:

Code
void CbFltCreateFileC(/*parameters*/)
{
    WCHAR text[MAX_PATH * 2];
    if (0 == (*FileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
       wsprintfW(text, L"CreateFileC %s", FileName);
       AddToLog(text);
    }

    int res = MessageBox(0, "Title", "Do you want to encrypt the file?", MB_YESNO)
    if (res == IDYES) {
         // Set flag for the context encryption.
    }

    *RequestAccepted = TRUE;
}


So first of all I want to show only my dialog with question. After I get a result from the MessageBox, the copy operation (copy with encryption in case res == IDYES) will proceed automatically and the copying dialog will apper on the screen.

Is it possible to do with cbfs filter?
I'm asking this question, since we do not have a key for cbfs filter. And we will move to this filter, if an answer is positive.

Thanks for help again!
#35464
Posted: 01/08/2016 10:12:08
by Eugene Mayevski (EldoS Corp.)

You will have two obstacles here:

1) You can not provide different file contents to different applications, because some of file information might already reside in the cache. While it might be possible to flush the cache, if two processes request the same file to be opened, you won't be able to deliver different file contents to those processes. So it won't be possible to make one process read encrypted data (without decryption) and let other process read decrypted data. Moreover, if encrypted and decrypted data have different length, how would you report this information to the OS when the directory is enumerated? So far I don't see any workarounds to this obstacle.

2) the file open request can't wait forever, because the whole filesystem might be blocked waiting for the file to be opened. This means that your dialog should have some expiration after which the operation should be denied. This is doable, but special attention needs to be paid.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 2010 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!