-
-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows: enumerate drives via FindNextVolumeW + GetVolumePathNamesFor…
…VolumeNameW This PR changes the mechanism for enumerating "disks" on windows. The previous approach only worked for volumes that were assigned a drive letter. Windows volumes can also be mounted in the file system. We first fetch a list of volume GUID paths (volume names). These have the form `\\?\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\`. We then use `GetVolumePathNamesForVolumeNameW` to map each of these to a set of mount paths (`C:\` for drive letters or arbitrary paths for path mounts). We then return one `Disk` entry for each mount path (flat-map). This should roughly match the semantics of the linux implementation, which would also primarily looks at mount points (not actual disk volumes). It means that a volume that is mounted multiple times (multiple drive letters and/or mount paths) will show up as multiple disks.
- Loading branch information
Showing
1 changed file
with
142 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters