diff --git a/MinidumpExplorer/DbgHelp.MinidumpFiles/DbgHelp.MinidumpFiles.csproj b/MinidumpExplorer/DbgHelp.MinidumpFiles/DbgHelp.MinidumpFiles.csproj index 35e9526..d5a921f 100644 --- a/MinidumpExplorer/DbgHelp.MinidumpFiles/DbgHelp.MinidumpFiles.csproj +++ b/MinidumpExplorer/DbgHelp.MinidumpFiles/DbgHelp.MinidumpFiles.csproj @@ -9,12 +9,13 @@ Properties DbgHelp.MinidumpFiles DbgHelp.MinidumpFiles - v4.5 + v4.6.1 512 SAK SAK SAK SAK + true @@ -46,6 +47,7 @@ true prompt MinimumRecommendedRules.ruleset + latest bin\x64\Release\ @@ -89,6 +91,7 @@ + @@ -113,6 +116,8 @@ + + diff --git a/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpCommentStreamW.cs b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpCommentStreamW.cs new file mode 100644 index 0000000..c21d77c --- /dev/null +++ b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpCommentStreamW.cs @@ -0,0 +1,20 @@ +namespace DbgHelp.MinidumpFiles +{ + /// + /// The comment string that was written to the dump file. + /// + public class MiniDumpCommentStreamW + { + internal MiniDumpCommentStreamW() + { + this.Comment = null; + } + + internal MiniDumpCommentStreamW(string comment) + { + this.Comment = comment; + } + + public string Comment { get; private set; } + } +} \ No newline at end of file diff --git a/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpFile.cs b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpFile.cs index 2e9d9af..c4b7439 100644 --- a/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpFile.cs +++ b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpFile.cs @@ -400,6 +400,45 @@ public MiniDumpSystemMemoryInfo ReadSystemMemoryInfo() return new MiniDumpSystemMemoryInfo(systemMemoryInfo, this); } + public MiniDumpThreadNamesStream ReadThreadNamesStream() + { + MINIDUMP_THREAD_NAME_LIST threadNameStream; + IntPtr streamPointer; + uint streamSize; + + if (!this.ReadStream(MINIDUMP_STREAM_TYPE.ThreadNamesStream, out threadNameStream, out streamPointer, out streamSize)) + { + return new MiniDumpThreadNamesStream(); // Return empty result + } + + // Advance the stream pointer past the header + streamPointer += Marshal.SizeOf(threadNameStream.NumberOfThreadNames); + + // Now read the information + MINIDUMP_THREAD_NAME[] threadNames = ReadArray(streamPointer, (int)threadNameStream.NumberOfThreadNames); + + return new MiniDumpThreadNamesStream(threadNameStream, threadNames, this); + } + + /// + /// Reads the MINIDUMP_STREAM_TYPE.CommentStreamW stream. + /// + /// containing the comment for the minidump. If stream data is not present then is returned with a null Comment property. + public MiniDumpCommentStreamW ReadCommentStreamW() + { + IntPtr streamPointer; + uint streamSize; + + if (!this.ReadStream(MINIDUMP_STREAM_TYPE.CommentStreamW, out streamPointer, out streamSize)) + { + return new MiniDumpCommentStreamW(); // Return empty result + } + + string comment = Marshal.PtrToStringAuto(streamPointer, (int)streamSize); + + return new MiniDumpCommentStreamW(comment); + } + public unsafe void CopyMemoryFromOffset(ulong rva, IntPtr destination, uint size) { try @@ -445,8 +484,21 @@ protected unsafe bool ReadStream(MINIDUMP_STREAM_TYPE streamToRead, out T str protected unsafe bool ReadStream(MINIDUMP_STREAM_TYPE streamToRead, out T streamData, out IntPtr streamPointer, out uint streamSize) { - MINIDUMP_DIRECTORY directory = new MINIDUMP_DIRECTORY(); streamData = default(T); + + if (ReadStream(streamToRead, out streamPointer, out streamSize)) + { + streamData = (T)Marshal.PtrToStructure(streamPointer, typeof(T)); + + return true; + } + + return false; + } + + protected unsafe bool ReadStream(MINIDUMP_STREAM_TYPE streamToRead, out IntPtr streamPointer, out uint streamSize) + { + MINIDUMP_DIRECTORY directory = new MINIDUMP_DIRECTORY(); streamPointer = IntPtr.Zero; streamSize = 0; @@ -469,9 +521,6 @@ protected unsafe bool ReadStream(MINIDUMP_STREAM_TYPE streamToRead, out T str else throw new Win32Exception(lastError); } - - streamData = (T)Marshal.PtrToStructure(streamPointer, typeof(T)); - } finally { diff --git a/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpStreamType.cs b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpStreamType.cs index 36c682a..7533a76 100644 --- a/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpStreamType.cs +++ b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpStreamType.cs @@ -33,6 +33,8 @@ public enum MiniDumpStreamType SystemMemoryInfoStream = 21, ProcessVmCountersStream = 22, + ThreadNamesStream = 24, + LastReservedStream = 0xffff } } diff --git a/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpThreadName.cs b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpThreadName.cs new file mode 100644 index 0000000..590f853 --- /dev/null +++ b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpThreadName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using DbgHelp.MinidumpFiles.Native; + +namespace DbgHelp.MinidumpFiles +{ + /// + /// Contains information about a thread's name/description. + /// + public class MiniDumpThreadName + { + private MINIDUMP_THREAD_NAME _threadName; + private MiniDumpFile _owner; + + internal MiniDumpThreadName(MINIDUMP_THREAD_NAME threadName, MiniDumpFile owner) + { + this._threadName = threadName; + this._owner = owner; + } + + public uint ThreadId => _threadName.ThreadId; + public string Name => _owner.ReadString(_threadName.RvaOfThreadName); + } +} diff --git a/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpThreadNamesStream.cs b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpThreadNamesStream.cs new file mode 100644 index 0000000..3bf7697 --- /dev/null +++ b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpThreadNamesStream.cs @@ -0,0 +1,32 @@ +using DbgHelp.MinidumpFiles.Native; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DbgHelp.MinidumpFiles +{ + /// + /// The thread names stream in a minidump, containing information about each thread's name/description (if available). + /// + public class MiniDumpThreadNamesStream + { + private MINIDUMP_THREAD_NAME_LIST _threadNamesList; + private List _threadNameEntries; + + internal MiniDumpThreadNamesStream() + { + _threadNamesList = new MINIDUMP_THREAD_NAME_LIST(); + _threadNameEntries = new List(); + } + + internal MiniDumpThreadNamesStream(MINIDUMP_THREAD_NAME_LIST threadNamesList, MINIDUMP_THREAD_NAME[] threadNameEntries, MiniDumpFile owner) + { + _threadNamesList = threadNamesList; + _threadNameEntries = new List(threadNameEntries.Select(x => new MiniDumpThreadName(x, owner))); + } + + public IReadOnlyCollection Entries => _threadNameEntries; + } +} diff --git a/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpType.cs b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpType.cs index 9141248..dc026ad 100644 --- a/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpType.cs +++ b/MinidumpExplorer/DbgHelp.MinidumpFiles/MiniDumpType.cs @@ -119,7 +119,8 @@ public enum MiniDumpType MiniDumpFilterTriage = 0x00100000, MiniDumpWithAvxXStateContext = 0x00200000, - MiniDumpValidTypeFlags = 0x003fffff + MiniDumpWithIptTrace = 0x00400000, + MiniDumpValidTypeFlags = 0x007fffff } } diff --git a/MinidumpExplorer/DbgHelp.MinidumpFiles/Native/dbghelp.cs b/MinidumpExplorer/DbgHelp.MinidumpFiles/Native/dbghelp.cs index 39f462f..9d9364c 100644 --- a/MinidumpExplorer/DbgHelp.MinidumpFiles/Native/dbghelp.cs +++ b/MinidumpExplorer/DbgHelp.MinidumpFiles/Native/dbghelp.cs @@ -1023,6 +1023,32 @@ internal struct MINIDUMP_SYSTEM_PERFORMANCE_INFORMATION public UInt64 SharedCommittedPages; } + + /* + typedef struct _MINIDUMP_THREAD_NAME_LIST { + ULONG NumberOfThreadNames; + MINIDUMP_THREAD_NAME ThreadNames[0]; // Variable size buffer + } MINIDUMP_THREAD_NAME_LIST, *PMINIDUMP_THREAD_NAME_LIST; + */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + internal struct MINIDUMP_THREAD_NAME_LIST + { + public uint NumberOfThreadNames; + } + + /* + typedef struct _MINIDUMP_THREAD_NAME { + ULONG ThreadId; + RVA64 RvaOfThreadName; + } MINIDUMP_THREAD_NAME, *PMINIDUMP_THREAD_NAME; + */ + [StructLayout(LayoutKind.Sequential, Pack = 4)] + internal struct MINIDUMP_THREAD_NAME + { + public uint ThreadId; + public uint RvaOfThreadName; + } + public enum MINIDUMP_STREAM_TYPE : uint { UnusedStream = 0, @@ -1050,6 +1076,8 @@ public enum MINIDUMP_STREAM_TYPE : uint SystemMemoryInfoStream = 21, ProcessVmCountersStream = 22, + ThreadNamesStream = 24, + LastReservedStream = 0xffff } diff --git a/MinidumpExplorer/DbgHelp.MinidumpFiles/Properties/AssemblyInfo.cs b/MinidumpExplorer/DbgHelp.MinidumpFiles/Properties/AssemblyInfo.cs index 4049557..eaa685b 100644 --- a/MinidumpExplorer/DbgHelp.MinidumpFiles/Properties/AssemblyInfo.cs +++ b/MinidumpExplorer/DbgHelp.MinidumpFiles/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DbgHelp.MinidumpFiles")] -[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.7.0.0")] -[assembly: AssemblyFileVersion("0.7.0.0")] +[assembly: AssemblyVersion("0.8.0.0")] +[assembly: AssemblyFileVersion("0.8.0.0")] diff --git a/MinidumpExplorer/MinidumpExplorer/App.config b/MinidumpExplorer/MinidumpExplorer/App.config index 094ccdc..363e31a 100644 --- a/MinidumpExplorer/MinidumpExplorer/App.config +++ b/MinidumpExplorer/MinidumpExplorer/App.config @@ -1,12 +1,12 @@ - + - -
+ +
- + @@ -15,4 +15,4 @@ - \ No newline at end of file + diff --git a/MinidumpExplorer/MinidumpExplorer/Dialogs/AboutDialog.Designer.cs b/MinidumpExplorer/MinidumpExplorer/Dialogs/AboutDialog.Designer.cs index dc0b757..6e5981a 100644 --- a/MinidumpExplorer/MinidumpExplorer/Dialogs/AboutDialog.Designer.cs +++ b/MinidumpExplorer/MinidumpExplorer/Dialogs/AboutDialog.Designer.cs @@ -49,7 +49,7 @@ private void InitializeComponent() // this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.okButton.Location = new System.Drawing.Point(311, 216); + this.okButton.Location = new System.Drawing.Point(346, 237); this.okButton.Name = "okButton"; this.okButton.Size = new System.Drawing.Size(87, 27); this.okButton.TabIndex = 24; @@ -86,7 +86,7 @@ private void InitializeComponent() this.labelVersion.Margin = new System.Windows.Forms.Padding(7, 0, 3, 0); this.labelVersion.MaximumSize = new System.Drawing.Size(0, 20); this.labelVersion.Name = "labelVersion"; - this.labelVersion.Size = new System.Drawing.Size(46, 15); + this.labelVersion.Size = new System.Drawing.Size(45, 15); this.labelVersion.TabIndex = 26; this.labelVersion.Text = "Version"; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -109,10 +109,10 @@ private void InitializeComponent() this.linkLabel1.Location = new System.Drawing.Point(157, 159); this.linkLabel1.Margin = new System.Windows.Forms.Padding(7, 0, 3, 0); this.linkLabel1.Name = "linkLabel1"; - this.linkLabel1.Size = new System.Drawing.Size(185, 15); + this.linkLabel1.Size = new System.Drawing.Size(282, 15); this.linkLabel1.TabIndex = 29; this.linkLabel1.TabStop = true; - this.linkLabel1.Text = "http://minidumps.codeplex.com/"; + this.linkLabel1.Text = "https://github.com/GregTheDev/MinidumpExplorer"; this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); // // panel1 @@ -172,7 +172,7 @@ private void InitializeComponent() this.AcceptButton = this.okButton; this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(419, 256); + this.ClientSize = new System.Drawing.Size(454, 277); this.Controls.Add(this.linkLabel2); this.Controls.Add(this.panel1); this.Controls.Add(this.linkLabel1); diff --git a/MinidumpExplorer/MinidumpExplorer/MainForm.cs b/MinidumpExplorer/MinidumpExplorer/MainForm.cs index b01b616..59279ac 100644 --- a/MinidumpExplorer/MinidumpExplorer/MainForm.cs +++ b/MinidumpExplorer/MinidumpExplorer/MainForm.cs @@ -212,6 +212,12 @@ private void CmdDisplayStream(string streamName) numberOfItems = threadInfoData.Length; viewToDisplay = new ThreadInfoListView(threadInfoData); break; + case "ThreadNames": + nodeText = "ThreadNames"; + MiniDumpThreadNamesStream threadNamesStream = this._miniDumpFile.ReadThreadNamesStream(); + numberOfItems = threadNamesStream.Entries.Count; + viewToDisplay = new ThreadNamesView(threadNamesStream); + break; case "Memory": nodeText = "Memory"; MiniDumpMemoryDescriptor[] memoryData = this._miniDumpFile.ReadMemoryList(); @@ -262,6 +268,12 @@ private void CmdDisplayStream(string streamName) numberOfItems = 1; viewToDisplay = new SystemMemoryInfoView(systemMemoryInfo); break; + case "CommentW": + nodeText = "CommentW"; + MiniDumpCommentStreamW commentWStream = this._miniDumpFile.ReadCommentStreamW(); + numberOfItems = string.IsNullOrEmpty(commentWStream.Comment) ? 0 : 1; + viewToDisplay = new CommentStreamWView(commentWStream); + break; } if (viewToDisplay != null) diff --git a/MinidumpExplorer/MinidumpExplorer/MainForm.designer.cs b/MinidumpExplorer/MinidumpExplorer/MainForm.designer.cs index 872cb30..73a05a5 100644 --- a/MinidumpExplorer/MinidumpExplorer/MainForm.designer.cs +++ b/MinidumpExplorer/MinidumpExplorer/MainForm.designer.cs @@ -32,19 +32,21 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("Exception", 6, 6); - System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("Handles", 4, 4); - System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("Memory", 3, 3); - System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("Memory64", 3, 3); - System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("MemoryInfo", 3, 3); - System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("MiscInfo", 5, 5); - System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("Modules", 2, 2); - System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("SystemInfo"); - System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("SystemMemoryInfo", 3, 3); - System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("Threads", 1, 1); - System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("ThreadInfo", 1, 1); - System.Windows.Forms.TreeNode treeNode12 = new System.Windows.Forms.TreeNode("UnloadedModules", 2, 2); - System.Windows.Forms.TreeNode treeNode13 = new System.Windows.Forms.TreeNode("", new System.Windows.Forms.TreeNode[] { + System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("CommentW", 5, 5); + System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("Exception", 6, 6); + System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("Handles", 4, 4); + System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("Memory", 3, 3); + System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("Memory64", 3, 3); + System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("MemoryInfo", 3, 3); + System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("MiscInfo", 5, 5); + System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("Modules", 2, 2); + System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("SystemInfo"); + System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("SystemMemoryInfo", 3, 3); + System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("Threads", 1, 1); + System.Windows.Forms.TreeNode treeNode12 = new System.Windows.Forms.TreeNode("ThreadInfo", 1, 1); + System.Windows.Forms.TreeNode treeNode13 = new System.Windows.Forms.TreeNode("ThreadNames", 1, 1); + System.Windows.Forms.TreeNode treeNode14 = new System.Windows.Forms.TreeNode("UnloadedModules", 2, 2); + System.Windows.Forms.TreeNode treeNode15 = new System.Windows.Forms.TreeNode("", new System.Windows.Forms.TreeNode[] { treeNode1, treeNode2, treeNode3, @@ -56,7 +58,9 @@ private void InitializeComponent() treeNode9, treeNode10, treeNode11, - treeNode12}); + treeNode12, + treeNode13, + treeNode14}); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.treeView1 = new System.Windows.Forms.TreeView(); @@ -103,72 +107,82 @@ private void InitializeComponent() this.treeView1.ImageList = this.treeViewImageList; this.treeView1.Location = new System.Drawing.Point(0, 0); this.treeView1.Name = "treeView1"; - treeNode1.ImageIndex = 6; + treeNode1.ImageIndex = 5; treeNode1.Name = "Node0"; - treeNode1.SelectedImageIndex = 6; - treeNode1.Tag = "Exception"; - treeNode1.Text = "Exception"; - treeNode2.ImageIndex = 4; + treeNode1.SelectedImageIndex = 5; + treeNode1.Tag = "CommentW"; + treeNode1.Text = "CommentW"; + treeNode2.ImageIndex = 6; treeNode2.Name = "Node0"; - treeNode2.SelectedImageIndex = 4; - treeNode2.Tag = "Handles"; - treeNode2.Text = "Handles"; - treeNode3.ImageIndex = 3; + treeNode2.SelectedImageIndex = 6; + treeNode2.Tag = "Exception"; + treeNode2.Text = "Exception"; + treeNode3.ImageIndex = 4; treeNode3.Name = "Node0"; - treeNode3.SelectedImageIndex = 3; - treeNode3.Tag = "Memory"; - treeNode3.Text = "Memory"; + treeNode3.SelectedImageIndex = 4; + treeNode3.Tag = "Handles"; + treeNode3.Text = "Handles"; treeNode4.ImageIndex = 3; treeNode4.Name = "Node0"; treeNode4.SelectedImageIndex = 3; - treeNode4.Tag = "Memory64"; - treeNode4.Text = "Memory64"; + treeNode4.Tag = "Memory"; + treeNode4.Text = "Memory"; treeNode5.ImageIndex = 3; treeNode5.Name = "Node0"; treeNode5.SelectedImageIndex = 3; - treeNode5.Tag = "MemoryInfo"; - treeNode5.Text = "MemoryInfo"; - treeNode6.ImageIndex = 5; + treeNode5.Tag = "Memory64"; + treeNode5.Text = "Memory64"; + treeNode6.ImageIndex = 3; treeNode6.Name = "Node0"; - treeNode6.SelectedImageIndex = 5; - treeNode6.Tag = "MiscInfo"; - treeNode6.Text = "MiscInfo"; - treeNode7.ImageIndex = 2; - treeNode7.Name = "Node2"; - treeNode7.SelectedImageIndex = 2; - treeNode7.Tag = "Modules"; - treeNode7.Text = "Modules"; - treeNode8.ImageIndex = 5; - treeNode8.Name = "Node0"; - treeNode8.SelectedImageKey = "DialogID_6220_16x.png"; - treeNode8.Tag = "SystemInfo"; - treeNode8.Text = "SystemInfo"; - treeNode9.ImageIndex = 3; + treeNode6.SelectedImageIndex = 3; + treeNode6.Tag = "MemoryInfo"; + treeNode6.Text = "MemoryInfo"; + treeNode7.ImageIndex = 5; + treeNode7.Name = "Node0"; + treeNode7.SelectedImageIndex = 5; + treeNode7.Tag = "MiscInfo"; + treeNode7.Text = "MiscInfo"; + treeNode8.ImageIndex = 2; + treeNode8.Name = "Node2"; + treeNode8.SelectedImageIndex = 2; + treeNode8.Tag = "Modules"; + treeNode8.Text = "Modules"; + treeNode9.ImageIndex = 5; treeNode9.Name = "Node0"; - treeNode9.SelectedImageIndex = 3; - treeNode9.Tag = "SystemMemoryInfo"; - treeNode9.Text = "SystemMemoryInfo"; - treeNode10.ImageIndex = 1; - treeNode10.Name = "Node1"; - treeNode10.SelectedImageIndex = 1; - treeNode10.Tag = "Threads"; - treeNode10.Text = "Threads"; + treeNode9.SelectedImageKey = "DialogID_6220_16x.png"; + treeNode9.Tag = "SystemInfo"; + treeNode9.Text = "SystemInfo"; + treeNode10.ImageIndex = 3; + treeNode10.Name = "Node0"; + treeNode10.SelectedImageIndex = 3; + treeNode10.Tag = "SystemMemoryInfo"; + treeNode10.Text = "SystemMemoryInfo"; treeNode11.ImageIndex = 1; - treeNode11.Name = "Node0"; + treeNode11.Name = "Node1"; treeNode11.SelectedImageIndex = 1; - treeNode11.Tag = "ThreadInfo"; - treeNode11.Text = "ThreadInfo"; - treeNode12.ImageIndex = 2; + treeNode11.Tag = "Threads"; + treeNode11.Text = "Threads"; + treeNode12.ImageIndex = 1; treeNode12.Name = "Node0"; - treeNode12.SelectedImageIndex = 2; - treeNode12.Tag = "UnloadedModules"; - treeNode12.Text = "UnloadedModules"; - treeNode13.ImageIndex = 0; + treeNode12.SelectedImageIndex = 1; + treeNode12.Tag = "ThreadInfo"; + treeNode12.Text = "ThreadInfo"; + treeNode13.ImageIndex = 1; treeNode13.Name = "Node0"; - treeNode13.Tag = "Summary"; - treeNode13.Text = ""; + treeNode13.SelectedImageIndex = 1; + treeNode13.Tag = "ThreadNames"; + treeNode13.Text = "ThreadNames"; + treeNode14.ImageIndex = 2; + treeNode14.Name = "Node0"; + treeNode14.SelectedImageIndex = 2; + treeNode14.Tag = "UnloadedModules"; + treeNode14.Text = "UnloadedModules"; + treeNode15.ImageIndex = 0; + treeNode15.Name = "Node0"; + treeNode15.Tag = "Summary"; + treeNode15.Text = ""; this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { - treeNode13}); + treeNode15}); this.treeView1.SelectedImageIndex = 0; this.treeView1.ShowNodeToolTips = true; this.treeView1.Size = new System.Drawing.Size(238, 705); diff --git a/MinidumpExplorer/MinidumpExplorer/MainForm.resx b/MinidumpExplorer/MinidumpExplorer/MainForm.resx index 72fa4ec..f4b793b 100644 --- a/MinidumpExplorer/MinidumpExplorer/MainForm.resx +++ b/MinidumpExplorer/MinidumpExplorer/MainForm.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACa - DAAAAk1TRnQBSQFMAgEBBwEAAeABAAHgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DAAAAk1TRnQBSQFMAgEBBwEAAfABAAHwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/MinidumpExplorer/MinidumpExplorer/MinidumpExplorer.csproj b/MinidumpExplorer/MinidumpExplorer/MinidumpExplorer.csproj index b83c143..a5e4b3b 100644 --- a/MinidumpExplorer/MinidumpExplorer/MinidumpExplorer.csproj +++ b/MinidumpExplorer/MinidumpExplorer/MinidumpExplorer.csproj @@ -9,12 +9,13 @@ Properties MinidumpExplorer MinidumpExplorer - v4.5 + v4.6.1 512 SAK SAK SAK SAK + AnyCPU @@ -47,6 +48,7 @@ prompt MinimumRecommendedRules.ruleset true + latest bin\x64\Release\ @@ -172,6 +174,12 @@ MemoryInfoView.cs + + UserControl + + + CommentStreamWView.cs + UserControl @@ -190,6 +198,12 @@ SystemMemoryInfoView.cs + + UserControl + + + ThreadNamesView.cs + UserControl @@ -281,6 +295,9 @@ MemoryInfoView.cs + + CommentStreamWView.cs + MiscInfoView.cs @@ -290,6 +307,9 @@ SystemMemoryInfoView.cs + + ThreadNamesView.cs + UnloadedModulesView.cs @@ -317,7 +337,9 @@ ThreadListView.cs - + + Designer + SettingsSingleFileGenerator @@ -330,7 +352,9 @@ - + + Designer + diff --git a/MinidumpExplorer/MinidumpExplorer/Properties/AssemblyInfo.cs b/MinidumpExplorer/MinidumpExplorer/Properties/AssemblyInfo.cs index 0e84136..211ee69 100644 --- a/MinidumpExplorer/MinidumpExplorer/Properties/AssemblyInfo.cs +++ b/MinidumpExplorer/MinidumpExplorer/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Minidump Explorer")] -[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.7.0.0")] -[assembly: AssemblyFileVersion("0.7.0.0")] +[assembly: AssemblyVersion("0.8.0.0")] +[assembly: AssemblyFileVersion("0.8.0.0")] diff --git a/MinidumpExplorer/MinidumpExplorer/Properties/Resources.Designer.cs b/MinidumpExplorer/MinidumpExplorer/Properties/Resources.Designer.cs index 6652810..05e184c 100644 --- a/MinidumpExplorer/MinidumpExplorer/Properties/Resources.Designer.cs +++ b/MinidumpExplorer/MinidumpExplorer/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace MinidumpExplorer.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/MinidumpExplorer/MinidumpExplorer/Properties/Settings.Designer.cs b/MinidumpExplorer/MinidumpExplorer/Properties/Settings.Designer.cs index 4470900..ae4f1cc 100644 --- a/MinidumpExplorer/MinidumpExplorer/Properties/Settings.Designer.cs +++ b/MinidumpExplorer/MinidumpExplorer/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace MinidumpExplorer.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/MinidumpExplorer/MinidumpExplorer/Views/CommentStreamWView.cs b/MinidumpExplorer/MinidumpExplorer/Views/CommentStreamWView.cs new file mode 100644 index 0000000..0de2987 --- /dev/null +++ b/MinidumpExplorer/MinidumpExplorer/Views/CommentStreamWView.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using DbgHelp.MinidumpFiles; + +namespace MinidumpExplorer.Views +{ + public partial class CommentStreamWView : BaseViewControl + { + private MiniDumpCommentStreamW _commentWStream; + + public CommentStreamWView() + { + InitializeComponent(); + } + + public CommentStreamWView(MiniDumpCommentStreamW commentWStream) + : this() + { + _commentWStream = commentWStream; + + if (commentWStream.Comment == null) + AddInfoNode("No data found for stream", ""); + else + AddInfoNode("Comment", _commentWStream.Comment); + } + + private void AddInfoNode(string label, string value) + { + ListViewItem newItem; + newItem = new ListViewItem(label); + newItem.SubItems.Add(value); + this.listView1.Items.Add(newItem); + } + } +} diff --git a/MinidumpExplorer/MinidumpExplorer/Views/CommentStreamWView.designer.cs b/MinidumpExplorer/MinidumpExplorer/Views/CommentStreamWView.designer.cs new file mode 100644 index 0000000..be2529f --- /dev/null +++ b/MinidumpExplorer/MinidumpExplorer/Views/CommentStreamWView.designer.cs @@ -0,0 +1,78 @@ +namespace MinidumpExplorer.Views +{ + partial class CommentStreamWView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.listView1 = new System.Windows.Forms.ListView(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView1 + // + this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2}); + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.FullRowSelect = true; + this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(805, 432); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + // + // columnHeader1 + // + this.columnHeader1.Text = "Field"; + this.columnHeader1.Width = 223; + // + // columnHeader2 + // + this.columnHeader2.Text = "Value"; + this.columnHeader2.Width = 508; + // + // MiscInfoView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView1); + this.Name = "MiscInfoView"; + this.Size = new System.Drawing.Size(805, 432); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + } +} diff --git a/MinidumpExplorer/MinidumpExplorer/Views/CommentStreamWView.resx b/MinidumpExplorer/MinidumpExplorer/Views/CommentStreamWView.resx new file mode 100644 index 0000000..d58980a --- /dev/null +++ b/MinidumpExplorer/MinidumpExplorer/Views/CommentStreamWView.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MinidumpExplorer/MinidumpExplorer/Views/ThreadNamesView.Designer.cs b/MinidumpExplorer/MinidumpExplorer/Views/ThreadNamesView.Designer.cs new file mode 100644 index 0000000..e24e279 --- /dev/null +++ b/MinidumpExplorer/MinidumpExplorer/Views/ThreadNamesView.Designer.cs @@ -0,0 +1,79 @@ +namespace MinidumpExplorer.Views +{ + partial class ThreadNamesView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.listView1 = new System.Windows.Forms.ListView(); + this.idHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.nameHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView1 + // + this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.idHeader, + this.nameHeader}); + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.FullRowSelect = true; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.MultiSelect = false; + this.listView1.Name = "listView1"; + this.listView1.ShowGroups = false; + this.listView1.Size = new System.Drawing.Size(919, 334); + this.listView1.TabIndex = 1; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + // + // idHeader + // + this.idHeader.Text = "Id"; + this.idHeader.Width = 120; + // + // nameHeader + // + this.nameHeader.Text = "Name"; + this.nameHeader.Width = 600; + // + // ThreadNamesView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView1); + this.Name = "ThreadNamesView"; + this.Size = new System.Drawing.Size(919, 334); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ColumnHeader idHeader; + private System.Windows.Forms.ColumnHeader nameHeader; + } +} \ No newline at end of file diff --git a/MinidumpExplorer/MinidumpExplorer/Views/ThreadNamesView.cs b/MinidumpExplorer/MinidumpExplorer/Views/ThreadNamesView.cs new file mode 100644 index 0000000..c827f56 --- /dev/null +++ b/MinidumpExplorer/MinidumpExplorer/Views/ThreadNamesView.cs @@ -0,0 +1,46 @@ +using DbgHelp.MinidumpFiles; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MinidumpExplorer.Views +{ + public partial class ThreadNamesView : UserControl // BaseViewControl + { + private MiniDumpThreadNamesStream _threadNamesStream; + + public ThreadNamesView() + { + InitializeComponent(); + } + + public ThreadNamesView(MiniDumpThreadNamesStream threadNamesStream) + : this() + { + this._threadNamesStream = threadNamesStream; + + if (_threadNamesStream.Entries.Count == 0) + { + this.listView1.Items.Add("No data found for stream"); + } + else + { + foreach (MiniDumpThreadName thread in _threadNamesStream.Entries) + { + ListViewItem newItem = new ListViewItem("0x" + thread.ThreadId.ToString("x8") + " (" + thread.ThreadId + ")"); + newItem.SubItems.Add(thread.Name); + + newItem.Tag = thread; + + this.listView1.Items.Add(newItem); + } + } + } + } +} diff --git a/MinidumpExplorer/MinidumpExplorer/Views/ThreadNamesView.resx b/MinidumpExplorer/MinidumpExplorer/Views/ThreadNamesView.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/MinidumpExplorer/MinidumpExplorer/Views/ThreadNamesView.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file