From c47ea8728d5417bcc39ba7dc996eb86138998987 Mon Sep 17 00:00:00 2001 From: wj32 Date: Mon, 1 Jun 2009 06:58:00 +0000 Subject: [PATCH] "fixed" all compiler warnings git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1358 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- .../FileByteProvider.cs | 5 +- .../ProcessTree/ProcessTreeModel.cs | 2 + trunk/ProcessHacker/Forms/ApiLogWindow.cs | 7 ++ trunk/ProcessHacker/Forms/OptionsWindow.cs | 2 +- trunk/ProcessHacker/Program/Program.cs | 99 +++++-------------- 5 files changed, 36 insertions(+), 79 deletions(-) diff --git a/trunk/ProcessHacker/Components/Be.Windows.Forms.HexBox/FileByteProvider.cs b/trunk/ProcessHacker/Components/Be.Windows.Forms.HexBox/FileByteProvider.cs index 671107bfd..6ae12babc 100644 --- a/trunk/ProcessHacker/Components/Be.Windows.Forms.HexBox/FileByteProvider.cs +++ b/trunk/ProcessHacker/Components/Be.Windows.Forms.HexBox/FileByteProvider.cs @@ -1,3 +1,5 @@ +#pragma warning disable 0067 + using System; using System.IO; using System.Collections; @@ -163,10 +165,11 @@ namespace Be.Windows.Forms } #region IByteProvider Members + /// /// Never used. /// - public event EventHandler LengthChanged; + public event EventHandler LengthChanged; /// /// Reads a byte from the file. diff --git a/trunk/ProcessHacker/Components/ProcessTree/ProcessTreeModel.cs b/trunk/ProcessHacker/Components/ProcessTree/ProcessTreeModel.cs index db5f8ec4d..b40b08c58 100644 --- a/trunk/ProcessHacker/Components/ProcessTree/ProcessTreeModel.cs +++ b/trunk/ProcessHacker/Components/ProcessTree/ProcessTreeModel.cs @@ -20,6 +20,8 @@ * along with Process Hacker. If not, see . */ +#pragma warning disable 0067 + using System; using System.Collections.Generic; using Aga.Controls.Tree; diff --git a/trunk/ProcessHacker/Forms/ApiLogWindow.cs b/trunk/ProcessHacker/Forms/ApiLogWindow.cs index edd8b9a83..bbd25f68d 100644 --- a/trunk/ProcessHacker/Forms/ApiLogWindow.cs +++ b/trunk/ProcessHacker/Forms/ApiLogWindow.cs @@ -34,6 +34,13 @@ namespace ProcessHacker.Forms public char Hooked; public unsafe fixed byte ReplacedBytes[16]; public int ReplacedLength; + + public HOOK(IntPtr address) + { + this.Address = address; + this.Hooked = '\0'; + this.ReplacedLength = 0; + } } private List _items = new List(); diff --git a/trunk/ProcessHacker/Forms/OptionsWindow.cs b/trunk/ProcessHacker/Forms/OptionsWindow.cs index 903c43425..da16fd715 100644 --- a/trunk/ProcessHacker/Forms/OptionsWindow.cs +++ b/trunk/ProcessHacker/Forms/OptionsWindow.cs @@ -116,7 +116,7 @@ namespace ProcessHacker else if (c is ColorModifier) (c as ColorModifier).ColorChanged += (sender, e) => this.EnableApplyButton(); else if (c is Button || c is Label) - ; // Nothing + Program.Void(); // Nothing else c.Click += (sender, e) => this.EnableApplyButton(); } diff --git a/trunk/ProcessHacker/Program/Program.cs b/trunk/ProcessHacker/Program/Program.cs index 439b5d36d..abb9f8fbf 100644 --- a/trunk/ProcessHacker/Program/Program.cs +++ b/trunk/ProcessHacker/Program/Program.cs @@ -24,17 +24,16 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Security.Principal; +using System.Text; using System.Threading; using System.Windows.Forms; +using ProcessHacker.Common; using ProcessHacker.Components; using ProcessHacker.Native; using ProcessHacker.Native.Api; using ProcessHacker.Native.Objects; using ProcessHacker.Native.Security; using ProcessHacker.UI; -using System.Text; -using System.Runtime.InteropServices; -using ProcessHacker.Common; namespace ProcessHacker { @@ -62,19 +61,19 @@ namespace ProcessHacker public static Dictionary Structs = new Dictionary(); - public const bool MemoryEditorsThreaded = true; + public static bool MemoryEditorsThreaded = true; public static Dictionary MemoryEditors = new Dictionary(); public static Dictionary MemoryEditorsThreads = new Dictionary(); - public const bool ResultsWindowsThreaded = true; + public static bool ResultsWindowsThreaded = true; public static Dictionary ResultsWindows = new Dictionary(); public static Dictionary ResultsThreads = new Dictionary(); - public const bool PEWindowsThreaded = false; + public static bool PEWindowsThreaded = false; public static Dictionary PEWindows = new Dictionary(); public static Dictionary PEThreads = new Dictionary(); - public const bool PWindowsThreaded = false; + public static bool PWindowsThreaded = false; public static Dictionary PWindows = new Dictionary(); public static Dictionary PThreads = new Dictionary(); @@ -875,77 +874,9 @@ namespace ProcessHacker { Logging.Log(Logging.Importance.Critical, ex.ToString()); - if (false) - { - TaskDialog td = new TaskDialog(); + ErrorDialog ed = new ErrorDialog(ex); - td.WindowTitle = "Process Hacker"; - td.MainInstruction = "Process Hacker has encountered a problem"; - td.Content = "An unhandled exception has occurred in Process Hacker."; - - td.Buttons = new TaskDialogButton[] - { - new TaskDialogButton((int)DialogResult.Yes, "Continue\nIgnore the error and continue. This may cause Process Hacker to crash."), - new TaskDialogButton((int)DialogResult.No, "Close\nClose Process Hacker.") - }; - td.UseCommandLinks = true; - - try - { - if (Program.HackerWindow != null) - { - td.CustomMainIcon = ProcessHacker.Properties.Resources.Process; - } - } - catch - { } - - td.ExpandedInformation = "Please report this problem to " + - "http://sourceforge.net/projects/processhacker\r\n\r\n" + ex.ToString(); - td.EnableHyperlinks = true; - td.ExpandFooterArea = true; - td.CollapsedControlText = "Show problem details"; - td.ExpandedControlText = "Hide problem details"; - td.Callback = (taskDialog, args, callbackData) => - { - if (args.Notification == TaskDialogNotification.HyperlinkClicked) - { - if (args.Hyperlink == "report") - { - try - { - System.Diagnostics.Process.Start("http://sourceforge.net/tracker2/?group_id=242527"); - } - catch - { } - } - - return true; - } - - return false; - }; - - DialogResult result = (DialogResult)td.Show(); - - if (result == DialogResult.No) - { - try - { - Properties.Settings.Default.Save(); - } - catch - { } - - Win32.ExitProcess(0); - } - } - else - { - ErrorDialog ed = new ErrorDialog(ex); - - ed.ShowDialog(); - } + ed.ShowDialog(); } /// @@ -1183,6 +1114,20 @@ namespace ProcessHacker return pw; } + /// + /// Does nothing. + /// + [System.Diagnostics.Conditional("NOT_DEFINED")] + public static void Void() + { + // Do nothing + int a = 0; + int b = a * (a + 0); + + for (a = 0; a < b; a++) + a += a * (a + b); + } + public static void FocusWindow(Form f) { if (f.InvokeRequired)