github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/service/windows/zservice_windows.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Copyright 2014 Cloudbase Solutions SRL 3 // Licensed under the AGPLv3, see LICENCE file for details. 4 5 // MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT 6 7 package windows 8 9 import "unsafe" 10 import "syscall" 11 import "golang.org/x/sys/windows" 12 13 var _ unsafe.Pointer 14 15 var ( 16 modadvapi32 = syscall.NewLazyDLL("advapi32.dll") 17 18 procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW") 19 ) 20 21 func enumServicesStatus(h windows.Handle, InfoLevel SC_ENUM_TYPE, dwServiceType uint32, dwServiceState uint32, lpServices uintptr, cbBufSize uint32, pcbBytesNeeded *uint32, lpServicesReturned *uint32, lpResumeHandle *uint32, pszGroupName *uint32) (err error) { 22 r1, _, e1 := syscall.Syscall12(procEnumServicesStatusExW.Addr(), 10, uintptr(h), uintptr(InfoLevel), uintptr(dwServiceType), uintptr(dwServiceState), uintptr(lpServices), uintptr(cbBufSize), uintptr(unsafe.Pointer(pcbBytesNeeded)), uintptr(unsafe.Pointer(lpServicesReturned)), uintptr(unsafe.Pointer(lpResumeHandle)), uintptr(unsafe.Pointer(pszGroupName)), 0, 0) 23 if r1 == 0 { 24 if e1 != 0 { 25 err = error(e1) 26 } else { 27 err = syscall.EINVAL 28 } 29 } 30 return 31 }