Fortunately, we found a blog post where the author simply created a Mutex and give EVERYONE full rights on the Mutex which is basically the same as a NULL DACL: http://rdn-consulting.com/blog/2007/09/14/more-on-using-a-named-mutex-in-vista/
We changed the code a little bit and here is the result:
//Original Code: http://rdn-consulting.com/blog/2007/08/20/kernel-object-namespace-and-vista/
public static Mutex Create(string Name)
{
bool bTrash;
return Create(Name, out bTrash);
}
public static Mutex Create(string Name, out bool MutexWasCreated)
{
//Always use global scope
string name = @"Global\" + Name;
MutexAccessRule secRule = new MutexAccessRule(
new SecurityIdentifier(WellKnownSidType.WorldSid, null),
MutexRights.FullControl, AccessControlType.Allow);
sec.AddAccessRule(secRule);
bool mutexWasCreated;
Mutex m = new Mutex(false, name, out mutexWasCreated, sec);
MutexWasCreated = mutexWasCreated;
return m;
}
No comments:
Post a Comment