On Tue, 18 Feb 2025 at 21:02, Corinna Vinschen via Cygwin
<cygwin@cygwin.com> wrote:
>
> On Feb 18 11:41, Jeremy Drake via Cygwin wrote:
> > On Tue, 18 Feb 2025, Corinna Vinschen via Cygwin wrote:
> >
> > > On Feb 18 11:19, Jeremy Drake via Cygwin wrote:
> > > > On Tue, 18 Feb 2025, Corinna Vinschen via Cygwin wrote:
> > > >
> > > > > Yep. Are you going to create a patch?
> > > >
> > > > I'm not seeing a particularly clean way to do this.  Bring back
> > > > available_drives, mask off bits when we see the corresponding drive root
> > > > from dos_drive_mappings, and return those drive letters whose bits are
> > > > still set at the end?
> > >
> > > No, I wouldn't do that.
> > >
> > > IMHO, the cleanest way to bring this back is to extend
> > > dos_drive_mappings::dos_drive_mappings():
> > >
> > > - Prior to the FindFirstVolumeW/FindNextVolumeW loop, prepend another
> > >   loop iterating over GetLogicalDrives() or GetLogicalDriveStringsW().
> > >   In the loop, call QueryDosDevice and add this info to
> > >   dos_drive_mappings, just as in the FindVolume loop.
> > >
> > > - In the second loop, simply ignore all mounts mounted to just a drive
> > >   letter (because the first loop already added them all).
> > >
> > > Makes sense?
> >
> > The second loop would have to go back over the list created by the first
> > loop, to see if the volume it's trying to add already has an entry, and if
> > so extend its dosmount linked list with additional (non-drive-letter
> > roots) mounts for that volume.  I guess it only needs to do that if there
> > are any volumes which have both drive-letter-root AND
> > non-drive-letter-root mounts, so that's not TOO bad.
>
> I'm pretty sure the second loop doesn't have to do much testing.
>
> GetLogicalDrives/GetLogicalDriveStringsW both return *all* simple drive
> letter mount points valid for the current user.
>
> So in the second loop, you can just skip all simple drive letter mount
> points returned by GetVolumePathNamesForVolumeNameW, without further
> testing.  They already have been returned above.  You only have
> to memorize the mount points mounted on directories in this loop.
>
> You *could* first do the FindFirstVolumeW/FindNextVolumeW loop and
> *then* the GetLogicalDrives/GetLogicalDriveStringsW loop, but in this
> case you really have to check every single drive letter if it already
> has shown up in the first loop...
>
> > I'll try to make a patch for this.
>
> Great!

What about UNC mounts, like mounting the Microsoft NFSv3 filesystem
with an UNC path? This should be listed, too - as "net use" lists
those mounts

Ced
-- 
Cedric Blancher <cedric.blanc...@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to