Thanks for develop such a great tool for java native bindings.
However, I have found a issue in W32Service.stopService(). In my scenario, when I use W32Service.stopService() to stop one of my windows services, it throws Unable to stop service exception. Digging into the issue, I find that in my scenario, When Advapi32.INSTANCE.ControlService(handle, Winsvc.SERVICE_CONTROL_STOP, new Winsvc.SERVICE_STATUS()) is called, the dwCurrentState of the service is not changed to SERVICE_STOP_PENDING but still is SERVICE_RUNNING. So, the waitForNonPendingState() will return immediately and queryStatus().dwCurrentState != Winsvc.SERVICE_STOPPED will be true.
Therefore, the Unable to stop service excepiton will be throwed.
My System is Windows 8.1.
- Version of JNA and related jars: 4.4.0
- oracle jdk 1.8.0_121
- Windows 8.1
- Intel64 Family 6 Model 61 Stepping 4 GenuineIntel ~1601 Mhz, JVM 32bit
- Complete description of the problem(see the above)
- Steps to reproduce ( see the above )
Thanks for develop such a great tool for java native bindings.
However, I have found a issue in W32Service.stopService(). In my scenario, when I use W32Service.stopService() to stop one of my windows services, it throws Unable to stop service exception. Digging into the issue, I find that in my scenario, When Advapi32.INSTANCE.ControlService(handle, Winsvc.SERVICE_CONTROL_STOP, new Winsvc.SERVICE_STATUS()) is called, the dwCurrentState of the service is not changed to SERVICE_STOP_PENDING but still is SERVICE_RUNNING. So, the waitForNonPendingState() will return immediately and queryStatus().dwCurrentState != Winsvc.SERVICE_STOPPED will be true.
Therefore, the Unable to stop service excepiton will be throwed.
My System is Windows 8.1.