Windows kernel api for service

Can I find out the status of the service in the driver?
As in the user space api OpenSCManager, etc.

Probably not, but what if there is some kind of API?

Not really. Why do you need to know the ‘status of a service’?

This is my service. I need to perform some operations if the service is “Running”.

I think the easiest way would be to create a named mutex in the service and check if it exists

The mutex will continue to exist if the service dies. Why don’t you have the service make a call into your driver to register itself? You’ll get a CLOSE call if the process dies.

Have the service open a HANDLE to your device