-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Describe the bug
Executing of disk.IOCounters() in Virtual Windows (WEMU or VMWare) player results in error:
"The system cannot find the path specified"
To Reproduce
Compile the following code with the CLI: GOOS=windows go build -tags windows -o file.exe file.go
_, err := disk.IOCounters()
if err != nil {
panic(err)
}
Expected behavior
Returned disk io counters
Additional context
- The code is compiled on Ubuntu 20.04 and executed on virtual Windows Server 2019 running in VMWare Player. Host is Ubuntu 20.04
- Debugging of the source revealed that the path "\.\c:" cannot be found. The failure is observed in this piece of code
Line 167 in ec072d9
err = windows.DeviceIoControl(h, IOCTL_DISK_PERFORMANCE, nil, 0, (*byte)(unsafe.Pointer(&diskPerformance)), uint32(unsafe.Sizeof(diskPerformance)), &diskPerformanceSize, nil)