|
|
@@ -65,6 +65,7 @@ var (
|
|
|
procChangeServiceConfig2W = modadvapi32.NewProc("ChangeServiceConfig2W")
|
|
|
procQueryServiceConfig2W = modadvapi32.NewProc("QueryServiceConfig2W")
|
|
|
procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW")
|
|
|
+ procQueryServiceStatusEx = modadvapi32.NewProc("QueryServiceStatusEx")
|
|
|
procGetLastError = modkernel32.NewProc("GetLastError")
|
|
|
procLoadLibraryW = modkernel32.NewProc("LoadLibraryW")
|
|
|
procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW")
|
|
|
@@ -472,6 +473,18 @@ func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serv
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) {
|
|
|
+ r1, _, e1 := syscall.Syscall6(procQueryServiceStatusEx.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0)
|
|
|
+ if r1 == 0 {
|
|
|
+ if e1 != 0 {
|
|
|
+ err = errnoErr(e1)
|
|
|
+ } else {
|
|
|
+ err = syscall.EINVAL
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func GetLastError() (lasterr error) {
|
|
|
r0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0)
|
|
|
if r0 != 0 {
|