This commit is contained in:
PhyxionNL
2025-09-27 12:54:24 +02:00
parent 3023089017
commit 79a043e5bf
3 changed files with 25 additions and 3 deletions
+11 -1
View File
@@ -1,4 +1,6 @@
using System;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Threading;
namespace LibreHardwareMonitor.Hardware;
@@ -24,7 +26,15 @@ internal static class Mutexes
{
try
{
return new Mutex(false, name);
var worldRule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), MutexRights.FullControl, AccessControlType.Allow);
var mutexSecurity = new MutexSecurity();
mutexSecurity.AddAccessRule(worldRule);
#if NETFRAMEWORK
return new Mutex(false, name, out _, mutexSecurity);
#else
return MutexAcl.Create(false, name, out _, mutexSecurity);
#endif
}
catch (UnauthorizedAccessException)
{