Closed bluebaroncanada closed 3 years ago
Hi @bluebaroncanada
I'm not following. Both places where DeleteService is called will immediately call CloseServiceHandle(hService), whether DeleteService succeeds or not.
Code appears to always close hService whether DeleteService succeeds or not.
You need to close the handle that you have open to the remote scm service that you called with OpenService() while deleting the service. If a failure occurs when you DeleteService, you should close the handle before waiting. If you hang onto that handle, nothing will be able to delete the service.