EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Creating storage file, directory and adding file in SFS OS edition

Posted: 06/15/2012 02:01:20
by vinoth b (Basic support level)
Joined: 06/13/2012
Posts: 9

I am able to create a storage file, create a directory in it, and add a file to it in the SFS App edition as follows:
Handle storage;
StorageCreate(L"F:\\ttest.st", True, 512, "dd", &storage, '/', False, False);
StorageCreateDirectory(storage, L"/folder");
StorageCreateFile(storage, L"/file.txt", ...);

In OS edition, I am trying to create a storage as follows:
SolFSStorage* storageF = new SolFSStorage(L"F:\\v.st", TRUE, TRUE, '/', FALSE);
Execution of the above line leads to crash.

In OS edition, how would I create a storage, then a dir in it, and then add an existing file to the directory.

Some code snippets would be useful.
Kindly help!
Posted: 06/15/2012 02:57:11
by Volodymyr Zinin (Team)

The constructor can be used only to open an existing storage. In order to create new one use the class method Create or the same function StorageCreate as in the SFS App edition.
Posted: 06/15/2012 04:10:54
by vinoth b (Basic support level)
Joined: 06/13/2012
Posts: 9

The Create method of SolFSStorage is private. So I cannot use Create method.
I have done the following:

SolFSStorage* storageF = new SolFSStorage();
StorageCreate(L"F:\\v.st"..., &storage, ...);

But how would I associate the storageF object with the storage handle.
There is no set_storage method.
Posted: 06/15/2012 04:29:16
by Volodymyr Zinin (Team)

Just create a storage file once by the use of the StorageCreate function and than open the storage-file either by specifying the file name as an argument of the SolFSStorage constructor or use the SolFSStorage::set_FileName method. Look how the SimpleMounter sample does it.
Posted: 06/15/2012 07:40:09
by vinoth b (Basic support level)
Joined: 06/13/2012
Posts: 9

I create a storage as follows:

StorageCreate(L"F:\\vv.st",true, 1024, NULL, &storage, '/', false, false);
StorageCreateDirectory(storage, L"/data");

StorageCreate returns 0. But StorageCreateDirectory returns 1359. What is the problem?

When I use SolFS.lib (and SolFS.dll) for the same code it works fine. Both return 0. And I have the directory created in the storage.

But, when I use SolFSDrv.lib (and SolFSDrv.dll) then StorageCreate returns 0 and StorageCreateDirectory returns 1359.

Kindly let me know why the same code is not working with OS edition.
I am using the correct registration keys.
Posted: 06/15/2012 08:52:19
by Volodymyr Zinin (Team)

Why do you want to use the OS edition in such a way? It was made to have possibility to access a SolFS storage as it was a "usual" physical disk. So just open a storage-file, assign a mounting point (for example "X:"), and manage files/directories on it either by the use of the system API or third-party programs (file explorers, etc).
Posted: 06/17/2012 09:54:20
by vinoth b (Basic support level)
Joined: 06/13/2012
Posts: 9

I have a C++ application which installs custom fonts. But the custom font files (*.ttf) should not be directly accessible to the users. So, I want to secure the custom fonts using SFS storage. Fonts will be added to the storage file and then the storage will be mounted to a virtual drive. Now, the mounted virtual drive will be be accessible only to one particular process so that other users cannot access it. That said, I should opt for SFS OS edition, as per my understanding about the capabilities of the different editions of SFS.

For that matter, I have to create a storage (.st) and then add a font file to this storage. I am able to easily create storage files in SFS App edition but not with OS edition.

I think I cannot have both editions in my application. And as per my requirements, OS edition suits best. But, there is problem in creating storage in OS edition. With app edition the following works fine but not in OS edition:
StorageCreate(L"F:\\vv.st", true, 1024, NULL, &hStorage, '/', false, false);

So, kindly throw some light on how to manage creation of storage in OS edition.
Posted: 06/17/2012 10:12:09
by Eugene Mayevski (Team)

Please specify details about the crash you mentioned in the first message (StorageCreate fails with crash in OS edition). Does StorageCreate return an error code or there's some exception (BTW do you handle exceptions?) or even BSOD (system crash) happens.

It would be great if you posted your code (complete compileable test case) to HelpDesk so that our developers could run the code and see what's wrong and why.

Sincerely yours
Eugene Mayevski
Posted: 06/18/2012 05:16:41
by vinoth b (Basic support level)
Joined: 06/13/2012
Posts: 9

Thanks for your concern. I am able to create storage using one of the SolFSStorage constructor. Thanks!
Posted: 06/18/2012 05:37:17
by Alexander Plas (Team)


Have you managed to create the storage and the directory in it? Do you need any additional help?



Topic viewed 5349 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!