EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Mapper Sample Unmount Problem

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#32743
Posted: 03/25/2015 03:38:45
by Jacky Lee (Standard support level)
Joined: 10/24/2014
Posts: 11

I have done for mapper sample:
1. Install Driver
2. Create Storage
3. Mount
4. Add Mounting Point

mirror path is "D:\\Test", mount point is "Z:", everything works fine. I close the Mapper Dialog without doing:
1. Delete Mounting point
2. Unmount
3. Delete Storage

After the program exit, the drive with a question mark is still on the explorer.(See pic1.png)

Environment:
OS: WinXP sp3(also happened on some Win7 64bit)
CBFS driver version: 5.1.152.54

Thanks.


#32755
Posted: 03/25/2015 06:46:15
by Volodymyr Zinin (EldoS Corp.)

The CBFS driver catches that your application (the Mapper sample in this case) finished without destroying the virtual storage and performs the storage deletion itself. Unfortunately deletion of mounting points (drive letter) requires Explorer.exe to be notified by the use of the WM_DEVICECHANGE message, but it isn't possible to do from the kernel mode. So the CBFS driver uses the mount notifier helper DLL to send that Windows message.
Please check that this helper DLL is installed (check that the flag CBFS_MODULE_MOUNT_NOTIFIER_DLL is specified in your Install method call).

Thanks.
#32759
Posted: 03/25/2015 09:15:48
by Jacky Lee (Standard support level)
Joined: 10/24/2014
Posts: 11

Got it, thank you for your explain. At first I do NOT set flag CBFS_MODULE_MOUNT_NOTIFIER_DLL, then I fixed it.

Code
CallbackFileSystem::Install( FilePath,
                             g_Guid,
                             PathToInstall,
                             true,
                             CBFS_MODULE_NET_REDIRECTOR_DLL |                      CBFS_MODULE_MOUNT_NOTIFIER_DLL,
                             &reboot );


Recompile Mapper.exe > Uninstall Driver > Reboot > Install Driver
> Create Storage > Mount > Add Mount Point.

When I closed the mapper.exe directly, the problem still occured!
As I can see, click the close button, a WM_CLOSE message will be send to the mapper dialog, and OnCallbackFsDestroy will be called

Code
void OnCallbackFsDestroy(HWND hwnd)
{
    if(g_CbFs.Active())
    {
        for(INT Index = g_CbFs.GetMountingPointCount() - 1; Index >= 0; --Index)
        {
            g_CbFs.DeleteMountingPoint(Index);
        }
    }
    if(g_CbFs.Active())
    {
        g_CbFs.UnmountMedia(TRUE);
    }
    if(g_CbFs.StoragePresent())
    {
        try
        {
            g_CbFs.DeleteStorage(TRUE);
        }
        catch(...)
        {

        }
    }
   PostQuitMessage(0);
}


Why calling DeleteMountingPoint could not delete the drive letter? or the helper DLL(CBFS_MODULE_MOUNT_NOTIFIER_DLL) do not work?

By the way, when I set breakpoint at DeleteMountingPoint line and step over, it works fine.
#32760
Posted: 03/25/2015 10:43:56
by Volodymyr Zinin (EldoS Corp.)

Quote
Yong Li wrote:
As I can see, click the close button, a WM_CLOSE message will be send to the mapper dialog, and OnCallbackFsDestroy will be called

Oh. I forgot about this code. If it's called then the mount notifier helper DLL isn't required. It's necessary if the app is killed "instantly" without possibility to perform any "on process terminating" routines.
Also this helper DLL is required to notify other than the current logon sessions about a created mounting point.

Quote
Yong Li wrote:
Why calling DeleteMountingPoint could not delete the drive letter? or the helper DLL(CBFS_MODULE_MOUNT_NOTIFIER_DLL) do not work?

The mounting point is deleted but for some reason Explorer either isn't notified or notified incorrectly. And this causes Explorer doesn't update information about present drive letters.

As I remember some fixes have been made recently concerning this code (i.e. notifications of Explorer). Could you please check the problem with the latest CBFS version? If it's still present there then I will try to reproduce it too and will work on it.

Thanks.
#32774
Posted: 03/25/2015 21:30:10
by Jacky Lee (Standard support level)
Joined: 10/24/2014
Posts: 11

Hello Volodymyr,

The latest CBFS version I installed is 5.1.157.65

I have also set the flag CBFS_MODULE_MOUNT_NOTIFIER_DLL when install driver. but the problem is still exists, and can reproduce on win7 bit64 and xp sp3.

Do you need more information?

Thanks.
#32787
Posted: 03/26/2015 11:48:24
by Volodymyr Zinin (EldoS Corp.)

Thank you for testing. I have corrected the code. Theoretically the problem can occur again but it will be much rare.
We will make the new CBFS build in about a week.
#32799
Posted: 03/26/2015 20:44:13
by Jacky Lee (Standard support level)
Joined: 10/24/2014
Posts: 11

Got it, Thanks.
#32825
Posted: 03/29/2015 20:34:17
by Jacky Lee (Standard support level)
Joined: 10/24/2014
Posts: 11

Hello Volodymyr,

Could you tell me in advance that how to fix this problem, I can't wait the next CBFS release version.

Thanks.
#32828
Posted: 03/30/2015 01:14:54
by Eugene Mayevski (EldoS Corp.)

You can't change the behavior on your side, we are sorry. We plan to make a new build probably this week.


Sincerely yours
Eugene Mayevski
#32862
Posted: 03/30/2015 20:54:44
by Jacky Lee (Standard support level)
Joined: 10/24/2014
Posts: 11

Got it, I am looking forward to it!
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

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