MCPcopy
hub / github.com/henrygd/beszel / setupDiSetup

Function setupDiSetup

agent/battery/battery_windows.go:86–96  ·  view source on GitHub ↗
(proc *windows.LazyProc, nargs, a1, a2, a3, a4, a5, a6 uintptr)

Source from the content-addressed store, hash-verified

84var errNotFound = errors.New("no more batteries")
85
86func setupDiSetup(proc *windows.LazyProc, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, error) {
87 _ = nargs
88 r1, _, errno := syscall.SyscallN(proc.Addr(), a1, a2, a3, a4, a5, a6)
89 if windows.Handle(r1) == windows.InvalidHandle {
90 if errno != 0 {
91 return 0, error(errno)
92 }
93 return 0, syscall.EINVAL
94 }
95 return r1, nil
96}
97
98func setupDiCall(proc *windows.LazyProc, nargs, a1, a2, a3, a4, a5, a6 uintptr) syscall.Errno {
99 _ = nargs

Callers 1

winBatteryGetFunction · 0.85

Calls 1

HandleMethod · 0.65

Tested by

no test coverage detected