increase chance of accurate error messages
This commit is contained in:
1 parent
7f2451aa76
commit
01f5cb6c9e
3 files changed
+24
-11
No files matched your search
@@ -63,14 +63,23 @@ JNIEXPORT jboolean SIGAR_JNI(win32_Service_CloseServiceHandle)
|
||||
return CloseServiceHandle((SC_HANDLE)handle);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean SIGAR_JNI(win32_Service_ControlService)
|
||||
JNIEXPORT jint SIGAR_JNI(win32_Service_ControlService)
|
||||
(JNIEnv *, jclass, jlong handle, jint control)
|
||||
{
|
||||
BOOL retval;
|
||||
SERVICE_STATUS status;
|
||||
if (control == 0) {
|
||||
return StartService((SC_HANDLE)handle, 0, NULL);
|
||||
retval = StartService((SC_HANDLE)handle, 0, NULL);
|
||||
}
|
||||
else {
|
||||
retval = ControlService((SC_HANDLE)handle, control, &status);
|
||||
}
|
||||
if (retval) {
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
else {
|
||||
return GetLastError();
|
||||
}
|
||||
return ControlService((SC_HANDLE)handle, control, &status);
|
||||
}
|
||||
|
||||
JNIEXPORT jlong SIGAR_JNI(win32_Service_CreateService)
|
||||
|
||||
Reference in new issue
Block a user