-
-
Notifications
You must be signed in to change notification settings - Fork 404
/
filesystems_windows.go
56 lines (44 loc) · 1.05 KB
/
filesystems_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//go:build windows
// +build windows
package main
import (
"golang.org/x/sys/windows/registry"
)
const (
WindowsSandboxMountPointRegistryPath = `Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC\LocalMOF`
)
var windowsSandboxMountPoints = loadRegisteredWindowsSandboxMountPoints()
func loadRegisteredWindowsSandboxMountPoints() (ret map[string]struct{}) {
ret = make(map[string]struct{})
key, err := registry.OpenKey(registry.CURRENT_USER, WindowsSandboxMountPointRegistryPath, registry.READ)
if err != nil {
return
}
keyInfo, err := key.Stat()
if err != nil {
return
}
mountPoints, err := key.ReadValueNames(int(keyInfo.ValueCount))
if err != nil {
return
}
for _, val := range mountPoints {
ret[val] = struct{}{}
}
return ret
}
func isFuseFs(m Mount) bool {
//FIXME: implement
return false
}
func isNetworkFs(m Mount) bool {
_, ok := m.Metadata.(*NetResource)
return ok
}
func isSpecialFs(m Mount) bool {
_, ok := windowsSandboxMountPoints[m.Mountpoint]
return ok
}
func isHiddenFs(m Mount) bool {
return false
}