EldoS | Feel safer!

Software components for data protection, secure storage and transfer

What is the correct sequence of operations

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.
#11598
Posted: 11/08/2009 22:19:12
by John Hyde (Standard support level)
Joined: 10/11/2009
Posts: 9

I have two processes that are sharing the virtual disk image file (image.st) and I cannot determine the order of operations that I should be following to correctly share this file.

I have tried all of the combinations that I think should work but have not had success.

Which of the CBDisk methods opens and closes the image file?
I expected MountMedia to open the file and UnmountMedia to close it but that is not what appears to be happening.

I have the process that is using the CBDisk methods working correctly.

When the other process wants to write to the disk image file what sequence of CBDisk methods should I use in PRE and POST operations shown below

PRE - stop CBDisk from accessing the virtual disk image
Open the image file, do my writes, close the image file
POST - spin up CBDisk again such that it owns writing to the image file

I am using 1.5.75.163 on WinXP

Regards, John
#11603
Posted: 11/09/2009 01:52:02
by Volodymyr Zinin (EldoS Corp.)

Quote
John Hyde wrote:
I expected MountMedia to open the file and UnmountMedia to close it but that is not what appears to be happening.

You are right. MountMedia "inserts a media". After it the callbacks OnReadFile, OnWriteFile, OnGetFileSize implemented by you will be called. UnmountMedia "removes the media". After this call the virtual storage will be like a disk drive without a media. UnmountMedia also flushes and unmounts the mounted file system before the disk is marked as "without a media".

Quote
John Hyde wrote:
When the other process wants to write to the disk image file what sequence of CBDisk methods should I use in PRE and POST operations shown below

PRE - stop CBDisk from accessing the virtual disk image Open the image file, do my writes, close the image file POST - spin up CBDisk again such that it owns writing to the image file

1. PRE - call UnmountMedia(TRUE) (TRUE - means "force unmount", i.e. unmount will be done even if any files are still opened on the disk), and perhaps DeleteMountingPoint if you wish.
2. Then perform remounting the image to access from the other process, but maybe do it by means of another virtual disk instance or with another mount point (for example with a private one) in order to hide this mounting from the rest of the world. Or perform direct read/write to the image file.
3. POST - close the image file after the use in the stage 2 and call MountMedia and perhaps AddMountingPoint.

Reply

Statistics

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