This commit is contained in:
bluepython508 committed 2026-10-22 12:27:19 +01:00
1 parent 3530afb854
commit 6903fcff27
2146 files changed
+112256 -190703

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
// Code generated by 'go generate'; DO NOT EDIT.
package wingoes
import (
"syscall"
"unsafe"
"golang.org/x/sys/windows"
)
var _ unsafe.Pointer
// Do the interface allocations only once for common
// Errno values.
const (
errnoERROR_IO_PENDING = 997
)
var (
errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
errERROR_EINVAL error = syscall.EINVAL
)
// errnoErr returns common boxed Errno values, to prevent
// allocations at runtime.
func errnoErr(e syscall.Errno) error {
switch e {
case 0:
return errERROR_EINVAL
case errnoERROR_IO_PENDING:
return errERROR_IO_PENDING
}
// TODO: add more here, after collecting data on the common
// error values see on Windows. (perhaps when running
// all.bat?)
return e
}
var (
modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
procGetVersionExW = modkernel32.NewProc("GetVersionExW")
)
func getVersionEx(osv *_OSVERSIONINFOEX) (err error) {
err = procGetVersionExW.Find()
if err != nil {
return
}
r1, _, e1 := syscall.SyscallN(procGetVersionExW.Addr(), uintptr(unsafe.Pointer(osv)))
if int32(r1) == 0 {
err = errnoErr(e1)
}
return
}