Git Product home page Git Product logo

go-windows's Introduction

go-windows

ci Go Documentation

go-windows is a library for Go (golang) that provides wrappers to various Windows APIs that are not covered by the stdlib or by golang.org/x/sys/windows.

Goals / Features

  • Does not use cgo.
  • Provide abstractions to make using the APIs easier.

go-windows's People

Contributors

adriansr avatar andrewkroh avatar apmmachine avatar axw avatar dependabot[bot] avatar kruskall avatar kvch avatar ph avatar reakaleek avatar strawgate avatar tsg avatar v1v avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-windows's Issues

_GetNativeSystemInfo fails on 64-bit Windows

From: elastic/beats#7715

func _GetNativeSystemInfo(systemInfo *SystemInfo) (err error) {
r1, _, e1 := syscall.Syscall(procGetNativeSystemInfo.Addr(), 1, uintptr(unsafe.Pointer(systemInfo)), 0, 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}

On 64-bit windows when compiled as 64-bit Go, r1 gets set to 0 which then causes the logic here to proceed into an error state and return syscall.EINVAL (which gets printed as "invalid argument").

On 32-bit windows (or 64-bit windows compiled with 32-bit Go) , r1 gets set to 262144 which is 0x400000 which then returns successfully.

This syscall does not provide a return code per: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724340(v=vs.85).aspx -- i might be misunderstanding the semantics of GO syscalls but I think checking that r1 == 0 is incorrect here. If that's the case then why does it return 0x400000 on x86....

Documentation?

pkg.go.dev has a single function from this package documented, why? Where would I find relevant documentation?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.