Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparent tray icon, GPU total, AppID #1

Open
wants to merge 161 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
794a6ec
cleaned up project files (patch by xhmikosr)
Oct 21, 2013
020a636
* added Windows 8.1 version handling
Oct 21, 2013
d5256fc
fixed OS Context for Windows 8.1
Oct 21, 2013
9d1a698
fixed Run As preventing Windows 8 apps from starting
Oct 21, 2013
766b219
Website: updated FAQ page with latest SDK info
Oct 21, 2013
2746d6c
*fixed last commit
Oct 21, 2013
2a589a7
updated KProcessHacker for Windows 8.1
Oct 21, 2013
0ff302d
updated KPH scan data for Windows 8.1
Oct 21, 2013
da2abef
updated dates
Oct 21, 2013
22a32dd
updated KPH binaries
Oct 21, 2013
0a705e9
* fixed console host information for Windows 8.1
Oct 22, 2013
441f3f2
thread stack progress (part 1)
Oct 22, 2013
3d05a1f
Compress images a little more.
Oct 22, 2013
f87ec0a
thread stack progress (part 2)
Oct 22, 2013
fc4b65a
updated x86 release driver
Oct 22, 2013
3375a1e
updated HACKING.txt
Oct 22, 2013
62809f6
fixing CPU frequency on Windows 8.1
Oct 22, 2013
986cb05
Clean up project files.
Oct 22, 2013
5c49140
fixed IntelliSense warnings
Oct 23, 2013
774d37c
changed treenew selection behavior to match Windows 8 listview
Oct 24, 2013
1b7cc00
Plugins: Removed WindowsCodecs dependencies
Oct 24, 2013
5f58948
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@5489 21ef857c-…
Oct 24, 2013
775c39b
* fixed reflected processes not terminating on Windows 8.1
Oct 25, 2013
d50c815
fixed previous commit
Oct 25, 2013
f297001
fixed CPU frequency on Windows 8.1
Oct 25, 2013
d4974ac
KProcessHacker: bump to 2.7
Oct 25, 2013
2f908b2
Website: Added Windows 8.1 SDK information, updated FAQ anti-cheat co…
Oct 25, 2013
b46da71
*fixed last commit
Oct 25, 2013
f740e58
Run minify.bat.
Oct 26, 2013
2dcb4b6
Switch to vanilla normalize.css.
Oct 26, 2013
b7b4f27
Update moment.js to v2.2.1.
Oct 26, 2013
16c8c2d
Update .htaccess from html5 boilerplate 4.3.0.
Oct 26, 2013
03186cc
ExtendedServices: added new trigger data types
Oct 27, 2013
3a6150b
Website: Removed unused changelog.php
Oct 27, 2013
71b6ed2
Update moment.js to v2.4.0.
Oct 28, 2013
83b0134
Website: Re-added changelog.php with new Sourceforge URLs
Oct 28, 2013
c47e135
Website: fixed invalid link
Oct 28, 2013
92a3edc
Website: Initial v3 branch
Oct 28, 2013
3aae0d5
Websitev3: fixed scripts; updated jquery v1 to v2;
Oct 28, 2013
6a9ac8b
Websitev3: split about.php content
Oct 28, 2013
db57306
Websitev3: fixed changelog format; added menu for navigating pages (d…
Oct 29, 2013
6ac4fc6
Run tabspace
Oct 29, 2013
e198edc
* added signing scripts
Oct 30, 2013
e90b93a
KProcessHacker: removed obsolete code
Oct 30, 2013
70dfd5b
KProcessHacker: added signed drivers
Oct 30, 2013
8223afe
deleted file
Oct 30, 2013
5f67891
added timestamp option
Oct 30, 2013
77abb53
updated dobuildrelease.cmd
Oct 30, 2013
13a5671
fixed dorelease.cmd
Oct 30, 2013
fb4122b
sign files before including in installer
Oct 30, 2013
fcebb6c
fixed installer build order (again)
Oct 30, 2013
20d44ed
updated for 2.32
Oct 30, 2013
59ce979
ToolStatus: fixed Ctrl+K
Oct 30, 2013
900558c
updated changelogs
Oct 30, 2013
1d72665
updated for 2.32 (re-release)
Oct 30, 2013
134a874
WebsiteV2: removed driver signing from download page
Oct 30, 2013
92b14e1
fixed XP symbol provider bug
Oct 30, 2013
4c240ba
updated for 2.32 (2nd re-release)
Oct 30, 2013
d00a4ab
WebsiteV3: added plugins.php; updated nav menu;
Oct 31, 2013
cb473c7
WebsiteV3: updated plauins.php grid layout
Nov 1, 2013
104ddc5
* bump to 2.33
Nov 1, 2013
138149b
PluginsExtra: Added Wait Chain Traversal (WCT) plugin
Nov 2, 2013
37ab5a7
Plugins: removed unused code
Nov 2, 2013
c541885
updated ignore list
Nov 3, 2013
3443276
signatures for Windows 8 apps are now detected
Nov 3, 2013
3ea2c69
view digital signature information from process properties
Nov 3, 2013
9344c4e
fixed wrong dbghelp instance being used
Nov 3, 2013
cabef2d
added DPI Awareness column
Nov 3, 2013
35640b7
fixed memory bug
Nov 3, 2013
13ec21e
fixed memory leak
Nov 3, 2013
1606149
WebsiteV3: added privacy.php; added bootstrap icons; updated several …
Nov 3, 2013
c966f1b
* signature verification is now on by default
Nov 3, 2013
949916b
WebsiteV3: fixed Bootstrap CDN support; updated downloads.php
Nov 3, 2013
0c21620
ToolStatus: Fixed disabling searchbox
Nov 4, 2013
eeb58f1
Run minify.bat with clean-css 2.0.0 and the latest uglify-js.
Nov 5, 2013
b36c4c9
* moved file, key, process and thread handle properties to context menu
Nov 5, 2013
930b917
* added PhShellOpenKey2 to select a key in regedit even if regedit is…
Nov 5, 2013
9fa79f1
added file, key, process and thread handle properties to findobj window
Nov 6, 2013
9478ac7
set marquee on thread stack progress bar (which currently displays no…
Nov 7, 2013
b7a5968
ToolStatus: improved Options label consistency
Nov 10, 2013
0d42538
converted all annotations to SAL 2.0
Nov 10, 2013
bbc984d
updated HACKING.txt
Nov 10, 2013
c78171c
NetworkTools: fixed threading issue
Nov 10, 2013
5e87c8b
fixed debug information problems
Nov 10, 2013
8d9c1be
removed support for .NET plugins
Nov 10, 2013
ed95451
NetworkTools: fixed graph; fixed workqueue issue;
Nov 10, 2013
8a69adc
NetworkTools: fixed 6 of 8 memory leaks
Nov 10, 2013
ec4df3e
NetworkTools: fixed access violation
Nov 10, 2013
9a9f1da
* KProcessHacker: removed old code
Nov 13, 2013
36ceeb5
export PhSiSetColorsGraphDrawInfo
Nov 13, 2013
981ca0c
added NtReadFile to Analyze Wait for 64-bit
Nov 13, 2013
be12716
update start type and error control when opening service properties
Nov 13, 2013
ad44c2b
remove feedback cursor when starting phsvc
Nov 13, 2013
4f17da8
removed incorrect use of GetLastError
Nov 13, 2013
7edb6af
* added some concurrency SAL annotations and fixed some annotations
Nov 13, 2013
b6d3b1c
improved dbghelp finding code
Nov 14, 2013
99f2e80
allow elevation when performing actions on multiple processes/threads…
Nov 14, 2013
3abbaf2
NetworkTools: bump to 1.4; updated changelog; fixed various window is…
Nov 14, 2013
5836d71
NetworkTools: fixed two OemString leaks
Nov 14, 2013
67d688b
WebsiteV3: sync fixes
Nov 14, 2013
bd809f8
use wWinMain instead of WinMain
Nov 14, 2013
2e05005
NetworkTools: fixed thread leak; removed redundant error logging;
Nov 14, 2013
902e91c
OnlineChecks: fixed crash; fixed memory leak;
Nov 14, 2013
c47fb5a
peview: added signature verification
Nov 17, 2013
4ccf032
use PWCHAR instead of PWSTR for strings that are not null-terminated
Nov 17, 2013
ea3ff5f
peview: don't use PH_VERIFY_PREVENT_NETWORK_ACCESS when viewing certi…
Nov 17, 2013
d1e976b
peview: fixed label widths
Nov 17, 2013
17bff8e
don't show signer name if not trusted
Nov 18, 2013
19e234e
peview: added manifest
Nov 18, 2013
c0b2a12
disable OS version checking when verifying driver signatures
Nov 18, 2013
d019f65
updated ntexapi.h and ntpsapi.h for Windows 8.1
Nov 19, 2013
7400a59
* updated more headers for Windows 8.1
Nov 19, 2013
c0cdad4
added new Windows 8.1 process protection information
Nov 19, 2013
4067078
changed process protection text style
Nov 19, 2013
f4d9654
tweaked process properties General tab layout
Nov 19, 2013
63d543d
fixed typo
Nov 19, 2013
66026e8
get command lines of protected processes on Windows 8.1 without KPH
Nov 19, 2013
257ae91
* updated headers for Windows 8.1
Nov 20, 2013
22a9308
Plugins: removed extra CoCreateInstance calls
Nov 21, 2013
4132e3f
added error messages for module and handle lists
Nov 22, 2013
f45db03
OnlineChecks: fixed warning
Nov 23, 2013
fc9b592
NetworkTools: Removed redundant logging
Dec 5, 2013
ee01b86
NetworkTools: fixed ping loss percentage
Dec 6, 2013
0d2c480
Update moment.js to v2.5.0.
Dec 27, 2013
56f8485
updated for 2.33 release
Dec 27, 2013
4b3ac12
Website: updated config
Dec 28, 2013
0a0d39a
Plugins: Fixed updater memory leak; Added dynamic URL update support;
Dec 28, 2013
4bed61e
ToolStatus: Fixed mouse issue; Fixed drawing issue;
Dec 31, 2013
66fb058
ToolStatus: fixed XP searchbox font
Jan 1, 2014
46cac14
Update the sln files to use VS2013.
Jan 2, 2014
22b711a
installer: update copyright year.
Jan 2, 2014
bb5b82c
fixed treenew resizing bug when displaying empty text
Jan 7, 2014
04df3d1
ToolStatus: fixed GDI memory leaks
Jan 12, 2014
630e0be
ToolStatus: fixed searchbox GDI leak
Jan 12, 2014
60722b5
Fixed logging auto-scroll issue
Jan 27, 2014
37974a7
Fixed manifest issue preventing Immersive window enumeration
Jan 27, 2014
5c9c3e2
plugins-extra: sync WaitChainPlguin changes
Jan 27, 2014
b6f4419
plugins-extra: sync ROTViewerPlugin changes
Jan 27, 2014
ebd04a9
NetworkTools: fixed dialog/graph issue; fixed string format issue;
Feb 6, 2014
4da09cd
NetworkTools: fixed miscellaneous issues
Feb 6, 2014
4579aa8
Plugins: minor fixes for Updater
Feb 7, 2014
754ecf9
PH2.x: fixed Ctrl+Tab crash
Feb 7, 2014
90c4ee5
Plugins-extra: fixed DnsCachePlugin settings issue
Feb 7, 2014
082eaf6
fixed last commit
Feb 7, 2014
a4d632b
PluginExtras: sync plugin settings
Feb 7, 2014
5855b59
Removed unused resource IDs
Feb 24, 2014
e203fdc
PH1.x: fixed build
Feb 25, 2014
4e4bbac
Update moment.js to v2.5.1.
Mar 8, 2014
5354467
Update minify.bat for the latest clean-css.
Mar 8, 2014
880381c
Update normalize.css to v3.0.0.
Mar 8, 2014
ea1a0ce
Update .htaccess to Apache Server Configs v2.2.0.
Mar 8, 2014
2c1f651
Plugins: sync WiCBitmap fixes
Mar 12, 2014
b3c2390
NetworkTools: Fixed settings; Fixed resources; Fixed ping UI sync; Ad…
Mar 19, 2014
1fe2b0c
Plugins-Extra: Removed DnsCachePlugin Winsock dependencies
Mar 19, 2014
821cf22
Plugins: Fixed issue reported by Coverity, Inc. :)
Mar 22, 2014
2154ec8
ToolStatus: Added process service filter; Added Plugin URL;
Mar 31, 2014
bda27e5
ToolStatus: Fixed searchbox Ctrl+A handling; Fixed searchbox classic …
Apr 1, 2014
0138e15
ToolStatus: fixed searchbox color initialization
Apr 1, 2014
f4c4e9c
Fixing plugin paths so that "Build Solution" (F7) works
john-peterson Jul 25, 2013
feeec8c
vs 12 build fix
john-peterson Apr 4, 2014
146ea44
Changing the tray icon background from black to translucent
john-peterson Feb 22, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions 1.x/trunk/ProcessHacker.Common/BaseConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace ProcessHacker.Common
/// </summary>
public static class BaseConverter
{
private static readonly int[] _reverseChars = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
private static int[] _reverseChars = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 52,
53, 54, 55, 56, 57, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Expand Down Expand Up @@ -74,7 +74,7 @@ public static decimal ToNumber(string number, int b)
if (b > 70)
return 0;

if (string.IsNullOrEmpty(number))
if (number == "")
return 0;

bool negative = number[0] == '-';
Expand All @@ -95,8 +95,8 @@ public static decimal ToNumber(string number, int b)

if (negative)
return -result;

return result;
else
return result;
}

/// <summary>
Expand All @@ -118,11 +118,11 @@ public static decimal ToNumberParse(string number)
/// <returns></returns>
public static decimal ToNumberParse(string number, bool allowNonStandardExts)
{
if (string.IsNullOrEmpty(number))
if (number == "")
return 0;

bool negative = number[0] == '-';
decimal result;
decimal result = 0;

if (negative)
number = number.Substring(1);
Expand Down Expand Up @@ -169,8 +169,8 @@ public static decimal ToNumberParse(string number, bool allowNonStandardExts)

if (negative)
return -result;

return result;
else
return result;
}
}
}
4 changes: 3 additions & 1 deletion 1.x/trunk/ProcessHacker.Common/ByteStreamReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
*/

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace ProcessHacker.Common
{
public sealed class ByteStreamReader : Stream
{
private readonly byte[] _data;
private byte[] _data;
private long _position;

public ByteStreamReader(byte[] data)
Expand Down
12 changes: 7 additions & 5 deletions 1.x/trunk/ProcessHacker.Common/DeltaManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
*/

using System.Collections.Generic;

namespace ProcessHacker.Common
{
/// <summary>
Expand All @@ -36,10 +38,10 @@ public interface ISubtractor<T>

public static class Subtractor
{
private static readonly Int64Subtractor _int64Subtractor = new Int64Subtractor();
private static readonly Int32Subtractor _int32Subtractor = new Int32Subtractor();
private static readonly DoubleSubtractor _doubleSubtractor = new DoubleSubtractor();
private static readonly FloatSubtractor _floatSubtractor = new FloatSubtractor();
private static Int64Subtractor _int64Subtractor = new Int64Subtractor();
private static Int32Subtractor _int32Subtractor = new Int32Subtractor();
private static DoubleSubtractor _doubleSubtractor = new DoubleSubtractor();
private static FloatSubtractor _floatSubtractor = new FloatSubtractor();

public static Int64Subtractor Int64Subtractor
{
Expand Down Expand Up @@ -115,7 +117,7 @@ public interface IDeltaValue<T>

public struct DeltaValue<T> : IDeltaValue<T>
{
private readonly ISubtractor<T> _subtractor;
private ISubtractor<T> _subtractor;
private T _value;
private T _delta;

Expand Down
36 changes: 18 additions & 18 deletions 1.x/trunk/ProcessHacker.Common/EnumComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection.Emit;

namespace ProcessHacker.Common
Expand All @@ -14,6 +15,7 @@ public sealed class EnumComparer<TEnum> : IEqualityComparer<TEnum>
where TEnum : struct, IComparable, IConvertible, IFormattable
{
public static readonly EnumComparer<TEnum> Instance;

private static readonly Func<TEnum, TEnum, bool> _equals;
private static readonly Func<TEnum, int> _getHashCode;

Expand Down Expand Up @@ -51,11 +53,12 @@ private static void AssertTypeIsEnum()
private static void AssertUnderlyingTypeIsSupported()
{
var underlyingType = Enum.GetUnderlyingType(typeof(TEnum));
ICollection<Type> supportedTypes = new[]
{
typeof(byte), typeof(sbyte), typeof(short), typeof(ushort),
typeof(int), typeof(uint), typeof(long), typeof(ulong)
};
ICollection<Type> supportedTypes =
new[]
{
typeof (byte), typeof (sbyte), typeof (short), typeof (ushort),
typeof (int), typeof (uint), typeof (long), typeof (ulong)
};

if (supportedTypes.Contains(underlyingType))
return;
Expand All @@ -75,19 +78,18 @@ private static void AssertUnderlyingTypeIsSupported()
/// <returns>The generated method.</returns>
private static Func<TEnum, TEnum, bool> generateEquals()
{
var method = new DynamicMethod(typeof(TEnum).Name + "_Equals", typeof(bool), new[]
{
typeof(TEnum), typeof(TEnum)
}, typeof(TEnum), true);

var method = new DynamicMethod(typeof(TEnum).Name + "_Equals",
typeof(bool),
new[] { typeof(TEnum), typeof(TEnum) },
typeof(TEnum), true);
var generator = method.GetILGenerator();
// Writing body
generator.Emit(OpCodes.Ldarg_0); // load x to stack
generator.Emit(OpCodes.Ldarg_1); // load y to stack
generator.Emit(OpCodes.Ceq); // x == y
generator.Emit(OpCodes.Ret); // return result

return (Func<TEnum, TEnum, bool>)method.CreateDelegate(typeof(Func<TEnum, TEnum, bool>));
return (Func<TEnum, TEnum, bool>)method.CreateDelegate
(typeof(Func<TEnum, TEnum, bool>));
}

/// <summary>
Expand All @@ -102,11 +104,10 @@ private static Func<TEnum, TEnum, bool> generateEquals()
/// <returns>The generated method.</returns>
private static Func<TEnum, int> generateGetHashCode()
{
var method = new DynamicMethod(typeof(TEnum).Name + "_GetHashCode", typeof(int), new[]
{
typeof(TEnum)
}, typeof(TEnum), true);

var method = new DynamicMethod(typeof(TEnum).Name + "_GetHashCode",
typeof(int),
new[] { typeof(TEnum) },
typeof(TEnum), true);
var generator = method.GetILGenerator();
var underlyingType = Enum.GetUnderlyingType(typeof(TEnum));
var getHashCodeMethod = underlyingType.GetMethod("GetHashCode");
Expand All @@ -117,7 +118,6 @@ private static Func<TEnum, int> generateGetHashCode()
generator.Emit(OpCodes.Ldloca_S, castValue); // load *castValue to stack
generator.Emit(OpCodes.Call, getHashCodeMethod); // castValue.GetHashCode()
generator.Emit(OpCodes.Ret); // return result

return (Func<TEnum, int>)method.CreateDelegate(typeof(Func<TEnum, int>));
}
}
Expand Down
8 changes: 5 additions & 3 deletions 1.x/trunk/ProcessHacker.Common/FreeList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@
* along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Threading;

namespace ProcessHacker.Common
{
/// <summary>
/// Manages a list of free objects that can be re-used.
/// </summary>
public class FreeList<T> where T : IResettable, new()
public class FreeList<T>
where T : IResettable, new()
{
private readonly T[] _list;
private int _freeIndex;
private T[] _list;
private int _freeIndex = 0;

public FreeList(int maximumCount)
{
Expand Down
6 changes: 5 additions & 1 deletion 1.x/trunk/ProcessHacker.Common/IResettable.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace ProcessHacker.Common
using System;
using System.Collections.Generic;
using System.Text;

namespace ProcessHacker.Common
{
public interface IResettable
{
Expand Down
14 changes: 8 additions & 6 deletions 1.x/trunk/ProcessHacker.Common/IdGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ namespace ProcessHacker.Common
/// </summary>
public class IdGenerator
{
private readonly int _step = 1;
private bool _sort;
private readonly List<int> _ids = new List<int>();
private int _step = 1;
private bool _sort = false;
private List<int> _ids = new List<int>();
private int _id;

/// <summary>
Expand Down Expand Up @@ -88,9 +88,11 @@ public int Pop()

return id;
}

id = this._id;
this._id += this._step;
else
{
id = _id;
_id += _step;
}
}

return id;
Expand Down
6 changes: 5 additions & 1 deletion 1.x/trunk/ProcessHacker.Common/LibC.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace ProcessHacker.Common
using System;
using System.Collections.Generic;
using System.Text;

namespace ProcessHacker.Common
{
public static class LibC
{
Expand Down
4 changes: 3 additions & 1 deletion 1.x/trunk/ProcessHacker.Common/LinkedList.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace ProcessHacker.Common
using System;

namespace ProcessHacker.Common
{
public class LinkedListEntry<T>
{
Expand Down
27 changes: 18 additions & 9 deletions 1.x/trunk/ProcessHacker.Common/Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace ProcessHacker.Common
{
public delegate void LoggingDelegate(string message);

public static class Logging
{
public enum Importance
public enum Importance : int
{
Information = 0,
Warning,
Expand All @@ -39,18 +40,26 @@ public enum Importance

public static event LoggingDelegate Logged;

[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
private static extern void OutputDebugString(string OutputString);

private static object _logLock = new object();

[Conditional("DEBUG")]
public static void Log(Importance importance, string message)
{
string debugMessage =
DateTime.Now.ToString("hh:mm:ss:fff:") +
" ProcessHacker (T" + System.Threading.Thread.CurrentThread.ManagedThreadId +
"): (" + importance.ToString() + ") " + message + "\r\n\r\n" + Environment.StackTrace;
lock (_logLock)
{
string debugMessage =
DateTime.Now.ToString("hh:mm:ss:fff:") +
" ProcessHacker (T" + System.Threading.Thread.CurrentThread.ManagedThreadId +
"): (" + importance.ToString() + ") " + message + "\r\n\r\n" + Environment.StackTrace;

Debugger.Log(0, "DEBUG", debugMessage);
OutputDebugString(debugMessage);

if (Logged != null)
Logged(debugMessage);
if (Logged != null)
Logged(debugMessage);
}
}

[Conditional("DEBUG")]
Expand All @@ -59,7 +68,7 @@ public static void Log(Exception ex)
string message = ex.Message;

if (ex.InnerException != null)
message += "\r\nInner exception:\r\n" + ex.InnerException;
message += "\r\nInner exception:\r\n" + ex.InnerException.ToString();
if (ex.StackTrace != null)
message += "\r\n" + ex.StackTrace;

Expand Down
12 changes: 10 additions & 2 deletions 1.x/trunk/ProcessHacker.Common/Messaging/Message.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace ProcessHacker.Common.Messaging
{
public class Message
{
public object Tag { get; set; }
private object _tag;

public object Tag
{
get { return _tag; }
set { _tag = value; }
}
}

public class ActionMessage : Message
{
private readonly Action _action;
private Action _action;

public ActionMessage(Action action)
{
Expand Down
7 changes: 4 additions & 3 deletions 1.x/trunk/ProcessHacker.Common/Messaging/MessageQueue.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace ProcessHacker.Common.Messaging
{
public class MessageQueue
{
private readonly Queue<Message> _queue = new Queue<Message>();
private readonly List<MessageQueueListener> _listeners = new List<MessageQueueListener>();
private Queue<Message> _queue = new Queue<Message>();
private List<MessageQueueListener> _listeners = new List<MessageQueueListener>();

public MessageQueue()
{
// Action message listener.
this.AddListener(new MessageQueueListener<ActionMessage>(action => action.Action()));
this.AddListener(new MessageQueueListener<ActionMessage>((action) => action.Action()));
}

public void AddListener(MessageQueueListener listener)
Expand Down
Loading