Mutex and user account
-
Hi all! I have Windows Services and a WPF application that should share a common resource (config file). To make sure that no application is reading while another is writing I'm locking this resource with a system-wide Mutex. It doesn't work. The Mutex doesn't seem to be unique. Can it be that a Mutex is not unique if a Windows Service (running under the System account) and an WPF application (running under the user account) try to create a Mutex? thanks, MMartin
-
Hi all! I have Windows Services and a WPF application that should share a common resource (config file). To make sure that no application is reading while another is writing I'm locking this resource with a system-wide Mutex. It doesn't work. The Mutex doesn't seem to be unique. Can it be that a Mutex is not unique if a Windows Service (running under the System account) and an WPF application (running under the user account) try to create a Mutex? thanks, MMartin
-
You need to use a named mutex for it to be system wide.
--- single minded; short sighted; long gone;
Thanks, but "I'm locking this resource with a system-wide Mutex" (=named Mutex) MMartin
-
Hi all! I have Windows Services and a WPF application that should share a common resource (config file). To make sure that no application is reading while another is writing I'm locking this resource with a system-wide Mutex. It doesn't work. The Mutex doesn't seem to be unique. Can it be that a Mutex is not unique if a Windows Service (running under the System account) and an WPF application (running under the user account) try to create a Mutex? thanks, MMartin
-
Ok, I'm not certain as to why you would be doing it that way. Have you checked the error codes or exception codes that are being generated? Is your security descriptor set up properly?
Phil
Hi, we found out that the Windows Services created a Mutex named: \BaseNamedObjects\Map_ConfigFile_Mutex while the WPF-Application (Admin = Icon in System Tray with hidden Window) creates: \Sessions\1\BaseNamedObjects\Map_ConfigFile_Mutex Any idea how I can solve this issue? Thanks, MMartin
-
Ok, I'm not certain as to why you would be doing it that way. Have you checked the error codes or exception codes that are being generated? Is your security descriptor set up properly?
Phil
Problem solved: "[...] The \Sessions\1\... is created by Terminal service session (or Fast User Switching which uses terminal services). To make a Mutex global across all sessions prefix the name with 'Global\' [...]" MMartin