I have an application that will only stop/start services if it is run as an Administrator.
Is it possible to stop/start services from an application that is running as a normal user? Surely it is? I have tried all different combinations of access flags in my ::OpenService() call but I cannot get a valid handle. If I use SERVICE_INTERROGATE I get a valid handle returned but then I can't call ::ControlService() to stop/start the service. If I specify SERVICE_PAUSE_CONTROL, I receive a NULL handle.
I do actually own the service application. Is there something I need to do to the service application itself to alter the security requirements?
Update: I have found that I can use the code below to change the security settings for my service. The only problem now is that I need to tell if the specific user name. Does anybody know if there is a way that BuildExplicitAccessWithName() can grant access to ALL users?
BuildExplicitAccessWithName(&ea, TEXT("GUEST"), SERVICE_START | SERVICE_STOP | READ_CONTROL | DELETE, SET_ACCESS, NO_INHERITANCE);
Cheers Paul