EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Callback mode StoreDecl.h - question about callbacks implementation.

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
Posted: 08/14/2012 07:47:59
by steve j. (Basic support level)
Joined: 08/14/2012
Posts: 6


Im want to use Callback mode.
Im using function StorageCreateCB.
In parameters of this function there is PHandle storage. Am I responssible for creating storage too, or only in SolFSCreateFunc i should create a file for storage.
Im passing it by reference like in the sample program in Win32 dir.
But after function returns, storage=0x00000000.
When the storage should be created?
What is the step by step recipe to create and save storage in callback mode?

Thanks for any help.
Posted: 08/14/2012 08:18:04
by Alexander Plas (EldoS Corp.)


In the StorageCreateCB function you must create a file for the storage. Actually the value which you set to Handle parameter is only passed into all other CB functions.

Check please the return value of StorageCreateCB function.
Posted: 08/16/2012 02:35:31
by steve j. (Basic support level)
Joined: 08/14/2012
Posts: 6

Sorry for my delay.
StorageCreateCB function returns value equal to value returned from SolFSCreateFileFunc. CreateFileW function returns valid handle so SolFSCreateFileFunc returns 1.
Is this code correct:
Handle storage = NULL;

//should I create storage before StorageCreateCB?
StorageCreateCB(...,&storage...); //storage==NULL

If i create storage:
Handle storage = NULL
//and then pass storage (valid handle to it) to StoragecreateCB function:
after callback function (SolFSCreateFileFunc)
storage == NULL //why?

What for is CallbackDataType UserData in every callback function?

Thanks for advice.

Could You upload some sample source code with callback mode?
c/c++/delphi would be great.

Posted: 08/21/2012 02:25:54
by Alexander Plas (EldoS Corp.)


Please refer to the documentation of OnFileCreate callback
you have to return error coded or 0 if no error occurred. Since you returns 1 SolFS treats it as the error code and returns it to upper level.

You can pass UserData parameter in any *CB function of SolFS and the value will be passed in any callback function called, so you can pass there anything or just ignore it.

Which edition of SolFS you are evaluating now, App or OS?
Posted: 08/22/2012 07:54:08
by steve j. (Basic support level)
Joined: 08/14/2012
Posts: 6

Yes, that was the error reason (wrote Callback fnc returning value greater than 0 if success). I searched SolFS.cpp file and found CheckStorageResult that gave me the answer.
Im evaluating OS edition.
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.



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