From 284479c5ea4a632f06e0fe45649185b40cb5b488 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 26 Jun 2005 22:07:58 +0000 Subject: [PATCH] throw exception if DeleteService fails --- bindings/java/src/jni/win32/service.cpp | 4 +++- bindings/java/src/net/hyperic/sigar/win32/Service.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bindings/java/src/jni/win32/service.cpp b/bindings/java/src/jni/win32/service.cpp index e5b72772..89f35443 100644 --- a/bindings/java/src/jni/win32/service.cpp +++ b/bindings/java/src/jni/win32/service.cpp @@ -166,7 +166,9 @@ JNIEXPORT jlong SIGAR_JNI(win32_Service_CreateService) JNIEXPORT jboolean SIGAR_JNI(win32_Service_DeleteService) (JNIEnv *env, jclass, jlong handle) { - return DeleteService((SC_HANDLE)handle); + if (!DeleteService((SC_HANDLE)handle)) { + win32_throw_last_error(env); + } } JNIEXPORT jlong SIGAR_JNI(win32_Service_OpenSCManager) diff --git a/bindings/java/src/net/hyperic/sigar/win32/Service.java b/bindings/java/src/net/hyperic/sigar/win32/Service.java index b06c4c50..b1d3da4a 100644 --- a/bindings/java/src/net/hyperic/sigar/win32/Service.java +++ b/bindings/java/src/net/hyperic/sigar/win32/Service.java @@ -280,7 +280,7 @@ public class Service extends Win32 { private static native void ControlService(long handle, int control) throws Win32Exception; - private static native boolean DeleteService(long handle); + private static native void DeleteService(long handle) throws Win32Exception; private static native long OpenSCManager(String machine, int access) throws Win32Exception;