From ccdfd8cfe59f28a7fd53dbff91818dfcc8693ca3 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 6 Nov 2018 02:47:31 -0600 Subject: [PATCH] Purge HidGuardian utilities --- DS4Windows/DS4Control/ControlService.cs | 52 -------- DS4Windows/DS4Forms/DS4Form.Designer.cs | 30 ----- DS4Windows/DS4Forms/DS4Form.cs | 38 ------ DS4Windows/DS4Forms/DS4Form.resx | 168 ++++++------------------ DS4Windows/Program.cs | 3 - 5 files changed, 42 insertions(+), 249 deletions(-) diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index 855bdf9..ce6ce92 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -293,58 +293,6 @@ namespace DS4Windows } } - public void ScanPurgeHidGuard() - { - RegistryKey tempkey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist"); - string[] subkeys = null; - if (tempkey != null) - { - subkeys = tempkey.GetSubKeyNames(); - } - else - { - subkeys = new string[0]; - } - - 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 - { - Registry.LocalMachine.CreateSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist\" + System.Diagnostics.Process.GetCurrentProcess().Id); - } - catch { } - } - - public void removeHidGuardKey() - { - try - { - Registry.LocalMachine.DeleteSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist\" + System.Diagnostics.Process.GetCurrentProcess().Id); - } - catch { } - } - public bool PlugXInputController(int index) { int xinputIndex = x360Bus.FirstController + index; diff --git a/DS4Windows/DS4Forms/DS4Form.Designer.cs b/DS4Windows/DS4Forms/DS4Form.Designer.cs index 607920c..97c9da5 100644 --- a/DS4Windows/DS4Forms/DS4Form.Designer.cs +++ b/DS4Windows/DS4Forms/DS4Form.Designer.cs @@ -165,9 +165,6 @@ this.linkUninstall = new System.Windows.Forms.LinkLabel(); this.linkSetup = new System.Windows.Forms.LinkLabel(); this.lLBUpdate = new System.Windows.Forms.LinkLabel(); - this.hidGuardWhiteList = new System.Windows.Forms.LinkLabel(); - this.clrHidGuardWlistLinkLabel = new System.Windows.Forms.LinkLabel(); - this.hidGuardRegLinkLabel = new System.Windows.Forms.LinkLabel(); this.tabLog = new System.Windows.Forms.TabPage(); this.panel3 = new System.Windows.Forms.Panel(); this.exportLogTxtBtn = new System.Windows.Forms.Button(); @@ -1272,9 +1269,6 @@ this.flowLayoutPanel1.Controls.Add(this.linkUninstall); this.flowLayoutPanel1.Controls.Add(this.linkSetup); this.flowLayoutPanel1.Controls.Add(this.lLBUpdate); - this.flowLayoutPanel1.Controls.Add(this.hidGuardWhiteList); - this.flowLayoutPanel1.Controls.Add(this.clrHidGuardWlistLinkLabel); - this.flowLayoutPanel1.Controls.Add(this.hidGuardRegLinkLabel); resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); this.flowLayoutPanel1.ForeColor = System.Drawing.SystemColors.ControlText; this.flowLayoutPanel1.Name = "flowLayoutPanel1"; @@ -1314,27 +1308,6 @@ this.lLBUpdate.TabStop = true; this.lLBUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lLBUpdate_LinkClicked); // - // hidGuardWhiteList - // - resources.ApplyResources(this.hidGuardWhiteList, "hidGuardWhiteList"); - this.hidGuardWhiteList.Name = "hidGuardWhiteList"; - this.hidGuardWhiteList.TabStop = true; - this.hidGuardWhiteList.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.HidGuardWhiteList_LinkClicked); - // - // clrHidGuardWlistLinkLabel - // - resources.ApplyResources(this.clrHidGuardWlistLinkLabel, "clrHidGuardWlistLinkLabel"); - this.clrHidGuardWlistLinkLabel.Name = "clrHidGuardWlistLinkLabel"; - this.clrHidGuardWlistLinkLabel.TabStop = true; - this.clrHidGuardWlistLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.ClrHidGuardWlistLinkLabel_LinkClicked); - // - // hidGuardRegLinkLabel - // - resources.ApplyResources(this.hidGuardRegLinkLabel, "hidGuardRegLinkLabel"); - this.hidGuardRegLinkLabel.Name = "hidGuardRegLinkLabel"; - this.hidGuardRegLinkLabel.TabStop = true; - this.hidGuardRegLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.HidGuardRegLinkLabel_LinkClicked); - // // tabLog // this.tabLog.Controls.Add(this.lvDebug); @@ -1586,9 +1559,6 @@ private System.Windows.Forms.Button exportLogTxtBtn; private System.Windows.Forms.Button btnClear; private DS4Forms.LanguagePackComboBox languagePackComboBox1; - private System.Windows.Forms.LinkLabel hidGuardWhiteList; - private System.Windows.Forms.LinkLabel clrHidGuardWlistLinkLabel; - private System.Windows.Forms.LinkLabel hidGuardRegLinkLabel; private System.Windows.Forms.ToolStripMenuItem openProgramFolderToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripMenuItem disconToolStripMenuItem; diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index cd6ca62..f24e2ca 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -324,9 +324,6 @@ namespace DS4Windows uacPictureBox.Visible = true; new ToolTip().SetToolTip(uacPictureBox, Properties.Resources.UACTask); runStartTaskRadio.Enabled = false; - hidGuardWhiteList.Visible = false; - clrHidGuardWlistLinkLabel.Visible = false; - hidGuardRegLinkLabel.Visible = false; } else { @@ -2522,41 +2519,6 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question } } - private void HidGuardWhiteList_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - try - { - RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters"); - key.SetValue("AffectedDevices", Program.rootHub.affectedDevs.ToArray(), RegistryValueKind.MultiString); - AppLogger.LogToGui("Wrote HidGuardian Device List to Registry", false); - } - catch { } - } - - private void ClrHidGuardWlistLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - try - { - Registry.LocalMachine.DeleteSubKeyTree(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist"); - AppLogger.LogToGui("Cleared HidGuardian Whitelist", false); - Program.rootHub.CreateHidGuardKey(); - } - catch { } - } - - private void HidGuardRegLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - try - { - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Regedit"); - key.SetValue("LastKey", @"Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters", RegistryValueKind.String); - Process temp = new Process(); - temp.StartInfo.FileName = "regedit"; - temp.Start(); - } - catch { } - } - private void OpenProgramFolderToolStripMenuItem_Click(object sender, EventArgs e) { Process temp = new Process(); diff --git a/DS4Windows/DS4Forms/DS4Form.resx b/DS4Windows/DS4Forms/DS4Form.resx index a184f38..52ba56c 100644 --- a/DS4Windows/DS4Forms/DS4Form.resx +++ b/DS4Windows/DS4Forms/DS4Form.resx @@ -445,10 +445,10 @@ NoControl - 754, 89 + 750, 89 - 139, 22 + 143, 22 50 @@ -472,7 +472,7 @@ NoControl - 352, 34 + 349, 34 39, 20 @@ -574,7 +574,7 @@ NoControl - 714, 89 + 710, 89 34, 22 @@ -604,7 +604,7 @@ NoControl - 714, 117 + 710, 117 34, 22 @@ -703,7 +703,7 @@ None - 597, 33 + 593, 33 111, 21 @@ -730,7 +730,7 @@ NoControl - 714, 61 + 710, 61 34, 22 @@ -757,7 +757,7 @@ None - 597, 61 + 593, 61 111, 21 @@ -781,7 +781,7 @@ None - 597, 89 + 593, 89 111, 21 @@ -808,7 +808,7 @@ NoControl - 714, 33 + 710, 33 34, 22 @@ -835,7 +835,7 @@ None - 597, 117 + 593, 117 111, 21 @@ -868,7 +868,7 @@ NoControl - 598, 7 + 594, 7 109, 15 @@ -940,7 +940,7 @@ NoControl - 348, 7 + 345, 7 47, 15 @@ -976,7 +976,7 @@ NoControl - 443, 7 + 439, 7 51, 15 @@ -1012,7 +1012,7 @@ NoControl - 449, 36 + 445, 36 39, 15 @@ -1048,7 +1048,7 @@ NoControl - 449, 64 + 445, 64 39, 15 @@ -1084,7 +1084,7 @@ NoControl - 449, 92 + 445, 92 39, 15 @@ -1120,7 +1120,7 @@ NoControl - 449, 120 + 445, 120 39, 15 @@ -1150,7 +1150,7 @@ NoControl - 352, 62 + 349, 62 39, 20 @@ -1180,7 +1180,7 @@ NoControl - 352, 90 + 349, 90 39, 20 @@ -1210,7 +1210,7 @@ NoControl - 352, 118 + 349, 118 39, 20 @@ -1243,10 +1243,10 @@ NoControl - 754, 33 + 750, 33 - 139, 22 + 143, 22 50 @@ -1273,10 +1273,10 @@ NoControl - 754, 61 + 750, 61 - 139, 22 + 143, 22 51 @@ -1303,10 +1303,10 @@ NoControl - 754, 117 + 750, 117 - 139, 22 + 143, 22 52 @@ -1336,7 +1336,7 @@ NoControl - 520, 0 + 516, 0 67, 30 @@ -1375,7 +1375,7 @@ NoControl - 546, 37 + 542, 37 15, 14 @@ -1408,7 +1408,7 @@ NoControl - 546, 65 + 542, 65 15, 14 @@ -1441,7 +1441,7 @@ NoControl - 546, 93 + 542, 93 15, 14 @@ -1474,7 +1474,7 @@ NoControl - 546, 121 + 542, 121 15, 14 @@ -1522,7 +1522,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="lbLinkProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Percent,62.29144,Percent,20.02225,Percent,17.68632,Absolute,80,AutoSize,0,AutoSize,0,Absolute,144" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="lbLinkProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Percent,62.29144,Percent,20.02225,Percent,17.68632,Absolute,80,AutoSize,0,AutoSize,0,Absolute,147" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> Fill @@ -2814,6 +2814,9 @@ True + + NoControl + 118, 2 @@ -2841,6 +2844,9 @@ True + + NoControl + 3, 1 @@ -2929,7 +2935,7 @@ languagePackComboBox1 - DS4Windows.DS4Forms.LanguagePackComboBox, DS4Windows, Version=1.5.13.0, Culture=neutral, PublicKeyToken=null + DS4Windows.DS4Forms.LanguagePackComboBox, DS4Windows, Version=1.5.14.0, Culture=neutral, PublicKeyToken=null fLPSettings @@ -3093,96 +3099,6 @@ 4 - - True - - - NoControl - - - 7, 69 - - - 150, 13 - - - 53 - - - Write HidGuardian Device List - - - hidGuardWhiteList - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 5 - - - True - - - NoControl - - - 7, 82 - - - 141, 13 - - - 54 - - - Clear HidGuardian Whitelists - - - clrHidGuardWlistLinkLabel - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 6 - - - True - - - NoControl - - - 7, 95 - - - 106, 13 - - - 55 - - - HidGuardian Regedit - - - hidGuardRegLinkLabel - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 7 - TopDown @@ -3193,7 +3109,7 @@ 4, 4, 4, 4 - 204, 158 + 164, 112 56 @@ -3736,7 +3652,7 @@ advColorDialog - DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.5.13.0, Culture=neutral, PublicKeyToken=null + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.5.14.0, Culture=neutral, PublicKeyToken=null DS4Form diff --git a/DS4Windows/Program.cs b/DS4Windows/Program.cs index 39416bb..ee59300 100644 --- a/DS4Windows/Program.cs +++ b/DS4Windows/Program.cs @@ -100,13 +100,10 @@ namespace DS4Windows //if (mutex.WaitOne(TimeSpan.Zero, true)) //{ createControlService(); - rootHub.ScanPurgeHidGuard(); - rootHub.CreateHidGuardKey(); //rootHub = new ControlService(); Application.EnableVisualStyles(); ds4form = new DS4Form(args); Application.Run(ds4form); - rootHub.removeHidGuardKey(); //mutex.ReleaseMutex(); //}