use of com.sun.jna.platform.win32.Winsvc.SC_HANDLE in project symmetric-ds by JumpMind.
the class WindowsService method isInstalled.
@Override
public boolean isInstalled() {
Advapi32 advapi = Advapi32.INSTANCE;
boolean isInstalled = false;
SC_HANDLE manager = advapi.OpenSCManager(null, null, Winsvc.SC_MANAGER_ENUMERATE_SERVICE);
if (manager == null) {
throwException("OpenSCManager");
} else {
SC_HANDLE service = advapi.OpenService(manager, config.getName(), Winsvc.SERVICE_QUERY_STATUS);
isInstalled = (service != null);
closeServiceHandle(service);
closeServiceHandle(manager);
}
return isInstalled;
}
Aggregations