Reputation: 1772
I'm creating a named mutex in a windows service that needs to be accessible from regular applications. So far I create the mutex with a name similar to Global\< GUID >.
Right now I get an unauthorized access violation when I try to open the mutex from an application. How do I configure the mutex at creation time to allow access to any process in the system?
Upvotes: 4
Views: 3417
Reputation: 30883
You need to use Mutex.SetAccessControl Method to set the desired access rights on it. There is an example at What is a good pattern for using a Global Mutex in C#?
Upvotes: 7