[Spice-devel] [phodav PATCH 2/3 v7] spice-webdavd-windows: Check for mapped shared folder

Lukas Venhoda lvenhoda at redhat.com
Fri May 27 14:43:36 UTC 2016


On Fri, May 27, 2016 at 4:36 PM, Marc-André Lureau <mlureau at redhat.com>
wrote:
>
> >> Rather than the user name of the driver, it would be more reliable to
> check
> >> the connection details, with a function such as
> >> WNetGetResourceInformation(). (I haven't looked in details if this is
> the
> >> right function)
> >
> > So I tested this function, and it doesn't actually return the local name
> > (drive letter). It might return this on older Windows, but on the newer
> > ones, since drive letters are per user, it doesn't return anything.
> > (localname is null).
>
> I would rather check if there is a remote name (the webdav server). If you
> can find one, I suppose it means it is mapped.
>

Well that would be fine for only checking whether the drive is connected,
or not,
but we have to get the driver letter, so that we can unmap it later.

The drive shouldn't be mapped before starting the service, this is just a
safety check,
but we should still unmap it later.
-- 
Lukas Venhoda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160527/49538a7d/attachment.html>


More information about the Spice-devel mailing list