mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-12 00:09:11 +01:00
Added placeholder routine to purge old HidGuardian whitelist entries.
Have not decided whether this is truly needed so it is not used
This commit is contained in:
parent
f44cc21688
commit
bf9f476be3
@ -7,7 +7,8 @@ using System.Media;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using static DS4Windows.Global;
|
using static DS4Windows.Global;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Registry = Microsoft.Win32.Registry;
|
using System.Diagnostics;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace DS4Windows
|
namespace DS4Windows
|
||||||
{
|
{
|
||||||
@ -83,7 +84,32 @@ namespace DS4Windows
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createHidGuardKey()
|
public void ScanPurgeHidGuard()
|
||||||
|
{
|
||||||
|
RegistryKey tempkey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist");
|
||||||
|
string[] subkeys = tempkey.GetSubKeyNames();
|
||||||
|
bool processExists = false;
|
||||||
|
for (int ind = 0, arlen = subkeys.Length; ind < arlen; ind++)
|
||||||
|
{
|
||||||
|
processExists = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Process.GetProcessById(Convert.ToInt32(subkeys[ind]));
|
||||||
|
}
|
||||||
|
catch { processExists = false; }
|
||||||
|
|
||||||
|
if (!processExists)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Registry.LocalMachine.DeleteSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist\" + subkeys[ind]);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateHidGuardKey()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -2463,7 +2463,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
|||||||
{
|
{
|
||||||
Registry.LocalMachine.DeleteSubKeyTree(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist");
|
Registry.LocalMachine.DeleteSubKeyTree(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist");
|
||||||
Log.LogToGui("Cleared HidGuardian Whitelist", false);
|
Log.LogToGui("Cleared HidGuardian Whitelist", false);
|
||||||
Program.rootHub.createHidGuardKey();
|
Program.rootHub.CreateHidGuardKey();
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,8 @@ namespace DS4Windows
|
|||||||
//if (mutex.WaitOne(TimeSpan.Zero, true))
|
//if (mutex.WaitOne(TimeSpan.Zero, true))
|
||||||
//{
|
//{
|
||||||
createControlService();
|
createControlService();
|
||||||
rootHub.createHidGuardKey();
|
//rootHub.ScanPurgeHidGuard();
|
||||||
|
rootHub.CreateHidGuardKey();
|
||||||
//rootHub = new ControlService();
|
//rootHub = new ControlService();
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.Run(new DS4Form(args));
|
Application.Run(new DS4Form(args));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user