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