mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
no more UI blocking on the symbol call lock
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1164 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace ProcessHacker
|
||||
public static Dictionary<string, PEWindow> PEWindows = new Dictionary<string, PEWindow>();
|
||||
public static Dictionary<string, Thread> PEThreads = new Dictionary<string, Thread>();
|
||||
|
||||
public const bool PWindowsThreaded = true;
|
||||
public const bool PWindowsThreaded = false;
|
||||
public static Dictionary<int, ProcessWindow> PWindows = new Dictionary<int, ProcessWindow>();
|
||||
public static Dictionary<int, Thread> PThreads = new Dictionary<int, Thread>();
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user