EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How do I disconnect a mount network drive from Windows Explorer?

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#11246
Posted: 10/06/2009 08:25:50
by Hunter Hagewood (Standard support level)
Joined: 10/02/2009
Posts: 9

I'm using CBFS to implement a FS in which the actual storage is spread across the network, so I'm exposing the FS to windows as a network drive.

I've created separeted applications to mount and unmount the FS. In my FS application I've set CBFS to call functions that do the same my separeted applications do to the mount and unmount events.

If I right click on the network drive correspondent to my FS and choose the disconnect option the message "Insufficient system resources exist to complete the requested service" is displayed and the drive continues there.

The sequence of IRPs after the disconnect is:

IRP_MJ_CLOSE -> SUCCESS
IRP_MJ_CREATE -> SUCCESS
FASTIO_DEVICE_CONTROL -> FAILURE
IRP_MJ_DEVICE_CONTROL -> SUCCESS
IRP_MJ_CLEANUP -> SUCCESS
IRP_MJ_CLOSE -> SUCCESS


What does trigger the mount/unmount events? Is it possible to make the disconnect option functional?

Tks,
Hunter
#11252
Posted: 10/06/2009 10:19:32
by Volodymyr Zinin (EldoS Corp.)

Quote
Hunter Hagewood wrote:
If I right click on the network drive correspondent to my FS and choose the disconnect option the message "Insufficient system resources exist to complete the requested service" is displayed and the drive continues there.

Disconnecting the drive from the menu only remove the mounting point. In order to enable it use the flag nsmAllowMapAsDrive in the AddNetworkMountingPoint call.

Quote
Hunter Hagewood wrote:
I'm using CBFS to implement a FS in which the actual storage is spread across the network, so I'm exposing the FS to windows as a network drive.

Perhaps you don't need the network mounting points. I.e. you can use it with the flags nsmWriteNetworkAccess and nsmReadNetworkAccess to give the real network access to your drive, but another way is to create a "usual" mounting point (by means of AddMountingPoint) and assign the system share to it (for example via the NetShareAdd system API). The latter gives you ability to set some specific security rights to the share.
#11254
Posted: 10/06/2009 13:40:46
by Hunter Hagewood (Standard support level)
Joined: 10/02/2009
Posts: 9

Vladimir, with the flag nsmAllowMapAsDrive I can now disconnect and add mounting points from explorer, however, if I remove all the mounting points I can't add mounting points anymore.

Ex.:
1. I start my application and it creates the drive N: to me.
2. Using explorer I map two other network drives X: and Z: to my drive
3. I disconnect N:, X: and Z:
4. I can't do what I did in step 2

Is this OK?
#11255
Posted: 10/07/2009 01:29:08
by Volodymyr Zinin (EldoS Corp.)

It isn't ok.
Please specify what CallbackFS API (i.e .NET, C++, or Delphi) are you using?
#11258
Posted: 10/07/2009 06:34:55
by Hunter Hagewood (Standard support level)
Joined: 10/02/2009
Posts: 9

I'm using the C++ API. The problem occurred in a 32 bits machine running Windows XP
#11259
Posted: 10/07/2009 07:11:30
by Vladimir Cherniga (EldoS Corp.)

Hi,
i just have tried to reproduce such behavior with a Mounter CPP sample on a WinXP test machine. All that i have done is:
1. Create network mounting point with AddMountingPointEx api
2. Add network disks with explorer.
3. Delete mounting point with DeleteMountingPointEx.
4. Delete network disks.
5. Repeat steps 1-4

All works without any objections. Please specify if i have done something in a wrong sequence.
#11260
Posted: 10/07/2009 07:57:27
by Hunter Hagewood (Standard support level)
Joined: 10/02/2009
Posts: 9

Let me detail it better.

1. I used the following code to add the first mounting point. gMountPath is "N:;;NSS"

Code
_Cbfs.AddNetworkMountingPoint(   gMountPath,
                              false,
                              NULL,
                              CallbackFileSystem::CbFsNetworkSymLinkFlags::nsmAllowMapAsDrive);


It makes appear a network driver N: in "My computer"

2. I used explorer to map drives X: and Z: passing \\FLAME\NSS in the folder field (FLAME is my computer name)

3. Still using explorer I disconnected N:, X: and Z:

4. I tried to map a network drive the same way I did in 2. The following message is showed: "The mapped network drive could not be created because the following error has occurred: the specified network name is no longer available."

Note that only the first step was made programatically, the rest was through explorer
#11261
Posted: 10/07/2009 08:13:12
by Tim Hayes (Standard support level)
Joined: 06/06/2007
Posts: 36

I too have had something like this in the past. I added a network mounting point, then used Windows to disconnect. I could not reconnect with Windows and ended up restarting the PC. (Win XP).

Is it the case that CBFS does not detect a disconnect at the Windows level??
#11269
Posted: 10/08/2009 04:59:47
by Volodymyr Zinin (EldoS Corp.)

Yes, there is a problem with the nsmAllowMapAsDrive flag. And we will fix it in a short time. Sorry for the inconvenience.
#11397
Posted: 10/20/2009 01:40:50
by Volodymyr Zinin (EldoS Corp.)

The bug has been fixed in the latest build.
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

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