throw exception if DeleteService fails

This commit is contained in:
Doug MacEachern 2005-06-26 22:07:58 +00:00
parent 1ce84e00fc
commit 284479c5ea
2 changed files with 4 additions and 2 deletions

View File

@ -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)

View File

@ -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;