1
0

Code clean-up

This commit is contained in:
Benjamin Höglinger-Stelzer 2018-11-11 19:22:48 +01:00
parent dfed4cb19d
commit 2d23832f9c

View File

@ -3,8 +3,14 @@ using Microsoft.Win32;
namespace DerpingDrivers.Util namespace DerpingDrivers.Util
{ {
/// <summary>
/// Utility class for interaction with Code Integrity Policy settings.
/// </summary>
public static class CodeIntegrityPolicyHelper public static class CodeIntegrityPolicyHelper
{ {
/// <summary>
/// Gets or sets whether the kernel allows loading of "traditional" cross-signed drivers.
/// </summary>
public static bool WhqlDeveloperTestMode public static bool WhqlDeveloperTestMode
{ {
get get
@ -12,9 +18,7 @@ namespace DerpingDrivers.Util
var value = (int?) Registry.GetValue(@"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CI\Policy", var value = (int?) Registry.GetValue(@"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CI\Policy",
"WhqlDeveloperTestMode", null); "WhqlDeveloperTestMode", null);
if (value == null) return false; return (value.HasValue && value.Value > 0);
return value > 0;
} }
set => Registry.SetValue(@"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CI\Policy", set => Registry.SetValue(@"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CI\Policy",