EldoS | Feel safer!

Software components for data protection, secure storage and transfer

CallAllOpenCloseCallbacks set to true causes Wordpad Issues

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.
#26774
Posted: 10/10/2013 11:37:32
by Simon Coghlan (Standard support level)
Joined: 12/06/2011
Posts: 19

Using the C# VMounter sample application (AnyCPU).
Visual Studio 2010 (+SP1)
Windows 7 x64 (+SP1)
CBFS V4.0.136.25

in the btnCreateStorage_Click
perform the following before the CreateStorage call
mCbFs.CallAllOpenCloseCallbacks = true;

Will now cause a file open via wordpad on a newly created rtf file to crash in CbFsReadFile with a InvlaidOperationException -> "Handle is not initialized"

at System.Runtime.InteropServices.GCHandle.FromIntPtr(IntPtr value)
at Mounter.MounterForm.CbFsReadFile(CallbackFileSystem sender, CbFsFileInfo FileInfo, Int64 Position, Byte[] Buffer, Int32 BytesToRead, Int32& BytesRead) in Z:\CBFS 4\C#\VMounter\Form1.cs

Why is this important to me ? Well I'm trying to write a service and different users may want to open a file with different access permissions, this means that the above has to be set in order to get who opens what when, or will the CBFS drive be able to determine that different users are using the same file and open / close once for each of their sessions (Independent of the hosting windows service that implements CBFS callbacks) ?
#26776
Posted: 10/10/2013 11:44:25
by Eugene Mayevski (EldoS Corp.)

Thank you for the report.

VMounter and VDisk were not designed for such way of use. Their purpose is to show how to present memory-stored data as files, and they don't cover full scope of Callback File System functionality. We don't have immediate plans to extend those samples, cause doing this will add unnecessary complexity to already complex code


Quote
Simon Coghlan wrote:
or will the CBFS drive be able to determine that different users are using the same file and open / close once for each of their sessions (Independent of the hosting windows service that implements CBFS callbacks) ?
.

You are right, in most cases setting CallAll... property to true is necessary for handling multiuser (and not just multiuser) access. It's only compatibility that holds us from setting that property to true and making it obsolete, but we will consider doing this in CBFS 5.


Sincerely yours
Eugene Mayevski
#26793
Posted: 10/11/2013 03:47:40
by Simon Coghlan (Standard support level)
Joined: 12/06/2011
Posts: 19

The reason I used the existing code to demonstrate the problem, is because that is the first thing you ask for normally.

My code uses actual NTFS (On a HDD) files, and has the same issue (i.e. it is complex).

So, What is the "recommendation" / "Fix steps" to get Wordpad style apps working via CBFS ?
#26794
Posted: 10/11/2013 03:51:00
by Eugene Mayevski (EldoS Corp.)

They work just fine. Please try Mapper sample.


Sincerely yours
Eugene Mayevski
#26800
Posted: 10/11/2013 14:29:41
by Simon Coghlan (Standard support level)
Joined: 12/06/2011
Posts: 19

Thanks for sticking with me.

OK, So the way forward is to CallAllOpenCloseCallbacks set to true
Done>

Now I see that when this is so, in the Mapper application I can see that the code is using the context of the CbFsFileInfo in the open event.
So this means that CBFS has done some internal buffering of the previous "opens", and is now just performing the callback. The User side event code is not expected to perform the same task, i.e. perform a new Open and replace the CbFsFileInfo.
Is that assumption correct ?
Because the text in the following location does not indicate that, and the last few lines of the last paragraph are misleading even with the derived (Which might be incorrect) information above.

http://www.eldos.com/documentation/cbfs/ref_cl_cbfs_prp_callallopenclosecallbacks.html
#26801
Posted: 10/12/2013 02:26:46
by Eugene Mayevski (EldoS Corp.)

FileInfo and HandleInfo are different entities. FileInfo is the same since first concurrent open to last close. There's even a sample in the documentation that describes this: https://www.eldos.com/documentation/cb...texts.html .

Quote
Simon Coghlan wrote:
Because the text in the following location does not indicate that, and the last few lines of the last paragraph are misleading even with the derived (Which might be incorrect) information above.


The last paragraph applies to the whole text, not to the previous paragraph: "shortcut" can be only applied to the situation of CallAll... set to False .


Sincerely yours
Eugene Mayevski
Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.

Reply

Statistics

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