Thanks for all replies.
I resolved the issue and I thought I should show the cause just in case
someone else meet the samilar problem.
The problem was in my implementation of NPAddConnection3 in the NP DLL. As
lpLocalName passed in (in LPNETRESOURCE) is NULL or empty, I returned
WN_BAD_LOCALNAME, and this sames working ok in w2k.
But for wxp, as I click a file in the mapped drive, it will call
NPAddConnection3() with empty local name, if I return WN_BAD_LOCALNAME,
explorer will try call NPAddConnection3() with a valid local name (like
“Y:”), and cancel this connection later, this will leave the “idle” drive on
the explorer. After I changed the return to WN_ALREADY_CONNECTED for empty
local name (I also need to check the resouce is from my network resource,
and make sure the connection to the resource is connected) then explorer
will not try to call NPAddConnection3/NPCancelConnection again. And there is
no “idle” drive on the explorer anymore.
Hope this will help.
Lin
“Lin” wrote in message news:xxxxx@ntfsd…
> 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
>
>
>