5 |
using RomCheater.PluginFramework.Interfaces; |
using RomCheater.PluginFramework.Interfaces; |
6 |
using System.Diagnostics; |
using System.Diagnostics; |
7 |
using libWin32.Win32.Threading; |
using libWin32.Win32.Threading; |
8 |
|
using RomCheater.Logging; |
9 |
|
|
10 |
namespace RomCheater.PluginFramework.Core |
namespace RomCheater.PluginFramework.Core |
11 |
{ |
{ |
19 |
|
|
20 |
public override void Reload() |
public override void Reload() |
21 |
{ |
{ |
22 |
|
logger.Debug.WriteLine(" Loading config for {0}...", this.ToString()); |
23 |
init(); |
init(); |
24 |
|
logger.Debug.WriteLine(" Loaded config for {0}.", this.ToString()); |
25 |
} |
} |
26 |
private void init() |
private void init() |
27 |
{ |
{ |
35 |
string proc_user = ThreadControl.GetProcessOwner(proc.Handle, out isSystem).ToLower(); |
string proc_user = ThreadControl.GetProcessOwner(proc.Handle, out isSystem).ToLower(); |
36 |
if (isSystem) |
if (isSystem) |
37 |
{ |
{ |
38 |
|
logger.Debug.WriteLine(" not adding process {0} because it is a system process", proc_name); |
39 |
continue; |
continue; |
40 |
} |
} |
41 |
ProcContainer container = null; |
ProcContainer container = null; |
42 |
try |
try |
43 |
{ |
{ |
44 |
container = new ProcContainer(proc); |
container = new ProcContainer(proc); |
45 |
|
logger.Debug.WriteLine(" adding process {0} ", proc_name); |
46 |
} |
} |
47 |
catch (Exception) |
catch (Exception ex) |
48 |
{ |
{ |
49 |
throw; |
//throw; |
50 |
|
logger.Debug.WriteLine(" not adding process {0} because it thew an exception [{1}]", proc_name, ex.Message); |
51 |
|
continue; |
52 |
} |
} |
53 |
proc_list.Add(container); |
proc_list.Add(container); |
54 |
} |
} |