diff --git a/trunk/ProcessHacker/Components/ThreadList.cs b/trunk/ProcessHacker/Components/ThreadList.cs index 1591b801b..094ecdfed 100644 --- a/trunk/ProcessHacker/Components/ThreadList.cs +++ b/trunk/ProcessHacker/Components/ThreadList.cs @@ -122,13 +122,20 @@ namespace ProcessHacker.Components catch { } - try + if (!_provider.Symbols.Busy) { - _provider.Symbols.GetSymbolFromAddress(_provider.Dictionary[tid].StartAddressI, out fileName); - fileModule.Text = fileName; - fileModule.Enabled = true; + try + { + _provider.Symbols.GetSymbolFromAddress(_provider.Dictionary[tid].StartAddressI, out fileName); + fileModule.Text = fileName; + fileModule.Enabled = true; + } + catch + { + fileModule.Enabled = false; + } } - catch + else { fileModule.Enabled = false; } diff --git a/trunk/ProcessHacker/Forms/ProcessWindow.cs b/trunk/ProcessHacker/Forms/ProcessWindow.cs index 537d282ff..933581af1 100644 --- a/trunk/ProcessHacker/Forms/ProcessWindow.cs +++ b/trunk/ProcessHacker/Forms/ProcessWindow.cs @@ -82,6 +82,9 @@ namespace ProcessHacker this.Icon = Program.HackerWindow.Icon; Program.PWindows.Add(_pid, this); + + this.InitializeSubControls(); + this.FixTabs(); } public MenuItem WindowMenuItem @@ -152,10 +155,41 @@ namespace ProcessHacker { if (_isFirstPaint) { + _isFirstPaint = false; this.LoadStage1(); } + } - _isFirstPaint = false; + private void FixTabs() + { + if (_pid < 0) + { + // this "process" is probably DPCs or Interrupts, so we won't try to load any more information + buttonEditDEP.Enabled = false; + buttonEditProtected.Enabled = false; + buttonInspectParent.Enabled = false; + buttonInspectPEB.Enabled = false; + + if (fileCurrentDirectory.Text != "") + fileCurrentDirectory.Enabled = false; + + if (_pid != 4) + fileImage.Enabled = false; + + buttonSearch.Enabled = false; + buttonTerminate.Enabled = false; + + // remove tab controls not relevant to DPCs/Interrupts + tabControl.TabPages.Remove(tabHandles); + tabControl.TabPages.Remove(tabMemory); + tabControl.TabPages.Remove(tabModules); + tabControl.TabPages.Remove(tabServices); + tabControl.TabPages.Remove(tabThreads); + tabControl.TabPages.Remove(tabToken); + if (tabControl.TabPages.Contains(tabJob)) + tabControl.TabPages.Remove(tabJob); + tabControl.TabPages.Remove(tabEnvironment); + } } private void LoadStage1() @@ -193,34 +227,6 @@ namespace ProcessHacker { } this.UpdateProcessProperties(); - - if (_pid < 0) - { - // this "process" is probably DPCs or Interrupts, so we won't try to load any more information - buttonEditDEP.Enabled = false; - buttonEditProtected.Enabled = false; - buttonInspectParent.Enabled = false; - buttonInspectPEB.Enabled = false; - - if (fileCurrentDirectory.Text != "") - fileCurrentDirectory.Enabled = false; - - if (_pid != 4) - fileImage.Enabled = false; - - buttonSearch.Enabled = false; - buttonTerminate.Enabled = false; - - // remove tab controls not relevant to DPCs/Interrupts - tabControl.TabPages.Remove(tabHandles); - tabControl.TabPages.Remove(tabMemory); - tabControl.TabPages.Remove(tabModules); - tabControl.TabPages.Remove(tabServices); - tabControl.TabPages.Remove(tabThreads); - tabControl.TabPages.Remove(tabToken); - tabControl.TabPages.Remove(tabJob); - tabControl.TabPages.Remove(tabEnvironment); - } if (_pid == 0) textFileDescription.Text = "System Idle Process"; @@ -250,8 +256,6 @@ namespace ProcessHacker { this.SuspendLayout(); - this.InitializeSubControls(); - try { this.InitializeProviders(); diff --git a/trunk/ProcessHacker/Program/Program.cs b/trunk/ProcessHacker/Program/Program.cs index 808fc8aef..6ff49f56d 100644 --- a/trunk/ProcessHacker/Program/Program.cs +++ b/trunk/ProcessHacker/Program/Program.cs @@ -71,7 +71,7 @@ namespace ProcessHacker public static Dictionary PEWindows = new Dictionary(); public static Dictionary PEThreads = new Dictionary(); - public const bool PWindowsThreaded = true; + public const bool PWindowsThreaded = false; public static Dictionary PWindows = new Dictionary(); public static Dictionary PThreads = new Dictionary(); diff --git a/trunk/ProcessHacker/Symbols/Symbols.cs b/trunk/ProcessHacker/Symbols/Symbols.cs index 4445e8385..c4bbfedc6 100644 --- a/trunk/ProcessHacker/Symbols/Symbols.cs +++ b/trunk/ProcessHacker/Symbols/Symbols.cs @@ -112,6 +112,22 @@ namespace ProcessHacker.Symbols public bool PreloadModules { get; set; } + public bool Busy + { + get + { + if (!Monitor.TryEnter(_callLock)) + { + return true; + } + else + { + Monitor.Exit(_callLock); + return false; + } + } + } + public static void ShowWarning(IWin32Window window, bool force) { if (Properties.Settings.Default.DbgHelpWarningShown && !force)