From de5e9861dd813f0850d98269a4e695f5904805bb Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 25 Jun 2005 23:21:00 +0000 Subject: [PATCH] add getConfig method --- .../src/net/hyperic/sigar/win32/Service.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/net/hyperic/sigar/win32/Service.java b/bindings/java/src/net/hyperic/sigar/win32/Service.java index 1a43f1dd..2ddef143 100644 --- a/bindings/java/src/net/hyperic/sigar/win32/Service.java +++ b/bindings/java/src/net/hyperic/sigar/win32/Service.java @@ -282,6 +282,14 @@ public class Service extends Win32Bindings implements java.io.Serializable Service.throwLastErrorException(); } + public ServiceConfig getConfig() throws Win32Exception { + ServiceConfig config = new ServiceConfig(); + if (!QueryServiceConfig(this.m_hService, config)) { + Service.throwLastErrorException(); + } + return config; + } + private static final void throwLastErrorException() throws Win32Exception { @@ -318,10 +326,18 @@ public class Service extends Win32Bindings implements java.io.Serializable private static final native boolean StartService(long handle); private static final native boolean StopService(long handle); + private static native boolean QueryServiceConfig(long handle, + ServiceConfig config); + public static void main(String[] args) throws Exception { List services = getServiceNames(); for (int i=0; i