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); |
logger.VerboseDebug.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); |
logger.VerboseDebug.WriteLine(" adding process {0} ", proc_name); |
46 |
} |
} |
47 |
catch (Exception ex) |
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); |
logger.VerboseDebug.WriteLine(" not adding process {0} because it thew an exception [{1}]", proc_name, ex.Message); |
51 |
continue; |
continue; |
52 |
} |
} |
53 |
proc_list.Add(container); |
proc_list.Add(container); |