diff --git a/LibreHardwareMonitorLib/Hardware/KernelDriver.cs b/LibreHardwareMonitorLib/Hardware/KernelDriver.cs index 42e19ce..62d954c 100644 --- a/LibreHardwareMonitorLib/Hardware/KernelDriver.cs +++ b/LibreHardwareMonitorLib/Hardware/KernelDriver.cs @@ -78,7 +78,7 @@ namespace LibreHardwareMonitor.Hardware AdvApi32.CloseServiceHandle(service); AdvApi32.CloseServiceHandle(manager); -#if !NETSTANDARD2_0 +#if NETFRAMEWORK try { // restrict the driver access to system (SY) and builtin admins (BA) diff --git a/LibreHardwareMonitorLib/Hardware/Ring0.cs b/LibreHardwareMonitorLib/Hardware/Ring0.cs index bde4a80..263d29f 100644 --- a/LibreHardwareMonitorLib/Hardware/Ring0.cs +++ b/LibreHardwareMonitorLib/Hardware/Ring0.cs @@ -1,7 +1,7 @@ // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. // Copyright (C) LibreHardwareMonitor and Contributors. -// Partial Copyright (C) Michael Möller and Contributors. +// Partial Copyright (C) Michael Möller and Contributors. // All Rights Reserved. using System; @@ -220,25 +220,25 @@ namespace LibreHardwareMonitor.Hardware try { -#if NETSTANDARD2_0 - _isaBusMutex = new Mutex(false, isaMutexName); -#else +#if NETFRAMEWORK //mutex permissions set to everyone to allow other software to access the hardware //otherwise other monitoring software cant access var allowEveryoneRule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), MutexRights.FullControl, AccessControlType.Allow); var securitySettings = new MutexSecurity(); securitySettings.AddAccessRule(allowEveryoneRule); _isaBusMutex = new Mutex(false, isaMutexName, out _, securitySettings); +#else + _isaBusMutex = new Mutex(false, isaMutexName); #endif } catch (UnauthorizedAccessException) { try { -#if NETSTANDARD2_0 - _isaBusMutex = Mutex.OpenExisting(isaMutexName); -#else +#if NETFRAMEWORK _isaBusMutex = Mutex.OpenExisting(isaMutexName, MutexRights.Synchronize); +#else + _isaBusMutex = Mutex.OpenExisting(isaMutexName); #endif } catch @@ -255,10 +255,10 @@ namespace LibreHardwareMonitor.Hardware { try { -#if NETSTANDARD2_0 - _pciBusMutex = Mutex.OpenExisting(pciMutexName); -#else +#if NETFRAMEWORK _pciBusMutex = Mutex.OpenExisting(pciMutexName, MutexRights.Synchronize); +#else + _pciBusMutex = Mutex.OpenExisting(pciMutexName); #endif } catch diff --git a/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj b/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj index 61e9d6c..ff0a0a0 100644 --- a/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj +++ b/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj @@ -1,6 +1,6 @@  - net452;netstandard2.0 + net452;netstandard2.0;net5.0 LibreHardwareMonitorLib LibreHardwareMonitor true @@ -26,12 +26,13 @@ - - 4.7.0 - - - 4.7.0 - + + + + + + +