EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Three questions about C++ API

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#3833
Posted: 09/21/2007 03:07:42
by Franck Bonin (Standard support level)
Joined: 09/21/2007
Posts: 27

I am currently testing CBFS on Windows XP SP2 (corpo). I use 32bit driver v 1.0.11.23 and C++ MT lib for VC 2005.

Until now I found tree minor problems.

First :
Since SetStorageType() and SetStorageCharacteristics() methods are private member from CallbackFileSystem class, they are not easy to use. Should this be normal ?

Second :
By setting SetStorageCharacteristics(CallbackFileSystem::scRemoteDevice), explorer volume icon still "solid drive" and not "remote drive", is it normal to ?

And third :
In order to prevent reads from explore.exe, sometimes I throw an ECBFSError exception from OnReadFile callback. Here is the piece of code I added into OnReadFile callback from Monter C++ sample:

// $FB
*BytesRead = 0;
TCHAR FileName[1024];FileName[0]=0;
FileInfo->get_FileName(FileName);
WCHAR process[1024];process[0]=0;
unsigned long len (1024);
Sender->GetOriginatorProcessName( process, &len);
TRACE_MOUNTER(_T("OnReadFile : %s At %I64d B, for %d B from %s\n"), FileName, Position, BytesToRead, process);
if (_tcsstr(FileName,_T("Thumbs.db")) == NULL && _tcsstr(process,_T("explorer.exe")) != NULL)
throw ECBFSError(ERROR_ACCESS_DENIED);
// END $FB */


But this quickly fall into an error (traces from VS 2005 console):


01h41:44.703> OnReadFile : \lavalise.wmv At 0 B, for 4096 B from \Device\HarddiskVolume2\WINDOWS\explorer.exe
First-chance exception at 0x7c812a5b in Mounter.exe: Microsoft C++ exception: ECBFSError at memory location 0x00e7ed44..
01h41:44.703> OnReadFile : \lavalise.wmv At 0 B, for 4096 B from \Device\HarddiskVolume2\WINDOWS\explorer.exe
First-chance exception at 0x7c812a5b in Mounter.exe: Microsoft C++ exception: ECBFSError at memory location 0x00d7ed44..
01h41:44.703> OnReadFile : \lavalise.wmv At 0 B, for 32768 B from \Device\HarddiskVolume2\WINDOWS\explorer.exe
First-chance exception at 0x7c812a5b in Mounter.exe: Microsoft C++ exception: ECBFSError at memory location 0x00e7ed44..
HEAP[Mounter.exe]: Invalid Address specified to RtlFreeHeap( 00160000, 7C90DC61 )
Windows has triggered a breakpoint in Mounter.exe.

This may be due to a corruption of the heap, and indicates a bug in Mounter.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information


If I replace "throw ECBFSError(ERROR_ACCESS_DENIED)" by a dirty "return;", everything is working well since I set BytesRead to 0 (explorer.exe finaly understand it should stop its reading operation and continue to operate normaly).

For information, same code (with throw ECBFSError ) placed in OpenFile Handler, works fine.

#3835
Posted: 09/21/2007 07:22:04
by Vladimir Cherniga (EldoS Corp.)

First:
This is an error in interface, it will be fixed. Thanks for the pointing.
Second:
Unfortunately this flag is not worked now.
Third:
The better way to perform such prevention is to prohibit the opening operation of the file for explore.exe. Because the read callback can be called by the system cache manager and the GetOriginatorProcessName routine in this case returns another process name.
About heap corruption - we will check this.
#5171
Posted: 02/26/2008 10:56:41
by Franck Bonin (Standard support level)
Joined: 09/21/2007
Posts: 27

Since CbFS v1.2 is out, I would like to check few things :

Is flag CallbackFileSystem::scRe­moteDevice is now working (both graphicaly and internaly)?

Invalid exception handling was just a "Debug mode" concern. Anyway, has it been fixed ?

Best regards,

Franck Bonin
#5179
Posted: 02/26/2008 14:30:11
by Vladimir Cherniga (EldoS Corp.)

The problems with SetStorageType() and SetStorageCharacteristics() methods and invalid memory reference during exception handling were fixed.
The feature with remote device will be added in the nearest future.
#5182
Posted: 02/27/2008 02:19:04
by Franck Bonin (Standard support level)
Joined: 09/21/2007
Posts: 27

thank you for your answer
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

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