github.com/hhrutter/nomad@v0.6.0-rc2.0.20170723054333-80c4b03f0705/client/fingerprint/zstorage_windows.go (about) 1 // MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT 2 3 package fingerprint 4 5 import "unsafe" 6 import "syscall" 7 8 var _ unsafe.Pointer 9 10 var ( 11 modkernel32 = syscall.NewLazyDLL("kernel32.dll") 12 13 procGetDiskFreeSpaceExW = modkernel32.NewProc("GetDiskFreeSpaceExW") 14 ) 15 16 func getDiskFreeSpaceEx(dirName *uint16, availableFreeBytes *uint64, totalBytes *uint64, totalFreeBytes *uint64) (err error) { 17 r1, _, e1 := syscall.Syscall6(procGetDiskFreeSpaceExW.Addr(), 4, uintptr(unsafe.Pointer(dirName)), uintptr(unsafe.Pointer(availableFreeBytes)), uintptr(unsafe.Pointer(totalBytes)), uintptr(unsafe.Pointer(totalFreeBytes)), 0, 0) 18 if r1 == 0 { 19 if e1 != 0 { 20 err = error(e1) 21 } else { 22 err = syscall.EINVAL 23 } 24 } 25 return 26 }