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

proposal: x/sys/windows/svc/mgr: Add EnumDependentServices method to Service struct #56766

sebsoto opened this issue Nov 16, 2022 · 3 comments


Copy link

sebsoto commented Nov 16, 2022

The mgr package does not provide a way to interact with the EnumDependentServicesW Windows API call. Usage of this call allows a user to list all Windows services which are dependent upon a given service. Without this API call, a user would have to iterate through each service on the system, and check if the given service is listed in each service's dependencies list.

This functionality being missing is called out in a TODO within the code.

I propose:

  1. EnumDependentServicesW is added to the list of syscalls in, causing it to be generated and added to
  2. A new struct ENUM_SERVICE_STATUSW is added to service.go, this enables the use of the data returned by EnumDependentServicesW.
  3. A new type is added:
type Activity uint32
const (
	Active       = Activity(windows.SERVICE_ACTIVE)
	Inactive     = Activity(windows.SERVICE_INACTIVE)
	All          = Activity(windows.SERVICE_ALL)
  1. Service is given a new method ListDependentServices which will return a slice of strings, listing all services dependent on the service. func (s *Service) ListDependentServices(serviceState Activity) ([]string, error)
@gopherbot gopherbot added this to the Proposal milestone Nov 16, 2022
Copy link

CC @golang/windows

Copy link

Change mentions this issue: windows: add Service.ListDependentServices

Copy link


I just reviewed your CL. Let's continue our conversation there.

Thank you.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Status: Incoming

No branches or pull requests

4 participants