Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
System.Threading.Mutex vs CreateMutex
Message
De
15/04/2003 15:20:02
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
System.Threading.Mutex vs CreateMutex
Divers
Thread ID:
00777967
Message ID:
00777967
Vues:
46
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
Répondre
Fil
Voir

Click here to load this message in the networking platform