EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Move directory with EncryptWithHeader

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#24063
Posted: 03/13/2013 09:13:20
by Hemant Sharma (Priority Standard support level)
Joined: 03/08/2013
Posts: 3

Trying to move directory with EncryptWithHeader sample leaves files in the directory in clear when moving in and cipher text when moving the directory out.
Need some information on where the directory move should be handled, i.e.
in OnRenameOrMoveFileC or OnPostRenameOrMoveFileC and using regular handle or the
non-callback handle?
#24064
Posted: 03/13/2013 09:33:18
by Vladimir Cherniga (EldoS Corp.)

You should handle directory moving separately from individual files moving. Because directory moving doesn't touch the files inside the directory.
#24066
Posted: 03/13/2013 10:31:25
by Hemant Sharma (Priority Standard support level)
Joined: 03/08/2013
Posts: 3

I understand that the directory handling has to be separate than individual files. But my question is directory handling should go in which callback? I see that trying to open regular and nonCB handle for individual files with in a directory in OnRenameOrMoveFileC fails returning invalid handle.
#24067
Posted: 03/13/2013 10:57:50
by Vladimir Cherniga (EldoS Corp.)

Quote
I understand that the directory handling has to be separate than individual files. But my question is directory handling should go in which callback?

You may try to make it in PostRenameOrMove directory callback handler. In preprocess callback the directory may be taken by the file system exclusively, making sure that there are no opened handles exist for the files inside it.
#24068
Posted: 03/13/2013 12:57:38
by Vladimir Cherniga (EldoS Corp.)

If it doesn't work as suggested in previous message, try to handle directory open/close requests. In usercontext, associated with a target folder, mark the folder with a flag, when RenameOrMove callback arise. Then in last close callback for the target directory perform a required actions.
#24073
Posted: 03/13/2013 14:07:21
by Hemant Sharma (Priority Standard support level)
Joined: 03/08/2013
Posts: 3

RenameOrMove callback comes with NULL context, so there is no way to stick the flag in other than to create a context within RenameOrMove callback and set a flag, but then I don't see any close callback following the rename operation.
#24076
Posted: 03/13/2013 14:16:39
by Vladimir Cherniga (EldoS Corp.)

Looking at CbFltPostCreateFileC/CbFltPostOpenFileC code, will find that it skip context creation for directory files
Code
        if(0 == (FileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
        {
              ......
        }

You just need to change this code so that context could be created on directory open.
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

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