You are not logged in.
Pages: 1
When TServiceController.CreateOpenService succeeds at opening the SC Manager, but fails at OpenService, it ends up in a state with FSCHandle <> 0 and FHandle = 0
However TServiceController.GetState then proceeds to report that as ssNotInstalled, when it should be ssErrorRetrievingState, or some more detailed information should be preserved.
https://msdn.microsoft.com/en-us/librar … s.85).aspx
Lists the cases when OpenService can return a null handle, among which ERROR_ACCESS_DENIED and ERROR_INVALID_NAME do not correspond to a service not installed.
Offline
Please try http://synopse.info/fossil/info/b33f84b62b
Offline
This improves things for insufficient rights, but seemed to fail reporting when the service really was not installed.
I have gone the extra mile here by introducing a TServiceStateEx with an ssAccessDenied element, and checking the GetLastError after calling CreateOpenService.
Offline
Pages: 1