Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
System.Threading.Mutex vs CreateMutex
Message
From
15/04/2003 15:20:02
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
System.Threading.Mutex vs CreateMutex
Miscellaneous
Thread ID:
00777967
Message ID:
00777967
Views:
45
Does anyone have an inkling of how to go about setting security on a System.Threading.Mutex object? From the .NET Framework Developer’s Guide: "The Mutex class corresponds to a Win32 CreateMutex". The win32 call takes 3 parameters, one of which is a pointer to a security_attributes structure. If NULL is passed in, you get the system default security for the mutex.

Here's the scenario:
Say a global (named) mutex is created by a web service running under the auspices of IIS. Since IIS is a service, it excludes by default all but the local system for ALL_ACCESS security to the mutex. The doc also states that all calls to CreateMutex request MUTEX_ALL_ACCESS security to the object. Now I've got an application that tries to acquire the mutex by creating it. It fails with an "access denied" error. I'm assuming that the app does not have the same security permissions as a service.

Solution, use the win32 CreateMutex call within the service or set the appropriate security attributes on the .NET mutex object.

Any ideas?

- Paul Corriveau
Reply
Map
View

Click here to load this message in the networking platform