I am using mutex to synchronize two process. Mutex is getting created by service process. But when client tries to access that mutex he gets Unauthorizedaccessexception. The user account has create global object rights This happens in few machines running windows 7 but not reproducible on other windows 7 machine. What could be the reason?
Following is the code for creation of global mutex
bool gCreated;
Mutex syncMutex = new Mutex(true, "Global\\SWDBOject", out gCreated);
var allowEveryoneRule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), MutexRights.FullControl, AccessControlType.Allow);
var securitySettings = new MutexSecurity();
securitySettings.AddAccessRule(allowEveryoneRule);
syncMutex.SetAccessControl(securitySettings);