Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys/windows: get Windows services status without all access permissions #60573

Closed
tguenneguez opened this issue Jun 2, 2023 · 2 comments
Closed
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Milestone

Comments

@tguenneguez
Copy link

Next exchange with #48777

Why not change the fonction like this :
func (m *Mgr) OpenService(name string, right int) (*Service, error) { if right == nil { right =windows.SERVICE_ALL_ACCESS } h, err := windows.OpenService(m.Handle, syscall.StringToUTF16Ptr(name), right) if err != nil { return nil, err } return &Service{Name: name, Handle: h}, nil }

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jun 2, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jun 2, 2023
@mknyszek mknyszek added OS-Windows NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 2, 2023
@mknyszek
Copy link
Contributor

mknyszek commented Jun 2, 2023

That would unfortunately be compatibility-breaking. If you'd like to suggest a new API, that's fine, but we'd need someone more familiar with Windows to chime in.

Also, generally speaking we don't do continuations of frozen issues like this. Please update your original post with relevant context and details from #48777 as if this were a new issue. Sorry for the inconvenience. Thanks!

@mknyszek
Copy link
Contributor

mknyszek commented Jun 7, 2023

We could add a new function that takes "right," but seeing as how the implementation of OpenService is using exported APIs already, I don't really see a need to do anything here. As @alexbrainman said in the last issue, copying out that code is totally reasonable here. Closing.

@mknyszek mknyszek closed this as completed Jun 7, 2023
@mknyszek mknyszek closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Projects
None yet
Development

No branches or pull requests

3 participants