EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Callback mode StoreDecl.h - question about callbacks implementation.

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.
#21034
Posted: 08/14/2012 07:47:59
by steve j. (Basic support level)
Joined: 08/14/2012
Posts: 6

Hi.

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.
StorageCreateCB(...,&storage,..);
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.
sj.
#21035
Posted: 08/14/2012 08:18:04
by Alexander Plas (EldoS Corp.)

Hello

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.
#21041
Posted: 08/16/2012 02:35:31
by steve j. (Basic support level)
Joined: 08/14/2012
Posts: 6

Hi.
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
StorageCreate(,...,&storage)
//and then pass storage (valid handle to it) to StoragecreateCB function:
StorageCreateCB(...,&storage,...);
after callback function (SolFSCreateFileFunc)
storage == NULL //why?


P.S.
What for is CallbackDataType UserData in every callback function?

Thanks for advice.
sj

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

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

Hello

Please refer to the documentation of OnFileCreate callback
https://www.eldos.com/documentation/so...efile.html
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?
#21120
Posted: 08/22/2012 07:54:08
by steve j. (Basic support level)
Joined: 08/14/2012
Posts: 6

Hi.
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.
Thanks.
Im evaluating OS edition.
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

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