2023-04-10 15:36:59 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2019-10-22 12:21:59 +00:00
|
|
|
// MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT
|
|
|
|
|
|
|
|
package fingerprint
|
|
|
|
|
|
|
|
import "unsafe"
|
|
|
|
import "syscall"
|
|
|
|
|
|
|
|
var _ unsafe.Pointer
|
|
|
|
|
|
|
|
var (
|
|
|
|
modkernel32 = syscall.NewLazyDLL("kernel32.dll")
|
|
|
|
|
|
|
|
procGetDiskFreeSpaceExW = modkernel32.NewProc("GetDiskFreeSpaceExW")
|
|
|
|
)
|
|
|
|
|
|
|
|
func getDiskFreeSpaceEx(dirName *uint16, availableFreeBytes *uint64, totalBytes *uint64, totalFreeBytes *uint64) (err error) {
|
|
|
|
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)
|
|
|
|
if r1 == 0 {
|
|
|
|
if e1 != 0 {
|
|
|
|
err = error(e1)
|
|
|
|
} else {
|
|
|
|
err = syscall.EINVAL
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|