EldoS | Feel safer!

Software components for data protection, secure storage and transfer

direct file access

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#13974
Posted: 07/21/2010 08:44:58
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

I need to access an arbitrary file from the callback (not the same file, which triggered this callback). Could you suggest any way to do it?
#13975
Posted: 07/21/2010 11:29:11
by Vladimir Cherniga (EldoS Corp.)

The only applicable method is using file handle obtained with CreateNonCbFile(). Operating with such handle will not triggers any additional callbacks. You cannot use handle returned with OpenFile() method for a file access other than callback was invoked. You should be careful getting access from Read/Write callbacks, so that some file system resources may be already obtained, and new file system request may cause of thread locking.
#13976
Posted: 07/21/2010 11:34:57
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

Quote
Vladimir Cherniga wrote:
some file system resources may be already obtained, and new file system request may cause of thread locking.

Could you elaborate? I've tried this way, but sometimes it causes a deadlock. What I need to do to avoid deadlocks?
#13978
Posted: 07/21/2010 11:47:26
by Vladimir Cherniga (EldoS Corp.)

If this is applicable for you, try to postpone the processing from callback to another worker thread.
#13980
Posted: 07/21/2010 12:22:11
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

Unfortunately I can't, because I need result to take decision what will return from the callback.

I removed all access to the file, only CreateNonCbFile is called. Sometimes it works ok, sometimes locks. That seems very mystic to me.
#13982
Posted: 07/21/2010 12:38:07
by Vladimir Cherniga (EldoS Corp.)

Could you describe in brief how does your application works ? Also sample code will be suitable for diagnosis of a problem.
#13983
Posted: 07/21/2010 12:58:34
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

Well, I don't have any application yet, just trying to make a prototype. Basically, I have 2 tasks I have difficulties with:
1. In read callback, I need to detect requested file's size and last write datetime. The recommended way is to intercept open file callback, but this doesn't work if the file was opened before my filter is started.
2. In read callback, I need to read data from a special caching location
The proposed "exclude subpath" feature would solve this problem, but it seems this feature is not to be implemented in the nearest future?
#13989
Posted: 07/22/2010 02:27:37
by Vladimir Cherniga (EldoS Corp.)

We are planning to add "exclude path" feature in the next release. About 2 tasks, does it refer to the filtered file callback or another file ?
#13998
Posted: 07/23/2010 07:53:03
by ndee  (Basic support level)
Joined: 05/19/2010
Posts: 26

I've found that CreateNonCbFile works ok, the problem was OpenFile function which caused the system to crash. (so my task 2 is not a problem anymore)
Hopefully you will fix this bug soon.

PS just asking.. isn't possible to track a dictionary of all handles opened with CreateNonCbFile, and skip all callbacks for functions with these handles?
#14000
Posted: 07/23/2010 09:43:52
by Vladimir Cherniga (EldoS Corp.)

Quote
PS just asking.. isn't possible to track a dictionary of all handles opened with CreateNonCbFile, and skip all callbacks for functions with these handles?

There is no callbacks triggered for functions that using handles created with CreateNonCbFile. They are skipped in driver.
Quote
he problem was OpenFile function which caused the system to crash

Please describe in details how did you use this function so that causes system to crash. Also kernel crash dump will be helpful.
Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.

Reply

Statistics

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