throw exception if DeleteService fails
This commit is contained in:
parent
1ce84e00fc
commit
284479c5ea
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue