DefineDosDevice() problem in XP

I have a network redirector, I need to map a drive to it. I used
DefineDosDevice() to do the mapping/unmapping work in my np dll. I can map
a drive (say “W:”) to my network resource (say \share\root\mydir), and it
works fine. But as I am right clicking an item (file or directory) under the
drive (say to get “properties”), it will create an “idle” drive (with red
“?” on it) in the Explorer. I found this is because as you right click a
file (directory) under the mapped drive in explorer, it will first map a
drive (say “Y”, different from the drive you are in) to that item, and then
remove that drive (“Y” in this case). In my case, it will call np to
map/unmap the drive, which calls DefineDosDevie to map/unmap the drive, and
that will leave the “idle” drive in the explorer. If I close the explorer,
and start it again, the “idle” drive will be gone. In W2K, it works fine,
without such problem.

I also tried to use SetVolumeMountPoint(), but to get the unique volume
name, I need to call DefineDosDevice again (map the drive by using
DefineDosDevice, get the volume name, get the volume name, and unmap the
drive, then call SetVolumeMountPoint, according to SDK), this will also
leave an “idle” drive because it calls DefineDosDevice for removing the
temporary drive. And it failed in GetVolumeNameForVolumeMountPoint with
ERROR_PATH_NOT_FOUND in my case for some reasons.

Did I miss something in my np dll for handling map/unmap the drive ? Are
there something else I need to take care of in the XP case in my np and
driver? Or this is a bug in the explorer?

Thanks,

Lin

> works fine. But as I am right clicking an item (file or directory) under the

drive (say to get “properties”), it will create an “idle” drive (with red
“?” on it) in the Explorer.

You need the NP DLL for this to work. This is normal for a redir without the NP
DLL.

I also tried to use SetVolumeMountPoint(),

No, redirs has nothing to do with MountMgr.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Maxim,

I have NP DLL, and all calls to DefineDosDevice are in the NP DLL, otherwise
I will not be able to map a drive. Do you mean I have to handle something
else in the NP DLL?

Thanks,

Lin

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntfsd…
> > works fine. But as I am right clicking an item (file or directory) under
the
> > drive (say to get “properties”), it will create an “idle” drive (with
red
> > “?” on it) in the Explorer.
>
> You need the NP DLL for this to work. This is normal for a redir without
the NP
> DLL.
>
> > I also tried to use SetVolumeMountPoint(),
>
> No, redirs has nothing to do with MountMgr.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>

Look at NPGetResourceInfomation.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Lin”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, May 18, 2004 5:50 PM
Subject: Re:[ntfsd] DefineDosDevice() problem in XP

> Maxim,
>
> I have NP DLL, and all calls to DefineDosDevice are in the NP DLL, otherwise
> I will not be able to map a drive. Do you mean I have to handle something
> else in the NP DLL?
>
> Thanks,
>
> Lin
>
> “Maxim S. Shatskih” wrote in message
> news:xxxxx@ntfsd…
> > > works fine. But as I am right clicking an item (file or directory) under
> the
> > > drive (say to get “properties”), it will create an “idle” drive (with
> red
> > > “?” on it) in the Explorer.
> >
> > You need the NP DLL for this to work. This is normal for a redir without
> the NP
> > DLL.
> >
> > > I also tried to use SetVolumeMountPoint(),
> >
> > No, redirs has nothing to do with MountMgr.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.com
> >
> >
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com