I have my own custom windows Service which I wish that every user either admin or non admin should be able to start/Stop or Query Status and its start up type. I am using ServiceManager to do this in C++ and it returns NULL on OpenService() if I am running in Non Admin mode. I want the handle to Service even in Non Admin mode.
I searched out over internet and could get that its not a good idea to allow non admins to change/Start or Stop services but i need to do this. I either don't want to make it complex to change the DACL of the Service as everything is perfectly working except this Admin and Non admin thing. There fore I wish for a simpler solution to make OpenService to return a Handle though the user is not an Admin.
Here is what I am trying to do
schService = OpenService(schSCManager, MyServicename, SERVICE_QUERY_STATUS | SERVICE_START);
The above statement returns NULL for Non admins and I don't wanna do that. Is there any other access modes that I can get for my requirement?
Thanks,