Hi,
I am opening a vmdk file and mounting the volumes by using the below code
m_vixError = VixDiskLib_Open(
m_vixDiskLibCon,
fileName,
VIXDISKLIB_FLAG_OPEN_UNBUFFERED,
&m_vixDiskLibHandle);
m_vixError = VixMntapi_OpenDiskSet(
&m_vixDiskLibHandle,
1,
0,
&m_vixDiskSetHandle);
m_vixError = VixMntapi_GetVolumeHandles(
m_vixDiskSetHandle,
&m_numberOfVolumes,
&m_vixVolumeHandle);
for ( int i = 0; i < m_numberOfVolumes; i++ )
{
m_vixError = VixMntapi_MountVolume(m_vixVolumeHandle[i], FALSE);
}
Doing some operation here.............
....... How to dismount the volumes and close the disk handles if the application CRASHES here.......
Normally i'm using the below functions for unmounting the volumes and closing the disk handles
VixMntapi_DismountVolume(m_vixVolumeHandle[i], TRUE);
VixMntapi_FreeVolumeHandles(m_vixVolumeHandle);
VixMntapi_CloseDiskSet(m_vixDiskSetHandle);
VixDiskLib_Close(CVMDKFileRestore::vmdkVixDiskLibHandle.find(it->first)->second);
Thanks
Manickam