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:
wj32
2009-04-27 02:45:20 +00:00
parent 09ece47696
commit e55aa8c3f5
4 changed files with 64 additions and 37 deletions
+12 -5
View File
@@ -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;
}
+35 -31
View File
@@ -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();
+1 -1
View File
@@ -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>();
+16
View File
@@ -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)