├── .gitattributes ├── .gitignore ├── DbgHelp ├── DbgHelp.cs ├── DbgHelp.csproj ├── Properties │ └── AssemblyInfo.cs └── filemap.cs ├── DebugProtocol ├── Breakpoint.cs ├── DebugConnection.cs ├── DebugControlAttribute.cs ├── DebugMemoryStream.cs ├── DebugProtocol.csproj ├── IDebugProtocol.cs ├── KDBG.cs ├── MemoryBlock.cs ├── Properties │ └── AssemblyInfo.cs └── Registers.cs ├── Installer ├── Installer.wixproj └── Product.wxs ├── Pipe ├── Pipe.csproj ├── Properties │ └── AssemblyInfo.cs ├── namedpipe.cs ├── pipe.cs ├── serialpipe.cs └── socketpipe.cs ├── README.md ├── ReactosDBG.sln ├── RosDBG ├── AboutDlg.Designer.cs ├── AboutDlg.cs ├── AboutDlg.resx ├── Connect.Designer.cs ├── Connect.cs ├── Connect.resx ├── ControlExtensions.cs ├── DebugConnection.cs ├── DebugControlAttribute.cs ├── DebugInfoFile.cs ├── DebugMemoryStream.cs ├── Diagnostics.cs ├── Dockable Objects │ ├── BackTrace.Designer.cs │ ├── BackTrace.cs │ ├── BackTrace.resx │ ├── BreakpointWindow.Designer.cs │ ├── BreakpointWindow.cs │ ├── BreakpointWindow.resx │ ├── Locals.Designer.cs │ ├── Locals.cs │ ├── Locals.resx │ ├── MemoryWindow.Designer.cs │ ├── MemoryWindow.cs │ ├── MemoryWindow.resx │ ├── Modules.Designer.cs │ ├── Modules.cs │ ├── Modules.resx │ ├── ProcThread.Designer.cs │ ├── ProcThread.cs │ ├── ProcThread.resx │ ├── RawTraffic.Designer.cs │ ├── RawTraffic.cs │ ├── RawTraffic.resx │ ├── ReactOSWeb.Designer.cs │ ├── ReactOSWeb.cs │ ├── ReactOSWeb.resx │ ├── RegisterView.Designer.cs │ ├── RegisterView.cs │ ├── RegisterView.resx │ ├── SourceView.Designer.cs │ ├── SourceView.cs │ ├── SourceView.resx │ ├── StatefulRegisterView.Designer.cs │ ├── StatefulRegisterView.cs │ ├── StatefulRegisterView.resx │ ├── ToolWindow.Designer.cs │ └── ToolWindow.cs ├── EditBreakpointDialog.Designer.cs ├── EditBreakpointDialog.cs ├── EditBreakpointDialog.resx ├── ExtTools.Designer.cs ├── ExtTools.cs ├── ExtTools.resx ├── FileDirChooser.cs ├── HighLevelInteraction.cs ├── IShell.cs ├── IUseDebugConnection.cs ├── IUseSymbols.cs ├── MainWindow.Designer.cs ├── MainWindow.cs ├── MainWindow.resx ├── Module.cs ├── ModuleIndex.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── DataSources │ │ └── .gitignore │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ReactOSWeb.cs ├── Registers.cs ├── Resources │ ├── Pause.bmp │ ├── Run.bmp │ ├── StepIn.png │ ├── StepOut.png │ ├── StepOver.png │ ├── copyToolStripMenuItem.Image.png │ ├── emblem-system.ico │ ├── internet-web-browser.ico │ └── utilities-terminal.ico ├── RosDBG.csproj ├── RosDBG.sln ├── Settings.Designer.cs ├── Settings.cs ├── Settings.resx ├── StatefulVariable.cs ├── StatefulX86Registers.cs ├── app-rosdbg.ico ├── app.config ├── gdb.cs ├── gdbbase.cs ├── hextest.cs └── socketpipe.cs ├── WinFormsUI ├── Docking │ ├── AutoHideStripBase.cs │ ├── DockAreasEditor.cs │ ├── DockContent.cs │ ├── DockContentCollection.cs │ ├── DockContentEventArgs.cs │ ├── DockContentHandler.cs │ ├── DockOutlineBase.cs │ ├── DockPane.SplitterControl.cs │ ├── DockPane.cs │ ├── DockPaneCaptionBase.cs │ ├── DockPaneCollection.cs │ ├── DockPaneStripBase.cs │ ├── DockPanel.AutoHideWindow.cs │ ├── DockPanel.DockDragHandler.cs │ ├── DockPanel.DragHandler.cs │ ├── DockPanel.FocusManager.cs │ ├── DockPanel.MdiClientController.cs │ ├── DockPanel.Persistor.cs │ ├── DockPanel.SplitterDragHandler.cs │ ├── DockPanel.bmp │ ├── DockPanel.cs │ ├── DockPanelExtender.cs │ ├── DockPanelSkin.cs │ ├── DockWindow.SplitterControl.cs │ ├── DockWindow.cs │ ├── DockWindowCollection.cs │ ├── DragForm.cs │ ├── DummyControl.cs │ ├── Enums.cs │ ├── FloatWindow.cs │ ├── FloatWindowCollection.cs │ ├── Helpers │ │ ├── DockHelper.cs │ │ ├── DrawHelper.cs │ │ ├── ResourceHelper.cs │ │ └── Win32Helper.cs │ ├── InertButtonBase.cs │ ├── Interfaces.cs │ ├── Localization.cs │ ├── Measures.cs │ ├── NestedDockingStatus.cs │ ├── NestedPaneCollection.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Resources │ │ ├── DockIndicator_PaneDiamond.bmp │ │ ├── DockIndicator_PaneDiamond_Bottom.bmp │ │ ├── DockIndicator_PaneDiamond_Hotspot.bmp │ │ ├── DockIndicator_PaneDiamond_HotspotIndex.bmp │ │ ├── DockIndicator_PaneDiamond_Left.bmp │ │ ├── DockIndicator_PaneDiamond_Right.bmp │ │ ├── DockIndicator_PaneDiamond_Top.bmp │ │ ├── DockIndicator_PanelBottom.bmp │ │ ├── DockIndicator_PanelBottom_Active.bmp │ │ ├── DockIndicator_PanelFill.bmp │ │ ├── DockIndicator_PanelFill_Active.bmp │ │ ├── DockIndicator_PanelLeft.bmp │ │ ├── DockIndicator_PanelLeft_Active.bmp │ │ ├── DockIndicator_PanelRight.bmp │ │ ├── DockIndicator_PanelRight_Active.bmp │ │ ├── DockIndicator_PanelTop.bmp │ │ ├── DockIndicator_PanelTop_Active.bmp │ │ ├── DockPane_AutoHide.bmp │ │ ├── DockPane_Close.bmp │ │ ├── DockPane_Dock.bmp │ │ ├── DockPane_Option.bmp │ │ ├── DockPane_OptionOverflow.bmp │ │ ├── Dockindicator_PaneDiamond_Fill.bmp │ │ └── Thumbs.db │ ├── SplitterBase.cs │ ├── Strings.Designer.cs │ ├── Strings.resx │ ├── VS2005AutoHideStrip.cs │ ├── VS2005DockPaneCaption.cs │ ├── VS2005DockPaneStrip.cs │ ├── VisibleNestedPaneCollection.cs │ └── Win32 │ │ ├── Enums.cs │ │ └── NativeMethods.cs ├── Properties │ └── AssemblyInfo.cs ├── WinFormsUI.csproj └── license.txt ├── buildhelper ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── buildhelper.csproj └── dbghelptest ├── Makefile ├── dbghelp.dll ├── dbghelp.h ├── libdbghelp.a └── testline.c /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /DbgHelp/DbgHelp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.30729 7 | 2.0 8 | {3442437A-CB9C-4C73-B35B-3F6E4F60F3B2} 9 | Library 10 | Properties 11 | DbgHelpAPI 12 | DbgHelp.NET 13 | v3.5 14 | 512 15 | false 16 | 17 | 18 | 3.5 19 | 20 | publish\ 21 | true 22 | Disk 23 | false 24 | Foreground 25 | 7 26 | Days 27 | false 28 | false 29 | true 30 | 0 31 | 1.0.0.%2a 32 | false 33 | false 34 | true 35 | 36 | 37 | true 38 | full 39 | false 40 | bin\Debug\ 41 | DEBUG;TRACE 42 | prompt 43 | 4 44 | AllRules.ruleset 45 | 46 | 47 | pdbonly 48 | true 49 | bin\Release\ 50 | TRACE 51 | prompt 52 | 4 53 | AnyCPU 54 | AllRules.ruleset 55 | 56 | 57 | true 58 | bin\x86\Debug\ 59 | DEBUG;TRACE 60 | full 61 | x86 62 | prompt 63 | AllRules.ruleset 64 | 65 | 66 | bin\x86\Release\ 67 | TRACE 68 | true 69 | pdbonly 70 | x86 71 | prompt 72 | AllRules.ruleset 73 | 74 | 75 | 76 | 77 | 3.5 78 | 79 | 80 | 3.5 81 | 82 | 83 | 3.5 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | False 96 | .NET Framework 3.5 SP1 Client Profile 97 | false 98 | 99 | 100 | False 101 | .NET Framework 3.5 SP1 102 | true 103 | 104 | 105 | False 106 | Windows Installer 3.1 107 | true 108 | 109 | 110 | 111 | 118 | -------------------------------------------------------------------------------- /DbgHelp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DbgHelp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DbgHelp")] 13 | [assembly: AssemblyCopyright("Copyright © 2008")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("57c04d47-195b-446d-9587-aab81c574154")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DbgHelp/filemap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | 5 | namespace DbgHelpAPI 6 | { 7 | public class FileMap 8 | { 9 | string []mDirectories = new string [] { "output-MinGW-i386" }; 10 | Dictionary> mFileByShortName = new Dictionary>(); 11 | 12 | public string GetFilePathFromShortName(string shortname) 13 | { 14 | List possibleMatches; 15 | if (mFileByShortName.TryGetValue(shortname.ToLower(), out possibleMatches) && 16 | possibleMatches.Count > 0) 17 | { 18 | return possibleMatches[0]; 19 | } 20 | return null; 21 | } 22 | 23 | public string []Directories 24 | { 25 | get 26 | { 27 | return mDirectories; 28 | } 29 | set 30 | { 31 | mDirectories = value; 32 | Scan(); 33 | } 34 | } 35 | 36 | public FileMap() 37 | { 38 | Scan(); 39 | } 40 | 41 | // Returns the directories that were scanned 42 | public string []Scan() 43 | { 44 | mFileByShortName.Clear(); 45 | 46 | List directoriesScanned = new List(); 47 | 48 | foreach (string dir in mDirectories) 49 | try 50 | { 51 | if (Directory.Exists(dir)) 52 | Scan(dir); 53 | directoriesScanned.Add(dir); 54 | } 55 | catch (Exception) 56 | { 57 | } 58 | 59 | return directoriesScanned.ToArray(); 60 | } 61 | 62 | void RecordFileNamePossibility(string name, string fullpath) 63 | { 64 | List possibilities; 65 | if (mFileByShortName.TryGetValue(name, out possibilities)) 66 | possibilities.Add(fullpath); 67 | else 68 | mFileByShortName[name.ToLower()] = new List(new string [] { fullpath }); 69 | } 70 | 71 | void RecordFileName(string name) 72 | { 73 | string shortfname = Path.GetFileName(name); 74 | string shortnoext = Path.GetFileNameWithoutExtension(name); 75 | RecordFileNamePossibility(shortfname, name); 76 | RecordFileNamePossibility(shortnoext, name); 77 | } 78 | 79 | void Scan(string root) 80 | { 81 | foreach (string file in Directory.GetFiles(root)) 82 | RecordFileName(file); 83 | 84 | foreach (string dir in Directory.GetDirectories(root)) 85 | { 86 | try 87 | { 88 | Scan(dir); 89 | } 90 | catch (Exception) 91 | { 92 | } 93 | } 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /DebugProtocol/Breakpoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace DebugProtocol 7 | { 8 | public class Breakpoint 9 | { 10 | public enum BPType { Software, Hardware, WriteWatch, ReadWatch, AccessWatch }; 11 | 12 | public int ID { get; set; } 13 | public BPType BreakpointType { get; set; } 14 | public ulong Address { get; set; } 15 | public int Length { get; set; } 16 | public string Condition { get; set; } 17 | public bool Enabled { get; set; } 18 | 19 | public Breakpoint(int id) 20 | { 21 | ID = id; 22 | BreakpointType = BPType.Software; 23 | Address = 0; 24 | Length = 1; 25 | Condition = string.Empty; 26 | Enabled = false; 27 | } 28 | 29 | public Breakpoint(int id, BPType type, ulong addr, int len, string cond) 30 | { 31 | ID = id; 32 | BreakpointType = type; 33 | Address = addr; 34 | Length = len; 35 | Condition = cond; 36 | Enabled = false; 37 | } 38 | 39 | //TODO: include condition/enabled in hashcode? 40 | public override int GetHashCode() 41 | { 42 | return (int)(((int)BreakpointType) ^ (int)Address ^ (Length << 28)); 43 | } 44 | 45 | public override bool Equals(object other) 46 | { 47 | Breakpoint otherbp = other as Breakpoint; 48 | if (otherbp == null) return false; 49 | return 50 | otherbp.ID == ID;/* 51 | (otherbp.BreakpointType == BreakpointType) && 52 | (otherbp.Address == Address) && 53 | (otherbp.Length == Length);*/ 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /DebugProtocol/DebugControlAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace RosDBG 7 | { 8 | public class DebugControlAttribute : Attribute 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DebugProtocol/IDebugProtocol.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace DebugProtocol 7 | { 8 | #region Event defs 9 | public class ConsoleOutputEventArgs : EventArgs 10 | { 11 | public readonly string Line; 12 | public ConsoleOutputEventArgs(string line) 13 | { 14 | Line = line; 15 | } 16 | } 17 | public delegate void ConsoleOutputEventHandler(object sender, ConsoleOutputEventArgs args); 18 | 19 | public class RegisterChangeEventArgs : EventArgs 20 | { 21 | public readonly List Registers; 22 | public RegisterChangeEventArgs(IEnumerable registers) 23 | { 24 | Registers = new List(registers); 25 | } 26 | } 27 | public delegate void RegisterChangeEventHandler(object sender, RegisterChangeEventArgs args); 28 | 29 | public class BreakpointChangeEventArgs : EventArgs 30 | { 31 | public readonly IList Breakpoints; 32 | public BreakpointChangeEventArgs(IEnumerable breakpoints) 33 | { 34 | Breakpoints = new List(breakpoints); 35 | } 36 | } 37 | public delegate void BreakpointChangeEventHandler(object sender, BreakpointChangeEventArgs args); 38 | 39 | public class SignalDeliveredEventArgs : EventArgs 40 | { 41 | public readonly int Signal; 42 | public SignalDeliveredEventArgs(int sig) 43 | { 44 | Signal = sig; 45 | } 46 | } 47 | public delegate void SignalDeliveredEventHandler(object sender, SignalDeliveredEventArgs args); 48 | 49 | public class RemoteGDBErrorArgs : EventArgs 50 | { 51 | public readonly int Error; 52 | public RemoteGDBErrorArgs(int error) 53 | { 54 | Error = error; 55 | } 56 | } 57 | public delegate void RemoteGDBErrorHandler(object sender, RemoteGDBErrorArgs args); 58 | 59 | public class MemoryUpdateEventArgs : EventArgs 60 | { 61 | public readonly ulong Address; 62 | public readonly byte[] Memory; 63 | public MemoryUpdateEventArgs(ulong address, byte[] memory) 64 | { 65 | Address = address; 66 | Memory = memory; 67 | } 68 | } 69 | public delegate void MemoryUpdateEventHandler(object sender, MemoryUpdateEventArgs args); 70 | 71 | public class ModuleListEventArgs : EventArgs 72 | { 73 | public readonly ulong Address; 74 | public readonly string Module; 75 | public ModuleListEventArgs(string module, ulong address) 76 | { 77 | Module = module; 78 | Address = address; 79 | } 80 | } 81 | public delegate void ModuleListEventHandler(object sender, ModuleListEventArgs args); 82 | 83 | public class ProcessListEventArgs : EventArgs 84 | { 85 | public readonly bool Reset, Current, End; 86 | public readonly ulong Pid; 87 | public readonly string Name, State; 88 | public ProcessListEventArgs() { Reset = true; } 89 | public ProcessListEventArgs(bool end) { End = true; } 90 | public ProcessListEventArgs(ulong pid, bool current, string state, string name) { Current = current; Pid = pid; State = state; Name = name; } 91 | } 92 | 93 | public delegate void ProcessListEventHandler(object sender, ProcessListEventArgs args); 94 | 95 | public class ThreadListEventArgs : EventArgs 96 | { 97 | public readonly bool Reset, Current, End; 98 | public readonly ulong Tid, Eip; 99 | public ThreadListEventArgs() { Reset = true; } 100 | public ThreadListEventArgs(bool end) { End = true; } 101 | public ThreadListEventArgs(ulong tid, bool current, ulong eip) { Current = current; Tid = tid; Eip = eip; } 102 | } 103 | 104 | public delegate void ThreadListEventHandler(object sender, ThreadListEventArgs args); 105 | #endregion 106 | 107 | public interface IDebugProtocol 108 | { 109 | event ConsoleOutputEventHandler ConsoleOutputEvent; 110 | event RegisterChangeEventHandler RegisterChangeEvent; 111 | event BreakpointChangeEventHandler BreakpointChangeEvent; 112 | event SignalDeliveredEventHandler SignalDeliveredEvent; 113 | event RemoteGDBErrorHandler RemoteGDBError; 114 | event MemoryUpdateEventHandler MemoryUpdateEvent; 115 | event ModuleListEventHandler ModuleListEvent; 116 | event ProcessListEventHandler ProcessListEvent; 117 | event ThreadListEventHandler ThreadListEvent; 118 | 119 | void GetRegisterUpdate(); 120 | void GetModuleUpdate(); 121 | void GetMemoryUpdate(ulong address, int len); 122 | void GetProcesses(); 123 | void GetThreads(ulong pid); 124 | void WriteMemory(ulong address, byte[] buf); 125 | void Step(); 126 | void Next(); 127 | void Break(); 128 | void Go(ulong address); 129 | 130 | void GetBreakpoints(); 131 | void SetBreakpoint(Breakpoint bp); 132 | void RemoveBreakpoint(int id); 133 | void EnableBreakpoint(int id); 134 | void DisableBreakpoint(int id); 135 | 136 | void SetProcess(ulong pid); 137 | void SetThread(ulong tid); 138 | 139 | void Write(string wr); 140 | 141 | void Close(); 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /DebugProtocol/MemoryBlock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace DebugProtocol 7 | { 8 | public class MemoryBlock 9 | { 10 | public readonly long Address; 11 | public readonly byte[] Block; 12 | static int mMemoryBlockSize = 256; 13 | public MemoryBlock(long address) 14 | { 15 | Address = address; 16 | Block = new byte[mMemoryBlockSize]; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DebugProtocol/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DebugProtocol")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DebugProtocol")] 13 | [assembly: AssemblyCopyright("Copyright © 2008")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("47790402-dacc-4e5c-b956-cc1205eadaab")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DebugProtocol/Registers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.ComponentModel; 7 | 8 | namespace DebugProtocol 9 | { 10 | public class UlongToHexTypeConverter : TypeConverter 11 | { 12 | public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 13 | { 14 | if (sourceType == typeof(string)) 15 | return true; 16 | else 17 | return base.CanConvertFrom(context, sourceType); 18 | } 19 | 20 | public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 21 | { 22 | if (destinationType == typeof(string)) 23 | return true; 24 | else 25 | return base.CanConvertTo(context, destinationType); 26 | } 27 | 28 | public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 29 | { 30 | if (destinationType == typeof(string) && value.GetType() == typeof(ulong)) 31 | return string.Format("0x{0:X8}", value); 32 | else 33 | return base.ConvertTo(context, culture, value, destinationType); 34 | } 35 | 36 | public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) 37 | { 38 | if (value.GetType() == typeof(string)) 39 | { 40 | string input = (string)value; 41 | 42 | if (input.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) 43 | { 44 | input = input.Substring(2); 45 | } 46 | 47 | return ulong.Parse(input, NumberStyles.HexNumber, culture); 48 | } 49 | else 50 | { 51 | return base.ConvertFrom(context, culture, value); 52 | } 53 | } 54 | } 55 | 56 | public class Registers 57 | { 58 | [TypeConverter(typeof(UlongToHexTypeConverter))] 59 | public ulong Eax { get { return RegisterSet[0]; } set { RegisterSet[0] = value; } } 60 | [TypeConverter(typeof(UlongToHexTypeConverter))] 61 | public ulong Ecx { get { return RegisterSet[1]; } set { RegisterSet[1] = value; } } 62 | [TypeConverter(typeof(UlongToHexTypeConverter))] 63 | public ulong Edx { get { return RegisterSet[2]; } set { RegisterSet[2] = value; } } 64 | [TypeConverter(typeof(UlongToHexTypeConverter))] 65 | public ulong Ebx { get { return RegisterSet[3]; } set { RegisterSet[3] = value; } } 66 | [TypeConverter(typeof(UlongToHexTypeConverter))] 67 | public ulong Esp { get { return RegisterSet[4]; } set { RegisterSet[4] = value; } } 68 | [TypeConverter(typeof(UlongToHexTypeConverter))] 69 | public ulong Ebp { get { return RegisterSet[5]; } set { RegisterSet[5] = value; } } 70 | [TypeConverter(typeof(UlongToHexTypeConverter))] 71 | public ulong Esi { get { return RegisterSet[6]; } set { RegisterSet[6] = value; } } 72 | [TypeConverter(typeof(UlongToHexTypeConverter))] 73 | public ulong Edi { get { return RegisterSet[7]; } set { RegisterSet[7] = value; } } 74 | [TypeConverter(typeof(UlongToHexTypeConverter))] 75 | public ulong Eip { get { return RegisterSet[8]; } set { RegisterSet[8] = value; } } 76 | [TypeConverter(typeof(UlongToHexTypeConverter))] 77 | public ulong Eflags { get { return RegisterSet[9]; } set { RegisterSet[9] = value; } } 78 | [TypeConverter(typeof(UlongToHexTypeConverter))] 79 | public ulong Cs { get { return RegisterSet[10]; } set { RegisterSet[10] = value; } } 80 | [TypeConverter(typeof(UlongToHexTypeConverter))] 81 | public ulong Ds { get { return RegisterSet[11]; } set { RegisterSet[11] = value; } } 82 | [TypeConverter(typeof(UlongToHexTypeConverter))] 83 | public ulong Es { get { return RegisterSet[12]; } set { RegisterSet[12] = value; } } 84 | [TypeConverter(typeof(UlongToHexTypeConverter))] 85 | public ulong Fs { get { return RegisterSet[13]; } set { RegisterSet[13] = value; } } 86 | [TypeConverter(typeof(UlongToHexTypeConverter))] 87 | public ulong Gs { get { return RegisterSet[14]; } set { RegisterSet[14] = value; } } 88 | [TypeConverter(typeof(UlongToHexTypeConverter))] 89 | public ulong Ss { get { return RegisterSet[15]; } set { RegisterSet[15] = value; } } 90 | public ulong[] RegisterSet = new ulong[32]; 91 | 92 | public void Clear() 93 | { 94 | RegisterSet = new ulong[32]; 95 | } 96 | 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Installer/Installer.wixproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 3.0 7 | {b2c4fede-c383-49a2-b871-d17da238bb47} 8 | 2.0 9 | RosDbg 10 | Package 11 | $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.5\Wix2010.targets 12 | $(MSBuildExtensionsPath)\Microsoft\WiX\v3.5\Wix2010.targets 13 | 14 | 15 | bin\$(Configuration)\ 16 | obj\$(Configuration)\ 17 | Debug 18 | 19 | 20 | bin\$(Configuration)\ 21 | obj\$(Configuration)\ 22 | 23 | 24 | 25 | 26 | 27 | 28 | DbgHelp 29 | {3442437a-cb9c-4c73-b35b-3f6e4f60f3b2} 30 | True 31 | 32 | 33 | DebugProtocol 34 | {76a02c1d-4b11-4d43-966e-e5c053870d65} 35 | True 36 | 37 | 38 | Pipe 39 | {f943218a-0a5e-436e-a7a4-475f37f45fa8} 40 | True 41 | 42 | 43 | RosDBG 44 | {fb776bfe-d2c2-465e-b713-6ad82cae1a39} 45 | True 46 | 47 | 48 | WinFormsUI 49 | {c75532c4-765b-418e-b09b-46d36b2abdb1} 50 | True 51 | 52 | 53 | 54 | 55 | $(WixExtDir)\WixNetFxExtension.dll 56 | WixNetFxExtension 57 | 58 | 59 | $(WixExtDir)\WixUIExtension.dll 60 | WixUIExtension 61 | 62 | 63 | 64 | 72 | 73 | "$(SolutionDir)buildhelper" "$(SolutionDir)temp.exe" "$(ProjectDir)version.wxs" 74 | del "$(SolutionDir)temp.exe" 75 | 76 | -------------------------------------------------------------------------------- /Pipe/Pipe.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.30729 7 | 2.0 8 | {F943218A-0A5E-436E-A7A4-475F37F45FA8} 9 | Library 10 | Properties 11 | Pipe 12 | Pipe 13 | v3.5 14 | 512 15 | 16 | 17 | 3.5 18 | 19 | publish\ 20 | true 21 | Disk 22 | false 23 | Foreground 24 | 7 25 | Days 26 | false 27 | false 28 | true 29 | 0 30 | 1.0.0.%2a 31 | false 32 | false 33 | true 34 | 35 | 36 | true 37 | full 38 | false 39 | bin\Debug\ 40 | DEBUG;TRACE 41 | prompt 42 | 4 43 | AllRules.ruleset 44 | 45 | 46 | pdbonly 47 | true 48 | bin\Release\ 49 | TRACE 50 | prompt 51 | 4 52 | AnyCPU 53 | AllRules.ruleset 54 | 55 | 56 | true 57 | bin\x86\Debug\ 58 | DEBUG;TRACE 59 | full 60 | x86 61 | prompt 62 | AllRules.ruleset 63 | 64 | 65 | bin\x86\Release\ 66 | TRACE 67 | true 68 | pdbonly 69 | x86 70 | prompt 71 | AllRules.ruleset 72 | 73 | 74 | 75 | 76 | 3.5 77 | 78 | 79 | 3.5 80 | 81 | 82 | 3.5 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | False 97 | .NET Framework 3.5 SP1 Client Profile 98 | false 99 | 100 | 101 | False 102 | .NET Framework 3.5 SP1 103 | true 104 | 105 | 106 | False 107 | Windows Installer 3.1 108 | true 109 | 110 | 111 | 112 | 119 | -------------------------------------------------------------------------------- /Pipe/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Pipe")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Pipe")] 13 | [assembly: AssemblyCopyright("Copyright © 2008")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("829e9727-eae7-4365-866a-7079b2a5ef6c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Pipe/pipe.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace AbstractPipe 7 | { 8 | public class PipeReceiveEventArgs 9 | { 10 | public readonly string Received; 11 | public PipeReceiveEventArgs(string received) 12 | { 13 | Received = received; 14 | } 15 | } 16 | public delegate void PipeReceiveEventHandler(object sender, PipeReceiveEventArgs args); 17 | 18 | public class PipeErrorEventArgs 19 | { 20 | public readonly string ErrorDesc; 21 | public PipeErrorEventArgs(string error) 22 | { 23 | ErrorDesc = error; 24 | } 25 | } 26 | public delegate void PipeErrorEventHandler(object sender, PipeErrorEventArgs args); 27 | 28 | public interface Pipe 29 | { 30 | event PipeReceiveEventHandler PipeReceiveEvent; 31 | event PipeErrorEventHandler PipeErrorEvent; 32 | bool Write(string output); 33 | } 34 | 35 | public interface NPipe 36 | { 37 | event EventHandler ClientConnectedEvent; 38 | event EventHandler ClientDisconnectedEvent; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Pipe/serialpipe.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.IO.Ports; 4 | 5 | namespace AbstractPipe 6 | { 7 | public class SerialPipe : Pipe 8 | { 9 | SerialPort mSerialPort; 10 | int mBufSize; 11 | 12 | public event PipeReceiveEventHandler PipeReceiveEvent; 13 | public event PipeErrorEventHandler PipeErrorEvent; 14 | 15 | public SerialPipe(SerialPort port) 16 | { 17 | mSerialPort = port; 18 | mBufSize = mSerialPort.WriteBufferSize; 19 | //try to get older input once without timeout (to avoid blocking behaviour) 20 | mSerialPort.ReadTimeout = 10; 21 | try 22 | { 23 | String buf = mSerialPort.ReadLine(); 24 | if (buf.Length > 0 && PipeReceiveEvent != null) 25 | PipeReceiveEvent.Invoke(this, new PipeReceiveEventArgs(buf)); 26 | } 27 | catch (TimeoutException) { } 28 | catch (Exception e) 29 | { 30 | if (PipeErrorEvent != null) 31 | PipeErrorEvent.Invoke(this, new PipeErrorEventArgs(e.Message)); 32 | } 33 | mSerialPort.ReadTimeout = -1; 34 | //set up internal handlers 35 | mSerialPort.DataReceived += SerialPortDataReceived; 36 | mSerialPort.ErrorReceived += SerialPortErrorReceived; 37 | } 38 | 39 | public bool Write(string output) 40 | { 41 | lock (this) 42 | { 43 | if (mSerialPort == null) return false; 44 | try 45 | { 46 | byte[] outbuf = UTF8Encoding.UTF8.GetBytes(output); 47 | int off = 0, len; 48 | //supply the output according to the buffer size, might not be needed 49 | do 50 | { 51 | if (output.Length - off > mBufSize) 52 | { 53 | len = mBufSize; 54 | } 55 | else 56 | { 57 | len = output.Length - off; 58 | } 59 | mSerialPort.Write(outbuf, off, len); 60 | off += len; 61 | } 62 | while (off < outbuf.Length); 63 | return off == outbuf.Length; 64 | } 65 | catch (Exception e) 66 | { 67 | mSerialPort.Close(); 68 | if (PipeErrorEvent != null) 69 | PipeErrorEvent.Invoke(this, new PipeErrorEventArgs(e.Message)); 70 | return false; 71 | } 72 | } 73 | } 74 | 75 | public void SerialPortDataReceived(object sender, SerialDataReceivedEventArgs args) 76 | { 77 | if (PipeReceiveEvent != null) 78 | PipeReceiveEvent.Invoke(this, new PipeReceiveEventArgs(mSerialPort.ReadExisting())); 79 | } 80 | 81 | public void SerialPortErrorReceived(object sender, SerialErrorReceivedEventArgs args) 82 | { 83 | /* port will be closed by debug connection */ 84 | if (PipeErrorEvent != null) 85 | PipeErrorEvent.Invoke(this, new PipeErrorEventArgs(args.EventType.ToString())); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Pipe/socketpipe.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Net.Sockets; 4 | 5 | namespace AbstractPipe 6 | { 7 | public class SocketPipe : Pipe 8 | { 9 | Socket mSocket; 10 | byte []mBuf = new byte[4096]; 11 | IAsyncResult mResult; 12 | 13 | public event PipeReceiveEventHandler PipeReceiveEvent; 14 | public event PipeErrorEventHandler PipeErrorEvent; 15 | 16 | public bool Write(string output) 17 | { 18 | lock (this) 19 | { 20 | if (mSocket == null) return false; 21 | try 22 | { 23 | byte[] outbuf = UTF8Encoding.UTF8.GetBytes(output); 24 | int off = 0, res; 25 | do 26 | { 27 | res = mSocket.Send(outbuf, off, outbuf.Length - off, SocketFlags.None); 28 | if (res > 0) 29 | off += res; 30 | } 31 | while (off < outbuf.Length && res != -1); 32 | return off == outbuf.Length; 33 | } 34 | catch (System.Net.Sockets.SocketException se) 35 | { 36 | mSocket.Close(); 37 | if (PipeErrorEvent != null) 38 | PipeErrorEvent.Invoke(this, new PipeErrorEventArgs(se.Message)); 39 | return false; 40 | } 41 | catch (Exception) { return false; } 42 | } 43 | } 44 | 45 | public void TriggerReadable(IAsyncResult result) 46 | { 47 | try 48 | { 49 | int bytes = mSocket.EndReceive(result); 50 | string datastr = UTF8Encoding.UTF8.GetString(mBuf, 0, bytes); 51 | if (PipeReceiveEvent != null) 52 | PipeReceiveEvent.Invoke(this, new PipeReceiveEventArgs(datastr)); 53 | do 54 | { 55 | mResult = mSocket.BeginReceive 56 | (mBuf, 0, mBuf.Length, SocketFlags.None, TriggerReadable, this); 57 | } while (mResult.CompletedSynchronously); 58 | 59 | } 60 | catch (Exception e) 61 | { 62 | mSocket.Close(); 63 | if (PipeErrorEvent != null) 64 | PipeErrorEvent.Invoke(this, new PipeErrorEventArgs(e.Message)); 65 | } 66 | } 67 | 68 | public SocketPipe(Socket socket) 69 | { 70 | mSocket = socket; 71 | do 72 | { 73 | mResult = mSocket.BeginReceive 74 | (mBuf, 0, mBuf.Length, SocketFlags.None, TriggerReadable, this); 75 | } while (mResult.CompletedSynchronously); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## [ReactOS](https://github.com/reactos/reactos) Remote Debugger 2 | 3 | ![image](https://user-images.githubusercontent.com/25367511/62729925-a23e6600-ba27-11e9-8c09-95666b7d930b.png) 4 | 5 | ## Requirements 6 | 7 | - OS: ReactOS™ or Microsoft® Windows™ XP and higher 8 | - .NET Framework 3.5 9 | 10 | ## Building 11 | 12 | Use Visual Studio 2010+ to build this program. 13 | -------------------------------------------------------------------------------- /ReactosDBG.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RosDBG", "RosDBG\RosDBG.csproj", "{FB776BFE-D2C2-465E-B713-6AD82CAE1A39}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C} = {D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C} 7 | EndProjectSection 8 | EndProject 9 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebugProtocol", "DebugProtocol\DebugProtocol.csproj", "{76A02C1D-4B11-4D43-966E-E5C053870D65}" 10 | EndProject 11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pipe", "Pipe\Pipe.csproj", "{F943218A-0A5E-436E-A7A4-475F37F45FA8}" 12 | EndProject 13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgHelp", "DbgHelp\DbgHelp.csproj", "{3442437A-CB9C-4C73-B35B-3F6E4F60F3B2}" 14 | EndProject 15 | Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "Installer\Installer.wixproj", "{B2C4FEDE-C383-49A2-B871-D17DA238BB47}" 16 | ProjectSection(ProjectDependencies) = postProject 17 | {D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C} = {D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C} 18 | EndProjectSection 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "WinFormsUI\WinFormsUI.csproj", "{C75532C4-765B-418E-B09B-46D36B2ABDB1}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "buildhelper", "buildhelper\buildhelper.csproj", "{D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|x86 = Debug|x86 27 | Release|x86 = Release|x86 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {FB776BFE-D2C2-465E-B713-6AD82CAE1A39}.Debug|x86.ActiveCfg = Debug|x86 31 | {FB776BFE-D2C2-465E-B713-6AD82CAE1A39}.Debug|x86.Build.0 = Debug|x86 32 | {FB776BFE-D2C2-465E-B713-6AD82CAE1A39}.Release|x86.ActiveCfg = Release|x86 33 | {FB776BFE-D2C2-465E-B713-6AD82CAE1A39}.Release|x86.Build.0 = Release|x86 34 | {76A02C1D-4B11-4D43-966E-E5C053870D65}.Debug|x86.ActiveCfg = Debug|x86 35 | {76A02C1D-4B11-4D43-966E-E5C053870D65}.Debug|x86.Build.0 = Debug|x86 36 | {76A02C1D-4B11-4D43-966E-E5C053870D65}.Release|x86.ActiveCfg = Release|x86 37 | {76A02C1D-4B11-4D43-966E-E5C053870D65}.Release|x86.Build.0 = Release|x86 38 | {F943218A-0A5E-436E-A7A4-475F37F45FA8}.Debug|x86.ActiveCfg = Debug|x86 39 | {F943218A-0A5E-436E-A7A4-475F37F45FA8}.Debug|x86.Build.0 = Debug|x86 40 | {F943218A-0A5E-436E-A7A4-475F37F45FA8}.Release|x86.ActiveCfg = Release|x86 41 | {F943218A-0A5E-436E-A7A4-475F37F45FA8}.Release|x86.Build.0 = Release|x86 42 | {3442437A-CB9C-4C73-B35B-3F6E4F60F3B2}.Debug|x86.ActiveCfg = Debug|x86 43 | {3442437A-CB9C-4C73-B35B-3F6E4F60F3B2}.Debug|x86.Build.0 = Debug|x86 44 | {3442437A-CB9C-4C73-B35B-3F6E4F60F3B2}.Release|x86.ActiveCfg = Release|x86 45 | {3442437A-CB9C-4C73-B35B-3F6E4F60F3B2}.Release|x86.Build.0 = Release|x86 46 | {B2C4FEDE-C383-49A2-B871-D17DA238BB47}.Debug|x86.ActiveCfg = Debug|x86 47 | {B2C4FEDE-C383-49A2-B871-D17DA238BB47}.Release|x86.ActiveCfg = Release|x86 48 | {B2C4FEDE-C383-49A2-B871-D17DA238BB47}.Release|x86.Build.0 = Release|x86 49 | {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|x86.ActiveCfg = Debug|x86 50 | {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|x86.Build.0 = Debug|x86 51 | {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|x86.ActiveCfg = Release|x86 52 | {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|x86.Build.0 = Release|x86 53 | {D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C}.Debug|x86.ActiveCfg = Debug|x86 54 | {D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C}.Debug|x86.Build.0 = Debug|x86 55 | {D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C}.Release|x86.ActiveCfg = Release|x86 56 | {D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C}.Release|x86.Build.0 = Release|x86 57 | EndGlobalSection 58 | GlobalSection(SolutionProperties) = preSolution 59 | HideSolutionNode = FALSE 60 | EndGlobalSection 61 | EndGlobal 62 | -------------------------------------------------------------------------------- /RosDBG/AboutDlg.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace RosDBG 2 | { 3 | partial class AboutDlg 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDlg)); 32 | this.btnOK = new System.Windows.Forms.Button(); 33 | this.rosDbgLabel = new System.Windows.Forms.Label(); 34 | this.creditsLabel = new System.Windows.Forms.Label(); 35 | this.SuspendLayout(); 36 | // 37 | // btnOK 38 | // 39 | this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; 40 | this.btnOK.Location = new System.Drawing.Point(180, 224); 41 | this.btnOK.Name = "btnOK"; 42 | this.btnOK.Size = new System.Drawing.Size(92, 28); 43 | this.btnOK.TabIndex = 0; 44 | this.btnOK.Text = "&OK"; 45 | this.btnOK.UseVisualStyleBackColor = true; 46 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click); 47 | // 48 | // rosDbgLabel 49 | // 50 | this.rosDbgLabel.AutoSize = true; 51 | this.rosDbgLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 52 | this.rosDbgLabel.Location = new System.Drawing.Point(37, 30); 53 | this.rosDbgLabel.Name = "rosDbgLabel"; 54 | this.rosDbgLabel.Size = new System.Drawing.Size(164, 13); 55 | this.rosDbgLabel.TabIndex = 1; 56 | this.rosDbgLabel.Text = "ReactOS Remote Debugger"; 57 | // 58 | // creditsLabel 59 | // 60 | this.creditsLabel.AutoSize = true; 61 | this.creditsLabel.Location = new System.Drawing.Point(37, 70); 62 | this.creditsLabel.Name = "creditsLabel"; 63 | this.creditsLabel.Size = new System.Drawing.Size(132, 91); 64 | this.creditsLabel.TabIndex = 3; 65 | this.creditsLabel.Text = "Brought to you by:\r\n\r\nArt Yerkes\r\nChristoph von Wittich\r\nGed Murphy\r\nGregor Schne" + 66 | "ider\r\nWillem A. Hajenius\r\n"; 67 | // 68 | // AboutDlg 69 | // 70 | this.AcceptButton = this.btnOK; 71 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 72 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 73 | this.ClientSize = new System.Drawing.Size(284, 264); 74 | this.Controls.Add(this.creditsLabel); 75 | this.Controls.Add(this.rosDbgLabel); 76 | this.Controls.Add(this.btnOK); 77 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 78 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 79 | this.MaximizeBox = false; 80 | this.MinimizeBox = false; 81 | this.Name = "AboutDlg"; 82 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 83 | this.Text = "About ReactOS Remote Debugger"; 84 | this.Load += new System.EventHandler(this.AboutDlg_Load); 85 | this.ResumeLayout(false); 86 | this.PerformLayout(); 87 | 88 | } 89 | 90 | #endregion 91 | 92 | private System.Windows.Forms.Button btnOK; 93 | private System.Windows.Forms.Label rosDbgLabel; 94 | private System.Windows.Forms.Label creditsLabel; 95 | } 96 | } -------------------------------------------------------------------------------- /RosDBG/AboutDlg.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using System.Reflection; 10 | 11 | namespace RosDBG 12 | { 13 | public partial class AboutDlg : Form 14 | { 15 | public AboutDlg() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void btnOK_Click(object sender, EventArgs e) 21 | { 22 | Close(); 23 | } 24 | 25 | private void AboutDlg_Load(object sender, EventArgs e) 26 | { 27 | rosDbgLabel.Text += " " + Assembly.GetExecutingAssembly().GetName().Version.ToString(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /RosDBG/Connect.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using System.IO.Ports; 10 | using AbstractPipe; 11 | 12 | namespace RosDBG 13 | { 14 | public partial class Connect : Form 15 | { 16 | public enum ConnectionType {Serial, Pipe, Socket}; 17 | public ConnectionType Type = Settings.SelectedConnType; 18 | private string defaultPipeName = Settings.Pipe; 19 | private string pipeName; 20 | public ConnectionMode pipeMode; 21 | 22 | public Connect() 23 | { 24 | InitializeComponent(); 25 | } 26 | 27 | #region Socket 28 | public string Host 29 | { 30 | get { return HostChoice.Text; } 31 | set { HostChoice.Text = value; } 32 | } 33 | 34 | public int Port 35 | { 36 | get { return (int)PortNumber.Value; } 37 | set { PortNumber.Value = value; } 38 | } 39 | #endregion 40 | 41 | #region Pipe 42 | public string PipeName 43 | { 44 | get { return pipeName; } 45 | } 46 | 47 | public ConnectionMode PipeMode 48 | { 49 | get { return (ConnectionMode)pipeMode; } 50 | } 51 | 52 | public bool UseDefault 53 | { 54 | get { return DefaultRadioBtn.Checked; } 55 | } 56 | #endregion 57 | 58 | #region Serial 59 | public String ComPort 60 | { 61 | get { return cPort.Text; } 62 | set { ComPort = value; } 63 | } 64 | 65 | public int Baudrate 66 | { 67 | get { return Convert.ToInt32(cBaud.Text); } 68 | set { Baudrate = value; } 69 | } 70 | 71 | private void SelectComboItem(ComboBox obj, string text) 72 | { 73 | obj.SelectedIndex = 0; 74 | foreach (object item in obj.Items) 75 | { 76 | if (item.ToString() == text) 77 | { 78 | obj.SelectedItem = item; 79 | break; 80 | } 81 | } 82 | } 83 | #endregion 84 | 85 | private void btnCancel_Click(object sender, EventArgs e) 86 | { 87 | Close(); 88 | } 89 | 90 | private void btnOK_Click(object sender, EventArgs e) 91 | { 92 | if (DefaultRadioBtn.Checked) 93 | pipeName = defaultPipeName; 94 | else 95 | pipeName = PipeNameTextBox.Text; 96 | 97 | if (cType.SelectedItem.ToString().CompareTo("Client") == 0) 98 | pipeMode = ConnectionMode.MODE_CLIENT; 99 | else if (cType.SelectedItem.ToString().CompareTo("Server") == 0) 100 | pipeMode = ConnectionMode.MODE_SERVER; 101 | 102 | Settings.SelectedConnType = Type; 103 | Settings.Mode = cType.SelectedItem.ToString(); 104 | Settings.Save(); 105 | 106 | Close(); 107 | } 108 | 109 | private void Connect_Load(object sender, EventArgs e) 110 | { 111 | int i = 0; 112 | 113 | /* Serial */ 114 | string[] serialPorts = SerialPort.GetPortNames(); 115 | if (serialPorts == null || serialPorts.Length == 0) 116 | { 117 | tabControl.TabPages.Remove(tabSerial); 118 | Settings.SelectedConnType = ConnectionType.Pipe; 119 | } 120 | else 121 | { 122 | foreach (string s in serialPorts) 123 | { 124 | cPort.Items.Add(s); 125 | } 126 | SelectComboItem(cPort, Settings.ComPort); 127 | SelectComboItem(cBaud, Settings.Baudrate); 128 | } 129 | 130 | /* Pipe */ 131 | DefaultRadioBtn.Text += " [" + defaultPipeName + "]"; 132 | for (i = 0; i < cType.Items.Count - 1; i++) 133 | { 134 | if (cType.Items[i].ToString().CompareTo(Settings.Mode) == 0) 135 | break; 136 | } 137 | cType.SelectedIndex = i; 138 | 139 | switch (Settings.SelectedConnType) 140 | { 141 | case ConnectionType.Pipe: 142 | tabControl.SelectedTab = tabPipe; 143 | break; 144 | case ConnectionType.Serial: 145 | tabControl.SelectedTab = tabSerial; 146 | break; 147 | case ConnectionType.Socket: 148 | tabControl.SelectedTab = tabSocket; 149 | break; 150 | } 151 | } 152 | 153 | private void CustomRadioBtn_CheckedChanged(object sender, EventArgs e) 154 | { 155 | RadioButton rb = (RadioButton)sender; 156 | PipeNameTextBox.Enabled = rb.Checked; 157 | } 158 | 159 | private void tabControl_SelectedIndexChanged(object sender, EventArgs e) 160 | { 161 | if (tabControl.SelectedTab == tabPipe) 162 | { 163 | Type = ConnectionType.Pipe; 164 | } 165 | else if(tabControl.SelectedTab == tabSerial) 166 | { 167 | Type = ConnectionType.Serial; 168 | } 169 | else if (tabControl.SelectedTab == tabSocket) 170 | { 171 | Type = ConnectionType.Socket; 172 | } 173 | } 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /RosDBG/ControlExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace RosDBG 5 | { 6 | /// 7 | /// Extension methods to easily execute code on the UI thread. 8 | /// Source: http://www.codeproject.com/KB/cs/AvoidingInvokeRequired.aspx 9 | /// 10 | static class ControlExtensions 11 | { 12 | static public void UIThread(this Control control, Action code) 13 | { 14 | if (control.InvokeRequired) 15 | { 16 | control.BeginInvoke(code); 17 | return; 18 | } 19 | code.Invoke(); 20 | } 21 | 22 | static public void UIThreadInvoke(this Control control, Action code) 23 | { 24 | if (control.InvokeRequired) 25 | { 26 | control.Invoke(code); 27 | return; 28 | } 29 | code.Invoke(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /RosDBG/DebugControlAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace RosDBG 7 | { 8 | public class DebugControlAttribute : Attribute 9 | { 10 | } 11 | 12 | public class BuildAtStartupAttribute : Attribute 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /RosDBG/DebugInfoFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | 7 | namespace RosDBG 8 | { 9 | public class DebugInfoFile 10 | { 11 | BinaryReader mTheFile; 12 | public DebugInfoFile(BinaryReader reader) 13 | { 14 | mTheFile = reader; 15 | } 16 | 17 | Int32 mImageBase; 18 | public Int32 ImageBase 19 | { 20 | get { return mImageBase; } 21 | set { mImageBase = value; } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /RosDBG/DebugMemoryStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | namespace RosDBG 9 | { 10 | public class DebugMemoryStream : Stream 11 | { 12 | DebugConnection mConnection; 13 | ulong mReadAddr; 14 | int mCopyOffset, mCopyCount; 15 | byte[] mReadBuffer; 16 | long[] mBytesReceived; 17 | EventWaitHandle mReadComplete = new EventWaitHandle(false, EventResetMode.AutoReset); 18 | 19 | public override bool CanRead 20 | { 21 | get { return true; } 22 | } 23 | 24 | public override bool CanSeek 25 | { 26 | get { return true; } 27 | } 28 | 29 | public override bool CanWrite 30 | { 31 | get { return true; } 32 | } 33 | 34 | public override long Length 35 | { 36 | get { return 1L << 32; } 37 | } 38 | 39 | long mPosition; 40 | public override long Position 41 | { 42 | get { return mPosition; } 43 | set { mPosition = value; } 44 | } 45 | 46 | public override void Flush() { } 47 | 48 | public override long Seek(long position, SeekOrigin origin) 49 | { 50 | long prev = mPosition; 51 | switch (origin) 52 | { 53 | case SeekOrigin.Begin: 54 | mPosition = position; 55 | break; 56 | 57 | case SeekOrigin.Current: 58 | mPosition += position; 59 | break; 60 | 61 | case SeekOrigin.End: 62 | mPosition = ((1L << 32) - position) & ((1L << 32) - 1); 63 | break; 64 | } 65 | return prev; 66 | } 67 | 68 | public override void SetLength(long len) { } 69 | 70 | int RoundUp(int count, int factor) 71 | { 72 | return (count + (factor - 1)) & (~factor - 1); 73 | } 74 | 75 | public override int Read(byte[] buffer, int offset, int count) 76 | { 77 | lock (this) 78 | { 79 | mReadAddr = (ulong)mPosition; 80 | mBytesReceived = new long[RoundUp(count, 64) / 64]; 81 | SetBits(count, RoundUp(count, 64)); 82 | mCopyOffset = offset; 83 | mCopyCount = count; 84 | mReadBuffer = buffer; 85 | mConnection.RequestMemory(mReadAddr, count); 86 | mReadComplete.WaitOne(); 87 | return mCopyCount; 88 | } 89 | } 90 | 91 | public override void Write(byte[] buffer, int offset, int count) 92 | { 93 | } 94 | 95 | void SetBits(int start, int end) 96 | { 97 | int longOfStart = start >> 6, longOfEnd = (end - 1) >> 6; 98 | if (longOfStart == longOfEnd) 99 | { 100 | start &= 63; 101 | end &= 63; 102 | mBytesReceived[longOfStart] |= -1 & ~((1L << start) - 1) & ((1L << end) - 1); 103 | } 104 | else 105 | { 106 | int nextStart = (start + 64) & ~63; 107 | SetBits(start, nextStart); 108 | while (nextStart >> 6 != longOfEnd) 109 | { 110 | start = nextStart; 111 | nextStart = start + 64; 112 | SetBits(start, nextStart); 113 | } 114 | } 115 | } 116 | 117 | bool ReadComplete() 118 | { 119 | foreach (long l in mBytesReceived) if (l != -1) return false; 120 | return true; 121 | } 122 | 123 | public void Update(ulong Address, byte[] Memory) 124 | { 125 | if (Address >= mReadAddr && Address < mReadAddr + (ulong)mCopyCount) 126 | { 127 | if (Memory == null) 128 | { 129 | int newCount = Math.Min((int)mCopyCount, (int)(Address - mReadAddr)); 130 | SetBits(newCount, mCopyCount); 131 | mCopyCount = newCount; 132 | } 133 | else 134 | { 135 | int bytesOffset = (int)(Address - (ulong)mPosition); 136 | int bytesCount = (int)Math.Min(mPosition + mCopyCount - (long)Address, Memory.Length); 137 | Array.Copy(Memory, 0, mReadBuffer, mCopyOffset, bytesCount); 138 | SetBits(bytesOffset, bytesOffset + bytesCount); 139 | if (ReadComplete()) mReadComplete.Set(); 140 | } 141 | } 142 | } 143 | 144 | public DebugMemoryStream(DebugConnection conn) 145 | { 146 | mConnection = conn; 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /RosDBG/Diagnostics.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Diagnostics; 4 | using System.Windows.Forms; 5 | 6 | namespace RosDBG 7 | { 8 | static class RosDiagnostics 9 | { 10 | public enum TraceType 11 | { 12 | Info, Error, Exception 13 | } 14 | 15 | static public void SetupLogger() 16 | { 17 | try 18 | { 19 | if (Convert.ToBoolean(Settings.AppLogging)) 20 | { 21 | File.Delete(Settings.AppLogFile); 22 | FileStream traceLogFile = new FileStream(Settings.AppLogFile, FileMode.OpenOrCreate); 23 | Trace.Listeners.Add(new TextWriterTraceListener(traceLogFile)); 24 | Trace.AutoFlush = true; 25 | } 26 | } 27 | catch (DirectoryNotFoundException) 28 | { 29 | MessageBox.Show(String.Format("Logging: {0} does not exist.\n" + 30 | "Please use the settings dialog to correct this", 31 | Settings.AppLogFile)); 32 | } 33 | catch (Exception ex) 34 | { 35 | MessageBox.Show(String.Format("Failed to setup logging. Unexpected error:\n {0}", 36 | ex.Message)); 37 | } 38 | } 39 | 40 | static public void DebugTrace(TraceType type, string msg) 41 | { 42 | StackTrace st = new StackTrace(true); 43 | StackFrame sf = st.GetFrame(1); 44 | 45 | string typeStr = ""; 46 | switch (type) 47 | { 48 | case TraceType.Info: typeStr = "Info"; break; 49 | case TraceType.Error: typeStr = "Err"; break; 50 | case TraceType.Exception: typeStr = "Exception"; break; 51 | } 52 | 53 | Trace.WriteLine(String.Format("{0, -9} : {1} {2}:{3} {4}", 54 | typeStr, 55 | msg, 56 | sf.GetMethod().Name, 57 | sf.GetFileName(), 58 | sf.GetFileLineNumber())); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/BackTrace.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace RosDBG 2 | { 3 | partial class BackTrace 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BackTrace)); 33 | this.StackFrames = new System.Windows.Forms.ListBox(); 34 | this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); 35 | this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 36 | this.contextMenuStrip1.SuspendLayout(); 37 | this.SuspendLayout(); 38 | // 39 | // StackFrames 40 | // 41 | this.StackFrames.ContextMenuStrip = this.contextMenuStrip1; 42 | this.StackFrames.Dock = System.Windows.Forms.DockStyle.Fill; 43 | this.StackFrames.FormattingEnabled = true; 44 | this.StackFrames.Location = new System.Drawing.Point(0, 0); 45 | this.StackFrames.Name = "StackFrames"; 46 | this.StackFrames.Size = new System.Drawing.Size(241, 229); 47 | this.StackFrames.TabIndex = 0; 48 | this.StackFrames.SelectedIndexChanged += new System.EventHandler(this.StackFrames_SelectedIndexChanged); 49 | this.StackFrames.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.StackFrames_MouseDoubleClick); 50 | // 51 | // contextMenuStrip1 52 | // 53 | this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 54 | this.copyToolStripMenuItem}); 55 | this.contextMenuStrip1.Name = "contextMenuStrip1"; 56 | this.contextMenuStrip1.Size = new System.Drawing.Size(103, 26); 57 | // 58 | // copyToolStripMenuItem 59 | // 60 | this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; 61 | this.copyToolStripMenuItem.Size = new System.Drawing.Size(102, 22); 62 | this.copyToolStripMenuItem.Text = "&Copy"; 63 | this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); 64 | // 65 | // BackTrace 66 | // 67 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 68 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 69 | this.ClientSize = new System.Drawing.Size(241, 229); 70 | this.Controls.Add(this.StackFrames); 71 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 72 | this.HideOnClose = true; 73 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 74 | this.Name = "BackTrace"; 75 | this.Text = "Call Stack"; 76 | this.contextMenuStrip1.ResumeLayout(false); 77 | this.ResumeLayout(false); 78 | 79 | } 80 | 81 | #endregion 82 | 83 | private System.Windows.Forms.ListBox StackFrames; 84 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; 85 | private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; 86 | 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/Locals.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace RosDBG 2 | { 3 | partial class Locals 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Locals)); 32 | this.LocalDataGrid = new System.Windows.Forms.DataGridView(); 33 | ((System.ComponentModel.ISupportInitialize)(this.LocalDataGrid)).BeginInit(); 34 | this.SuspendLayout(); 35 | // 36 | // LocalDataGrid 37 | // 38 | this.LocalDataGrid.AllowUserToAddRows = false; 39 | this.LocalDataGrid.AllowUserToDeleteRows = false; 40 | this.LocalDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 41 | this.LocalDataGrid.Dock = System.Windows.Forms.DockStyle.Fill; 42 | this.LocalDataGrid.Location = new System.Drawing.Point(0, 0); 43 | this.LocalDataGrid.Name = "LocalDataGrid"; 44 | this.LocalDataGrid.ReadOnly = true; 45 | this.LocalDataGrid.Size = new System.Drawing.Size(412, 221); 46 | this.LocalDataGrid.TabIndex = 0; 47 | // 48 | // Locals 49 | // 50 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 51 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 52 | this.ClientSize = new System.Drawing.Size(412, 221); 53 | this.Controls.Add(this.LocalDataGrid); 54 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 55 | this.HideOnClose = true; 56 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 57 | this.Name = "Locals"; 58 | this.Text = "Locals"; 59 | ((System.ComponentModel.ISupportInitialize)(this.LocalDataGrid)).EndInit(); 60 | this.ResumeLayout(false); 61 | 62 | } 63 | 64 | #endregion 65 | 66 | private System.Windows.Forms.DataGridView LocalDataGrid; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/MemoryWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using System.Globalization; 10 | using System.Threading; 11 | using DebugProtocol; 12 | using WeifenLuo.WinFormsUI.Docking; 13 | 14 | namespace RosDBG 15 | { 16 | [DebugControl] 17 | public partial class MemoryWindow : ToolWindow, IUseDebugConnection 18 | { 19 | ulong mAddress; 20 | DebugConnection mConnection; 21 | bool mRunning = true; 22 | Dictionary mStoredBytes = new Dictionary(); 23 | 24 | public void SetDebugConnection(DebugConnection conn) 25 | { 26 | mConnection = conn; 27 | conn.DebugRunningChangeEvent += DebugRunningChangeEvent; 28 | mRunning = conn.Running; 29 | } 30 | 31 | void UpdateMemoryWindow() 32 | { 33 | Invoke(Delegate.CreateDelegate(typeof(NoParamsDelegate), this, "RefreshView")); 34 | } 35 | 36 | void RefreshView() 37 | { 38 | MemoryView.EnsureVisible(0); 39 | MemoryView.Refresh(); 40 | } 41 | 42 | void DebugRunningChangeEvent(object sender, DebugRunningChangeEventArgs args) 43 | { 44 | ulong address; 45 | 46 | mRunning = args.Running; 47 | 48 | if (!mRunning && ulong.TryParse(MemoryAddress.Text, NumberStyles.HexNumber, null, out address)) 49 | { 50 | mStoredBytes.Clear(); 51 | mAddress = address & ~15UL; 52 | UpdateMemoryWindow(); 53 | } 54 | } 55 | 56 | public MemoryWindow() 57 | { 58 | InitializeComponent(); 59 | } 60 | 61 | private void MemoryView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) 62 | { 63 | ListViewItem theItem; 64 | int i; 65 | ulong toRead = mAddress + (ulong)(e.ItemIndex << 4); 66 | 67 | if (mStoredBytes.TryGetValue(toRead, out theItem)) 68 | { 69 | e.Item = theItem; 70 | return; 71 | } 72 | 73 | StringBuilder resultName = new StringBuilder(string.Format("{0:X8}:", toRead)); 74 | 75 | for (i = 0; i < 16; i++) 76 | resultName.Append(" ??"); 77 | 78 | e.Item = new ListViewItem(resultName.ToString()); 79 | mStoredBytes[toRead] = e.Item; 80 | ThreadPool.QueueUserWorkItem(UpdateRow, toRead); 81 | } 82 | 83 | void UpdateRow(object toReadObj) 84 | { 85 | ulong toRead = (ulong)toReadObj; 86 | DebugMemoryStream mem = mConnection.NewMemoryStream(); 87 | StringBuilder resultName = new StringBuilder(string.Format("{0:X8}:", toRead)); 88 | 89 | int width = 16; 90 | byte[] readBuf = new byte[width]; 91 | 92 | mem.Seek((long)toRead, System.IO.SeekOrigin.Begin); 93 | 94 | int i, result = mRunning ? 0 : mem.Read(readBuf, 0, readBuf.Length); 95 | 96 | if (result == 0) return; 97 | 98 | for (i = 0; i < readBuf.Length; i++) 99 | resultName.Append(string.Format(" {0:X2}", (int)readBuf[i])); 100 | resultName.Append(" | "); 101 | for (i = 0; i < readBuf.Length; i++) 102 | resultName.Append((!char.IsControl((char)readBuf[i]) && (int)readBuf[i] < 128) ? (char)readBuf[i] : '\xb7'); 103 | 104 | mStoredBytes[toRead] = new ListViewItem(resultName.ToString()); 105 | UpdateMemoryWindow(); 106 | } 107 | 108 | private void MemoryAddress_TextChanged(object sender, EventArgs e) 109 | { 110 | ulong address; 111 | if (ulong.TryParse(MemoryAddress.Text, NumberStyles.HexNumber, null, out address)) 112 | { 113 | mAddress = address & ~15UL; 114 | UpdateMemoryWindow(); 115 | } 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/Modules.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace RosDBG 2 | { 3 | partial class Modules 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Modules)); 32 | this.ModulesList = new System.Windows.Forms.ListView(); 33 | this.MListAddress = new System.Windows.Forms.ColumnHeader(); 34 | this.MListShortName = new System.Windows.Forms.ColumnHeader(); 35 | this.SuspendLayout(); 36 | // 37 | // ModulesList 38 | // 39 | this.ModulesList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 40 | this.MListAddress, 41 | this.MListShortName}); 42 | this.ModulesList.Dock = System.Windows.Forms.DockStyle.Fill; 43 | this.ModulesList.FullRowSelect = true; 44 | this.ModulesList.GridLines = true; 45 | this.ModulesList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; 46 | this.ModulesList.Location = new System.Drawing.Point(0, 0); 47 | this.ModulesList.Name = "ModulesList"; 48 | this.ModulesList.Size = new System.Drawing.Size(228, 182); 49 | this.ModulesList.TabIndex = 0; 50 | this.ModulesList.UseCompatibleStateImageBehavior = false; 51 | this.ModulesList.View = System.Windows.Forms.View.Details; 52 | this.ModulesList.VirtualMode = true; 53 | this.ModulesList.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.ModulesList_RetrieveVirtualItem); 54 | // 55 | // MListAddress 56 | // 57 | this.MListAddress.Text = "Address"; 58 | this.MListAddress.Width = 80; 59 | // 60 | // MListShortName 61 | // 62 | this.MListShortName.Text = "ShortName"; 63 | this.MListShortName.Width = 120; 64 | // 65 | // Modules 66 | // 67 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 68 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 69 | this.ClientSize = new System.Drawing.Size(228, 182); 70 | this.Controls.Add(this.ModulesList); 71 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 72 | this.HideOnClose = true; 73 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 74 | this.Name = "Modules"; 75 | this.Text = "Modules"; 76 | this.ResumeLayout(false); 77 | 78 | } 79 | 80 | #endregion 81 | 82 | private System.Windows.Forms.ListView ModulesList; 83 | private System.Windows.Forms.ColumnHeader MListAddress; 84 | private System.Windows.Forms.ColumnHeader MListShortName; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/Modules.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using DebugProtocol; 10 | using WeifenLuo.WinFormsUI.Docking; 11 | 12 | namespace RosDBG 13 | { 14 | [DebugControl,BuildAtStartup] 15 | public partial class Modules : ToolWindow, IUseDebugConnection 16 | { 17 | public SortedList mModules = new SortedList(); 18 | 19 | public void SetDebugConnection(DebugConnection conn) 20 | { 21 | conn.DebugModuleChangedEvent += DebugModuleChangedEvent; 22 | if (!conn.Running) 23 | conn.Debugger.GetModuleUpdate(); 24 | } 25 | 26 | void UpdateList() 27 | { 28 | lock (mModules) 29 | { 30 | ModulesList.VirtualListSize = mModules.Count; 31 | ModulesList.Refresh(); 32 | } 33 | } 34 | 35 | void DebugModuleChangedEvent(object sender, DebugModuleChangedEventArgs args) 36 | { 37 | lock (mModules) 38 | { 39 | if (args.ModuleName.ToLower() == "ntoskrnl.exe") 40 | mModules.Clear(); 41 | mModules[args.ModuleAddr] = args.ModuleName; 42 | } 43 | Invoke(Delegate.CreateDelegate(typeof(NoParamsDelegate), this, "UpdateList")); 44 | } 45 | 46 | public Modules() 47 | { 48 | InitializeComponent(); 49 | } 50 | 51 | private void ModulesList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) 52 | { 53 | KeyValuePair modent = mModules.ElementAt(e.ItemIndex); 54 | e.Item = new ListViewItem(new string[] { modent.Key.ToString("X8"), modent.Value }); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/ProcThread.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace RosDBG 2 | { 3 | partial class ProcThread 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProcThread)); 32 | this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 33 | this.Processes = new System.Windows.Forms.DataGridView(); 34 | this.Threads = new System.Windows.Forms.DataGridView(); 35 | this.splitContainer1.Panel1.SuspendLayout(); 36 | this.splitContainer1.Panel2.SuspendLayout(); 37 | this.splitContainer1.SuspendLayout(); 38 | ((System.ComponentModel.ISupportInitialize)(this.Processes)).BeginInit(); 39 | ((System.ComponentModel.ISupportInitialize)(this.Threads)).BeginInit(); 40 | this.SuspendLayout(); 41 | // 42 | // splitContainer1 43 | // 44 | this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 45 | this.splitContainer1.Location = new System.Drawing.Point(0, 0); 46 | this.splitContainer1.Name = "splitContainer1"; 47 | this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; 48 | // 49 | // splitContainer1.Panel1 50 | // 51 | this.splitContainer1.Panel1.Controls.Add(this.Processes); 52 | // 53 | // splitContainer1.Panel2 54 | // 55 | this.splitContainer1.Panel2.Controls.Add(this.Threads); 56 | this.splitContainer1.Size = new System.Drawing.Size(403, 313); 57 | this.splitContainer1.SplitterDistance = 122; 58 | this.splitContainer1.TabIndex = 0; 59 | // 60 | // Processes 61 | // 62 | this.Processes.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 63 | this.Processes.Dock = System.Windows.Forms.DockStyle.Fill; 64 | this.Processes.Location = new System.Drawing.Point(0, 0); 65 | this.Processes.Name = "Processes"; 66 | this.Processes.Size = new System.Drawing.Size(403, 122); 67 | this.Processes.TabIndex = 0; 68 | this.Processes.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.Processes_CellDoubleClick); 69 | // 70 | // Threads 71 | // 72 | this.Threads.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 73 | this.Threads.Dock = System.Windows.Forms.DockStyle.Fill; 74 | this.Threads.Location = new System.Drawing.Point(0, 0); 75 | this.Threads.Name = "Threads"; 76 | this.Threads.Size = new System.Drawing.Size(403, 187); 77 | this.Threads.TabIndex = 0; 78 | this.Threads.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.Threads_CellDoubleClick); 79 | // 80 | // ProcThread 81 | // 82 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 83 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 84 | this.ClientSize = new System.Drawing.Size(403, 313); 85 | this.Controls.Add(this.splitContainer1); 86 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 87 | this.HideOnClose = true; 88 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 89 | this.Name = "ProcThread"; 90 | this.Text = "Processes / Threads"; 91 | this.splitContainer1.Panel1.ResumeLayout(false); 92 | this.splitContainer1.Panel2.ResumeLayout(false); 93 | this.splitContainer1.ResumeLayout(false); 94 | ((System.ComponentModel.ISupportInitialize)(this.Processes)).EndInit(); 95 | ((System.ComponentModel.ISupportInitialize)(this.Threads)).EndInit(); 96 | this.ResumeLayout(false); 97 | 98 | } 99 | 100 | #endregion 101 | 102 | private System.Windows.Forms.SplitContainer splitContainer1; 103 | private System.Windows.Forms.DataGridView Processes; 104 | private System.Windows.Forms.DataGridView Threads; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/ProcThread.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using DebugProtocol; 10 | using DbgHelpAPI; 11 | using WeifenLuo.WinFormsUI.Docking; 12 | 13 | namespace RosDBG 14 | { 15 | [DebugControl, BuildAtStartup] 16 | public partial class ProcThread : ToolWindow, IUseDebugConnection, IUseSymbols 17 | { 18 | DebugConnection mConnection; 19 | SymbolContext mSymcon; 20 | Dictionary mProcesses = new Dictionary(); 21 | 22 | public ProcThread() 23 | { 24 | InitializeComponent(); 25 | } 26 | 27 | public void SetDebugConnection(DebugConnection conn) 28 | { 29 | mConnection = conn; 30 | mConnection.DebugProcessThreadChangeEvent += DebugProcessThreadChangeEvent; 31 | } 32 | 33 | public void SetSymbolProvider(SymbolContext symcon) 34 | { 35 | mSymcon = symcon; 36 | } 37 | 38 | void DebugProcessThreadChangeEvent(object sender, DebugProcessThreadChangeEventArgs args) 39 | { 40 | mProcesses = args.Processes; 41 | Invoke(Delegate.CreateDelegate(typeof(NoParamsDelegate), this, "RefreshProcThreads")); 42 | } 43 | 44 | void RefreshProcThreads() 45 | { 46 | Processes.DataSource = new List(mProcesses.Values); 47 | foreach (ProcessElement pe in mProcesses.Values) 48 | { 49 | if (pe.Current) 50 | { 51 | List telist = new List(mProcesses[pe.ProcessId].Threads.Values); 52 | foreach (ThreadElement te in telist) 53 | { 54 | KeyValuePair fileLine = mSymcon.GetFileAndLine(te.Eip); 55 | te.Description = fileLine.Key + ":" + fileLine.Value; 56 | } 57 | Threads.DataSource = telist; 58 | } 59 | } 60 | } 61 | 62 | void DebugRunningChangeEvent(object sender, DebugRunningChangeEventArgs args) 63 | { 64 | if (!args.Running) 65 | { 66 | mConnection.Debugger.GetProcesses(); 67 | } 68 | } 69 | 70 | private void Processes_CellDoubleClick(object sender, DataGridViewCellEventArgs e) 71 | { 72 | mConnection.SetProcess(((ProcessElement)Processes.Rows[e.RowIndex].DataBoundItem).ProcessId); 73 | } 74 | 75 | private void Threads_CellDoubleClick(object sender, DataGridViewCellEventArgs e) 76 | { 77 | mConnection.SetThread(((ThreadElement)Threads.Rows[e.RowIndex].DataBoundItem).ThreadId); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/RegisterView.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace RosDBG 2 | { 3 | partial class RegisterView 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RegisterView)); 32 | this.RegisterGrid = new System.Windows.Forms.PropertyGrid(); 33 | this.SuspendLayout(); 34 | // 35 | // RegisterGrid 36 | // 37 | this.RegisterGrid.Dock = System.Windows.Forms.DockStyle.Fill; 38 | this.RegisterGrid.Location = new System.Drawing.Point(0, 0); 39 | this.RegisterGrid.Name = "RegisterGrid"; 40 | this.RegisterGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; 41 | this.RegisterGrid.Size = new System.Drawing.Size(291, 238); 42 | this.RegisterGrid.TabIndex = 0; 43 | this.RegisterGrid.ToolbarVisible = false; 44 | // 45 | // RegisterView 46 | // 47 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 49 | this.ClientSize = new System.Drawing.Size(291, 238); 50 | this.Controls.Add(this.RegisterGrid); 51 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 52 | this.HideOnClose = true; 53 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 54 | this.Name = "RegisterView"; 55 | this.Text = "Register"; 56 | this.ResumeLayout(false); 57 | 58 | } 59 | 60 | #endregion 61 | 62 | private System.Windows.Forms.PropertyGrid RegisterGrid; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/RegisterView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using DebugProtocol; 10 | using WeifenLuo.WinFormsUI.Docking; 11 | 12 | namespace RosDBG 13 | { 14 | [DebugControl, BuildAtStartup, Obsolete("Replaced by StatefulRegisterView")] 15 | public partial class RegisterView : ToolWindow, IUseDebugConnection 16 | { 17 | bool mGridEnabled; 18 | Registers mRegisters; 19 | DebugConnection mConnection; 20 | 21 | public RegisterView() 22 | { 23 | InitializeComponent(); 24 | RegisterGrid.SelectedObject = new Registers(); 25 | } 26 | 27 | public void SetDebugConnection(DebugConnection conn) 28 | { 29 | mConnection = conn; 30 | mConnection.DebugRegisterChangeEvent += DebugRegisterChangeEvent; 31 | mConnection.DebugRunningChangeEvent += DebugRunningChangeEvent; 32 | mConnection.DebugConnectionModeChangedEvent += DebugConnectionModeChangedEvent; 33 | if (!mConnection.Running) 34 | { 35 | mConnection.Debugger.GetRegisterUpdate(); 36 | mConnection.Debugger.GetProcesses(); 37 | } 38 | } 39 | 40 | void DebugConnectionModeChangedEvent(object sender, DebugConnectionModeChangedEventArgs args) 41 | { 42 | if (mConnection.ConnectionMode == DebugConnection.Mode.ClosedMode) 43 | Invoke(Delegate.CreateDelegate(typeof(NoParamsDelegate), this, "ClearRegs")); 44 | } 45 | 46 | void DebugRunningChangeEvent(object sender, DebugRunningChangeEventArgs args) 47 | { 48 | mGridEnabled = !args.Running; 49 | Invoke(Delegate.CreateDelegate(typeof(NoParamsDelegate), this, "UpdateGridEnabled")); 50 | } 51 | 52 | void DebugRegisterChangeEvent(object sender, DebugRegisterChangeEventArgs args) 53 | { 54 | mRegisters = args.Registers; 55 | Invoke(Delegate.CreateDelegate(typeof(NoParamsDelegate), this, "UpdateGrid")); 56 | } 57 | 58 | void ClearRegs() 59 | { 60 | if (mRegisters != null) 61 | mRegisters.Clear(); 62 | UpdateGrid(); 63 | } 64 | 65 | void UpdateGridEnabled() 66 | { 67 | RegisterGrid.Enabled = mGridEnabled; 68 | } 69 | 70 | void UpdateGrid() 71 | { 72 | RegisterGrid.SelectedObject = null; 73 | RegisterGrid.SelectedObject = mRegisters; 74 | RegisterGrid.Refresh(); 75 | } 76 | 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/ToolWindow.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace RosDBG 2 | { 3 | partial class ToolWindow 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 33 | this.Text = "ToolWindow"; 34 | } 35 | 36 | #endregion 37 | } 38 | } -------------------------------------------------------------------------------- /RosDBG/Dockable Objects/ToolWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using WeifenLuo.WinFormsUI.Docking; 10 | 11 | namespace RosDBG 12 | { 13 | public partial class ToolWindow : DockContent 14 | { 15 | 16 | public enum Commands {Copy, Cut, Paste, Save, SaveAs, Print}; 17 | 18 | public ToolWindow() 19 | { 20 | InitializeComponent(); 21 | } 22 | 23 | public virtual void SaveAs(string FileName) 24 | { 25 | MessageBox.Show("Not implemented!"); 26 | } 27 | 28 | public virtual void Save(string FileName) 29 | { 30 | SaveAs(FileName); 31 | } 32 | 33 | public virtual void Print(bool ShowDialog) 34 | { 35 | MessageBox.Show("Not implemented!"); 36 | } 37 | 38 | public virtual string GetDocumentName() 39 | { 40 | return ""; 41 | } 42 | 43 | public virtual bool IsCmdEnabled(Commands Cmd) 44 | { 45 | return false; 46 | } 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /RosDBG/FileDirChooser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.ComponentModel.Design; 5 | using System.Drawing.Design; 6 | using System.Data; 7 | using System.Drawing; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Windows.Forms; 11 | using System.IO; 12 | 13 | namespace RosDBG 14 | { 15 | public class DirectoryEditor : UITypeEditor 16 | { 17 | public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) 18 | { 19 | return UITypeEditorEditStyle.Modal; 20 | } 21 | 22 | public override object EditValue(ITypeDescriptorContext typedesc, IServiceProvider provider, object value) 23 | { 24 | FolderBrowserDialog fbd = new FolderBrowserDialog(); 25 | fbd.Description = "Set path for " + typedesc.PropertyDescriptor.DisplayName; 26 | if (fbd.ShowDialog() == DialogResult.OK) 27 | return fbd.SelectedPath; 28 | else 29 | return value; 30 | } 31 | } 32 | 33 | public class FileEditor : UITypeEditor 34 | { 35 | public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) 36 | { 37 | return UITypeEditorEditStyle.Modal; 38 | } 39 | 40 | public override object EditValue(ITypeDescriptorContext typedesc, IServiceProvider provider, object value) 41 | { 42 | OpenFileDialog ofd = new OpenFileDialog(); 43 | 44 | ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); 45 | ofd.CheckFileExists = false; 46 | ofd.Filter = "log files (*.log)|*.log"; 47 | ofd.DefaultExt = "log"; 48 | ofd.AddExtension = true; 49 | ofd.RestoreDirectory = true; 50 | 51 | if (ofd.ShowDialog() == DialogResult.OK) 52 | return ofd.FileName; 53 | else 54 | return value; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /RosDBG/HighLevelInteraction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | 7 | namespace RosDBG 8 | { 9 | public class BytesEventArgs : EventArgs 10 | { 11 | byte []mBytes; 12 | public byte []Bytes { get { return mBytes; } } 13 | public BytesEventArgs(byte []bytes) 14 | { 15 | mBytes = bytes; 16 | } 17 | } 18 | public interface BidirectionalChannel 19 | { 20 | } 21 | 22 | public class HighLevelInteraction 23 | { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /RosDBG/IShell.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace RosDBG 7 | { 8 | public interface IShell 9 | { 10 | void FocusAddress(ulong address); 11 | } 12 | 13 | public interface IUseShell 14 | { 15 | void SetShell(IShell shell); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /RosDBG/IUseDebugConnection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using DebugProtocol; 6 | 7 | namespace RosDBG 8 | { 9 | public interface IUseDebugConnection 10 | { 11 | void SetDebugConnection(DebugConnection conn); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /RosDBG/IUseSymbols.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using DbgHelpAPI; 6 | 7 | namespace RosDBG 8 | { 9 | public interface IUseSymbols 10 | { 11 | void SetSymbolProvider(SymbolContext symcon); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /RosDBG/Module.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using DbgHelpAPI; 7 | 8 | namespace RosDBG 9 | { 10 | class Module 11 | { 12 | ulong mBaseAddress; 13 | public ulong BaseAddress 14 | { 15 | get { return mBaseAddress; } 16 | } 17 | string mShortName; 18 | public string ShortName 19 | { 20 | get { return mShortName; } 21 | } 22 | 23 | public Module(ulong addr, string shortName) 24 | { 25 | mBaseAddress = addr; 26 | mShortName = shortName.ToLower(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RosDBG/ModuleIndex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | 7 | namespace RosDBG 8 | { 9 | class ModuleIndex 10 | { 11 | string mReactOSBuild; 12 | Dictionary mModcache = new Dictionary(); 13 | 14 | public string ReactOSBuild 15 | { 16 | get { return mReactOSBuild; } 17 | set 18 | { 19 | mReactOSBuild = value; 20 | mModcache.Clear(); 21 | if (mReactOSBuild != null) 22 | ReadDirs(mReactOSBuild); 23 | } 24 | } 25 | 26 | void ReadDirs(string dir) 27 | { 28 | foreach (string subdir in Directory.GetDirectories(dir)) 29 | ReadDirs(Path.Combine(dir, subdir)); 30 | 31 | foreach (string file in Directory.GetFiles(dir)) 32 | mModcache[Path.GetFileNameWithoutExtension(file).ToLowerInvariant()] = 33 | Path.Combine(dir, file); 34 | } 35 | 36 | public ModuleIndex() 37 | { 38 | } 39 | 40 | public string GetModuleByName(string name) 41 | { 42 | string result; 43 | if (mModcache.TryGetValue(name.ToLowerInvariant(), out result)) 44 | return result; 45 | else 46 | return null; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /RosDBG/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading; 5 | using System.Windows.Forms; 6 | using System.Drawing; 7 | 8 | namespace RosDBG 9 | { 10 | static class Program 11 | { 12 | /// 13 | /// The main entry point for the application. 14 | /// 15 | [STAThread] 16 | static void Main() 17 | { 18 | Mutex m = new Mutex(false, "ReactOS Remote Debugger"); 19 | if (m.WaitOne(10, false)) 20 | { 21 | Application.EnableVisualStyles(); 22 | Application.SetCompatibleTextRenderingDefault(false); 23 | MainWindow mw = new MainWindow(); 24 | 25 | mw.WindowState = RosDBG.Properties.Settings.Default.WindowState; 26 | mw.StartPosition = FormStartPosition.Manual; 27 | mw.Location = RosDBG.Properties.Settings.Default.Location; 28 | mw.Size = RosDBG.Properties.Settings.Default.Size; 29 | Application.Run(mw); 30 | } 31 | else 32 | { 33 | /* TODO */ 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /RosDBG/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ReactOS Remote Debugger")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ReactOS Remote Debugger")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5850a4c1-3776-4c7c-a19e-5c7e48d679cb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | 36 | 37 | // WARNING: Build numbers are increased automatically! 38 | // On debug build only Revision will be increased, on release build the Build Number 39 | // will be increased as well. MSI installers must not be generated with the same Build Number 40 | // otherwise they won't upgrade the old installation! 41 | 42 | [assembly: AssemblyVersion("1.0.23.12")] 43 | [assembly: AssemblyFileVersion("1.0.23.12")] 44 | -------------------------------------------------------------------------------- /RosDBG/Properties/DataSources/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Properties/DataSources/.gitignore -------------------------------------------------------------------------------- /RosDBG/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace RosDBG.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | public class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | public static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RosDBG.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | public static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | public static System.Drawing.Bitmap copyToolStripMenuItem_Image { 64 | get { 65 | object obj = ResourceManager.GetObject("copyToolStripMenuItem.Image", resourceCulture); 66 | return ((System.Drawing.Bitmap)(obj)); 67 | } 68 | } 69 | 70 | public static System.Drawing.Bitmap Pause { 71 | get { 72 | object obj = ResourceManager.GetObject("Pause", resourceCulture); 73 | return ((System.Drawing.Bitmap)(obj)); 74 | } 75 | } 76 | 77 | public static System.Drawing.Bitmap Run { 78 | get { 79 | object obj = ResourceManager.GetObject("Run", resourceCulture); 80 | return ((System.Drawing.Bitmap)(obj)); 81 | } 82 | } 83 | 84 | public static System.Drawing.Bitmap StepIn { 85 | get { 86 | object obj = ResourceManager.GetObject("StepIn", resourceCulture); 87 | return ((System.Drawing.Bitmap)(obj)); 88 | } 89 | } 90 | 91 | public static System.Drawing.Bitmap StepOver { 92 | get { 93 | object obj = ResourceManager.GetObject("StepOver", resourceCulture); 94 | return ((System.Drawing.Bitmap)(obj)); 95 | } 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /RosDBG/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Dieser Code wurde von einem Tool generiert. 4 | // Laufzeitversion:4.0.30319.1 5 | // 6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn 7 | // der Code erneut generiert wird. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace RosDBG.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] 29 | public global::System.Drawing.Point Location { 30 | get { 31 | return ((global::System.Drawing.Point)(this["Location"])); 32 | } 33 | set { 34 | this["Location"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("792, 591")] 41 | public global::System.Drawing.Size Size { 42 | get { 43 | return ((global::System.Drawing.Size)(this["Size"])); 44 | } 45 | set { 46 | this["Size"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("Normal")] 53 | public global::System.Windows.Forms.FormWindowState WindowState { 54 | get { 55 | return ((global::System.Windows.Forms.FormWindowState)(this["WindowState"])); 56 | } 57 | set { 58 | this["WindowState"] = value; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /RosDBG/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 0, 0 7 | 8 | 9 | 792, 591 10 | 11 | 12 | Normal 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /RosDBG/ReactOSWeb.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace RosDBG 11 | { 12 | [DebugControl, BuildAtStartup] 13 | public partial class ReactOSWeb : UserControl 14 | { 15 | public ReactOSWeb() 16 | { 17 | InitializeComponent(); 18 | this.Tag = "Web"; 19 | BrowserView.CanGoBackChanged += BrowserView_CanGoBackChanged; 20 | BrowserView.CanGoForwardChanged += BrowserView_CanGoForwardChanged; 21 | BrowserView.GoHome(); 22 | } 23 | 24 | public ReactOSWeb(string Title, string URL) 25 | { 26 | InitializeComponent(); 27 | this.Tag = Title; 28 | BrowserView.CanGoBackChanged += BrowserView_CanGoBackChanged; 29 | BrowserView.CanGoForwardChanged += BrowserView_CanGoForwardChanged; 30 | BrowserView.Navigate(URL); 31 | } 32 | 33 | private void BrowserView_Navigating(object sender, WebBrowserNavigatingEventArgs e) 34 | { 35 | AddressInput.Text = e.Url.ToString(); 36 | } 37 | 38 | private void navPaste_Click(object sender, EventArgs e) 39 | { 40 | BrowserView.Navigate("http://www.reactos.org/paste"); 41 | } 42 | 43 | private void navHome_Click(object sender, EventArgs e) 44 | { 45 | BrowserView.GoHome(); 46 | } 47 | 48 | private void navBack_Click(object sender, EventArgs e) 49 | { 50 | BrowserView.GoBack(); 51 | } 52 | 53 | private void navForward_Click(object sender, EventArgs e) 54 | { 55 | BrowserView.GoForward(); 56 | } 57 | 58 | private void navReload_Click(object sender, EventArgs e) 59 | { 60 | BrowserView.Refresh(); 61 | } 62 | 63 | private void BrowserView_CanGoBackChanged(object sender, EventArgs e) 64 | { 65 | navBack.Enabled = BrowserView.CanGoBack; 66 | } 67 | 68 | private void BrowserView_CanGoForwardChanged(object sender, EventArgs e) 69 | { 70 | navForward.Enabled = BrowserView.CanGoForward; 71 | } 72 | 73 | private void AddressInput_KeyUp(object sender, KeyEventArgs e) 74 | { 75 | if (e.KeyCode == Keys.Return) 76 | BrowserView.Navigate(((ToolStripComboBox)sender).Text); 77 | } 78 | 79 | private void BugzillaInput_KeyUp(object sender, KeyEventArgs e) 80 | { 81 | if (e.KeyCode == Keys.Return) 82 | BrowserView.Navigate("http://www.reactos.org/bugzilla/show_bug.cgi?id=" + ((ToolStripTextBox)sender).Text); 83 | } 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /RosDBG/Registers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.ComponentModel; 6 | 7 | namespace RosDBG 8 | { 9 | public class Registers 10 | { 11 | public ulong Eax { get { return RegisterSet[0]; } set { RegisterSet[0] = value; } } 12 | public ulong Ecx { get { return RegisterSet[1]; } set { RegisterSet[1] = value; } } 13 | public ulong Edx { get { return RegisterSet[2]; } set { RegisterSet[2] = value; } } 14 | public ulong Ebx { get { return RegisterSet[3]; } set { RegisterSet[3] = value; } } 15 | public ulong Esp { get { return RegisterSet[4]; } set { RegisterSet[4] = value; } } 16 | public ulong Ebp { get { return RegisterSet[5]; } set { RegisterSet[5] = value; } } 17 | public ulong Esi { get { return RegisterSet[6]; } set { RegisterSet[6] = value; } } 18 | public ulong Edi { get { return RegisterSet[7]; } set { RegisterSet[7] = value; } } 19 | public ulong Eip { get { return RegisterSet[8]; } set { RegisterSet[8] = value; } } 20 | public ulong Eflags { get { return RegisterSet[9]; } set { RegisterSet[9] = value; } } 21 | public ulong Cs { get { return RegisterSet[10]; } set { RegisterSet[10] = value; } } 22 | public ulong Ds { get { return RegisterSet[11]; } set { RegisterSet[11] = value; } } 23 | public ulong Es { get { return RegisterSet[12]; } set { RegisterSet[12] = value; } } 24 | public ulong Fs { get { return RegisterSet[13]; } set { RegisterSet[13] = value; } } 25 | public ulong Gs { get { return RegisterSet[14]; } set { RegisterSet[14] = value; } } 26 | public ulong Ss { get { return RegisterSet[15]; } set { RegisterSet[15] = value; } } 27 | public ulong[] RegisterSet = new ulong[32]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RosDBG/Resources/Pause.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Resources/Pause.bmp -------------------------------------------------------------------------------- /RosDBG/Resources/Run.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Resources/Run.bmp -------------------------------------------------------------------------------- /RosDBG/Resources/StepIn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Resources/StepIn.png -------------------------------------------------------------------------------- /RosDBG/Resources/StepOut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Resources/StepOut.png -------------------------------------------------------------------------------- /RosDBG/Resources/StepOver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Resources/StepOver.png -------------------------------------------------------------------------------- /RosDBG/Resources/copyToolStripMenuItem.Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Resources/copyToolStripMenuItem.Image.png -------------------------------------------------------------------------------- /RosDBG/Resources/emblem-system.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Resources/emblem-system.ico -------------------------------------------------------------------------------- /RosDBG/Resources/internet-web-browser.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Resources/internet-web-browser.ico -------------------------------------------------------------------------------- /RosDBG/Resources/utilities-terminal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/Resources/utilities-terminal.ico -------------------------------------------------------------------------------- /RosDBG/RosDBG.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C# Express 2008 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RosDBG", "RosDBG.csproj", "{FB776BFE-D2C2-465E-B713-6AD82CAE1A39}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "stabs", "..\stabs\stabs.csproj", "{BCA425B3-12A5-40A3-9C88-7B3D071C8018}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FB776BFE-D2C2-465E-B713-6AD82CAE1A39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FB776BFE-D2C2-465E-B713-6AD82CAE1A39}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {FB776BFE-D2C2-465E-B713-6AD82CAE1A39}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {FB776BFE-D2C2-465E-B713-6AD82CAE1A39}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {BCA425B3-12A5-40A3-9C88-7B3D071C8018}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {BCA425B3-12A5-40A3-9C88-7B3D071C8018}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {BCA425B3-12A5-40A3-9C88-7B3D071C8018}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {BCA425B3-12A5-40A3-9C88-7B3D071C8018}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /RosDBG/StatefulVariable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace RosDBG 6 | { 7 | /// 8 | /// A generic class to represent a variable that remembers its previous value. 9 | /// 10 | /// Data type to encapsulate 11 | class StatefulVariable where T: IComparable 12 | { 13 | public T PreviousValue { get; private set; } 14 | public T CurrentValue { get; private set; } 15 | public bool HasChanged { get { return PreviousValue.CompareTo(CurrentValue) != 0; } } 16 | 17 | public event EventHandler Updated; // Always invoked even if overwritten with same value 18 | public event EventHandler Modified; // Only invoked if new value different than before 19 | 20 | public StatefulVariable(): this(default(T)) {} 21 | 22 | public StatefulVariable(T initialValue) 23 | { 24 | PreviousValue = initialValue; 25 | CurrentValue = PreviousValue; 26 | } 27 | 28 | public void Set(T newValue) 29 | { 30 | PreviousValue = CurrentValue; 31 | CurrentValue = newValue; 32 | 33 | if (HasChanged && Modified != null) 34 | Modified.Invoke(this, EventArgs.Empty); 35 | 36 | if (Updated != null) 37 | Updated.Invoke(this, EventArgs.Empty); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /RosDBG/app-rosdbg.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/RosDBG/app-rosdbg.ico -------------------------------------------------------------------------------- /RosDBG/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 0, 0 13 | 14 | 15 | 792, 591 16 | 17 | 18 | Normal 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /RosDBG/gdbbase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | using System.Globalization; 5 | using System.Text.RegularExpressions; 6 | using System.Timers; 7 | using System.Collections.Generic; 8 | 9 | namespace Gdb 10 | { 11 | public class PipeReceiveEventArgs 12 | { 13 | public readonly string Received; 14 | public PipeReceiveEventArgs(string received) 15 | { 16 | Received = received; 17 | } 18 | } 19 | public delegate void PipeReceiveEventHandler(object sender, PipeReceiveEventArgs args); 20 | public interface Pipe 21 | { 22 | event PipeReceiveEventHandler PipeReceiveEvent; 23 | bool Write(string output); 24 | } 25 | 26 | public class GdbProtocol 27 | { 28 | Pipe mPipe; 29 | List mSendBuffer = new List(); 30 | StringBuilder mInputBuffer = new StringBuilder(); 31 | Timer mTimer = new Timer(); 32 | int mMessageId = 0; 33 | 34 | public void SendMessage(string msg) 35 | { 36 | byte csum = 0; 37 | foreach (char addend in msg) { csum += (byte)addend; } 38 | mSendBuffer.Add(string.Format("${0}#{1:X2}#{1:X3}", msg, csum, mMessageId++)); 39 | mPipe.Write(mSendBuffer[0]); 40 | } 41 | 42 | // Break isn't a packet... its effect is immediate 43 | public void SendBreak() 44 | { 45 | mPipe.Write("\x03\x03\x03\x03\x03"); 46 | } 47 | 48 | public void SendStart() 49 | { 50 | mPipe.Write("---"); 51 | } 52 | 53 | bool CheckSum(string payload, int checksum) 54 | { 55 | byte newcsum = 0; 56 | foreach (char p in payload) 57 | { 58 | newcsum += (byte)p; 59 | } 60 | return checksum == newcsum; 61 | } 62 | 63 | static Regex mPacketRegex = 64 | new Regex("[^$]*\\$(?[^#]*)\\#(?[0-9a-fA-F][0-9a-fA-F])\\#(?[0-9a-fA-F][0-9a-fA-F])(?.*)"); 65 | int mLastId; 66 | 67 | void RecvFired(object sender, PipeReceiveEventArgs args) 68 | { 69 | string msg = args.Received; 70 | 71 | // Must get a confirmation as a single message 72 | if (msg.Length > 0 && msg[0] == '+') 73 | { 74 | if (mSendBuffer.Count > 0) mSendBuffer.RemoveAt(0); 75 | msg = msg.Substring(1); 76 | } 77 | 78 | mInputBuffer.Append(msg); 79 | string inbuf = mInputBuffer.ToString(); 80 | bool matched = false; 81 | bool parsed = false; 82 | 83 | // Leave if there's no '$' in the buffer. We don't need to 84 | // process further 85 | if (inbuf.IndexOf('$') == -1) 86 | { 87 | mInputBuffer = new StringBuilder(""); 88 | return; 89 | } 90 | 91 | Match m = mPacketRegex.Match(inbuf); 92 | 93 | while (m.Success) 94 | { 95 | string payload = m.Groups["payload"].ToString(); 96 | string checksum = m.Groups["checksum"].ToString(); 97 | string midstr = m.Groups["mid"].ToString(); 98 | int mid = int.Parse(midstr, NumberStyles.HexNumber); 99 | matched = true; 100 | 101 | if (CheckSum(payload, int.Parse(checksum, NumberStyles.HexNumber))) 102 | { 103 | parsed = true; 104 | try 105 | { 106 | if (mid != mLastId) 107 | { 108 | mLastId = mid; 109 | ReceivePacket(payload); 110 | } 111 | } 112 | catch (Exception e) 113 | { 114 | Console.WriteLine("Error parsing [{0}]: {1}", payload, e.Message); 115 | } 116 | mPipe.Write("+"); 117 | } 118 | mInputBuffer = new StringBuilder(""); 119 | mInputBuffer.Append(inbuf = m.Groups["tail"].ToString()); 120 | m = mPacketRegex.Match(inbuf); 121 | } 122 | 123 | // On the safe side, send a nak if we got a packet, but it didn't 124 | // check 125 | if (matched && !parsed) 126 | { 127 | mPipe.Write("-"); 128 | } 129 | } 130 | 131 | protected virtual void ReceivePacket(string payload) 132 | { 133 | Console.WriteLine("got payload: " + payload); 134 | } 135 | 136 | void ResendTimer(object sender, ElapsedEventArgs args) 137 | { 138 | if (mSendBuffer.Count > 0) 139 | { 140 | mPipe.Write(mSendBuffer[0]); 141 | } 142 | } 143 | 144 | public GdbProtocol(Pipe pipe) 145 | { 146 | mPipe = pipe; 147 | mPipe.PipeReceiveEvent += RecvFired; 148 | mTimer.Elapsed += ResendTimer; 149 | mTimer.Start(); 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /RosDBG/hextest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using System.Net.Sockets; 5 | using System.Globalization; 6 | 7 | namespace Gdb 8 | { 9 | public class GdbSocketTest 10 | { 11 | public static void Main(string []args) 12 | { 13 | foreach (string arg in args) 14 | { 15 | Console.WriteLine(long.Parse(arg, NumberStyles.HexNumber)); 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /RosDBG/socketpipe.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Net.Sockets; 4 | 5 | namespace Gdb 6 | { 7 | public class SocketPipe : Pipe 8 | { 9 | Socket mSocket; 10 | byte []mBuf = new byte[4096]; 11 | IAsyncResult mResult; 12 | 13 | public event PipeReceiveEventHandler PipeReceiveEvent; 14 | public bool Write(string output) 15 | { 16 | byte []outbuf = UTF8Encoding.UTF8.GetBytes(output); 17 | int off = 0, res; 18 | do 19 | { 20 | res = mSocket.Send(outbuf, off, outbuf.Length - off, SocketFlags.None); 21 | if (res > 0) 22 | off += res; 23 | } 24 | while (off < outbuf.Length && res != -1); 25 | return off == outbuf.Length; 26 | } 27 | 28 | public void TriggerReadable(IAsyncResult result) 29 | { 30 | int bytes = mSocket.EndReceive(mResult); 31 | string datastr = UTF8Encoding.UTF8.GetString(mBuf, 0, bytes); 32 | if (PipeReceiveEvent != null) 33 | PipeReceiveEvent(this, new PipeReceiveEventArgs(datastr)); 34 | mResult = mSocket.BeginReceive 35 | (mBuf, 0, mBuf.Length, SocketFlags.None, TriggerReadable, this); 36 | } 37 | 38 | public SocketPipe(Socket socket) 39 | { 40 | mSocket = socket; 41 | mResult = mSocket.BeginReceive 42 | (mBuf, 0, mBuf.Length, SocketFlags.None, TriggerReadable, this); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockAreasEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Drawing; 4 | using System.Drawing.Design; 5 | using System.Windows.Forms; 6 | using System.Windows.Forms.Design; 7 | 8 | namespace WeifenLuo.WinFormsUI.Docking 9 | { 10 | internal class DockAreasEditor : UITypeEditor 11 | { 12 | private class DockAreasEditorControl : System.Windows.Forms.UserControl 13 | { 14 | private CheckBox checkBoxFloat; 15 | private CheckBox checkBoxDockLeft; 16 | private CheckBox checkBoxDockRight; 17 | private CheckBox checkBoxDockTop; 18 | private CheckBox checkBoxDockBottom; 19 | private CheckBox checkBoxDockFill; 20 | private DockAreas m_oldDockAreas; 21 | 22 | public DockAreas DockAreas 23 | { 24 | get 25 | { 26 | DockAreas dockAreas = 0; 27 | if (checkBoxFloat.Checked) 28 | dockAreas |= DockAreas.Float; 29 | if (checkBoxDockLeft.Checked) 30 | dockAreas |= DockAreas.DockLeft; 31 | if (checkBoxDockRight.Checked) 32 | dockAreas |= DockAreas.DockRight; 33 | if (checkBoxDockTop.Checked) 34 | dockAreas |= DockAreas.DockTop; 35 | if (checkBoxDockBottom.Checked) 36 | dockAreas |= DockAreas.DockBottom; 37 | if (checkBoxDockFill.Checked) 38 | dockAreas |= DockAreas.Document; 39 | 40 | if (dockAreas == 0) 41 | return m_oldDockAreas; 42 | else 43 | return dockAreas; 44 | } 45 | } 46 | 47 | public DockAreasEditorControl() 48 | { 49 | checkBoxFloat = new CheckBox(); 50 | checkBoxDockLeft = new CheckBox(); 51 | checkBoxDockRight = new CheckBox(); 52 | checkBoxDockTop = new CheckBox(); 53 | checkBoxDockBottom = new CheckBox(); 54 | checkBoxDockFill = new CheckBox(); 55 | 56 | SuspendLayout(); 57 | 58 | checkBoxFloat.Appearance = Appearance.Button; 59 | checkBoxFloat.Dock = DockStyle.Top; 60 | checkBoxFloat.Height = 24; 61 | checkBoxFloat.Text = Strings.DockAreaEditor_FloatCheckBoxText; 62 | checkBoxFloat.TextAlign = ContentAlignment.MiddleCenter; 63 | checkBoxFloat.FlatStyle = FlatStyle.System; 64 | 65 | checkBoxDockLeft.Appearance = System.Windows.Forms.Appearance.Button; 66 | checkBoxDockLeft.Dock = System.Windows.Forms.DockStyle.Left; 67 | checkBoxDockLeft.Width = 24; 68 | checkBoxDockLeft.FlatStyle = FlatStyle.System; 69 | 70 | checkBoxDockRight.Appearance = System.Windows.Forms.Appearance.Button; 71 | checkBoxDockRight.Dock = System.Windows.Forms.DockStyle.Right; 72 | checkBoxDockRight.Width = 24; 73 | checkBoxDockRight.FlatStyle = FlatStyle.System; 74 | 75 | checkBoxDockTop.Appearance = System.Windows.Forms.Appearance.Button; 76 | checkBoxDockTop.Dock = System.Windows.Forms.DockStyle.Top; 77 | checkBoxDockTop.Height = 24; 78 | checkBoxDockTop.FlatStyle = FlatStyle.System; 79 | 80 | checkBoxDockBottom.Appearance = System.Windows.Forms.Appearance.Button; 81 | checkBoxDockBottom.Dock = System.Windows.Forms.DockStyle.Bottom; 82 | checkBoxDockBottom.Height = 24; 83 | checkBoxDockBottom.FlatStyle = FlatStyle.System; 84 | 85 | checkBoxDockFill.Appearance = System.Windows.Forms.Appearance.Button; 86 | checkBoxDockFill.Dock = System.Windows.Forms.DockStyle.Fill; 87 | checkBoxDockFill.FlatStyle = FlatStyle.System; 88 | 89 | this.Controls.AddRange(new Control[] { 90 | checkBoxDockFill, 91 | checkBoxDockBottom, 92 | checkBoxDockTop, 93 | checkBoxDockRight, 94 | checkBoxDockLeft, 95 | checkBoxFloat}); 96 | 97 | Size = new System.Drawing.Size(160, 144); 98 | BackColor = SystemColors.Control; 99 | ResumeLayout(); 100 | } 101 | 102 | public void SetStates(DockAreas dockAreas) 103 | { 104 | m_oldDockAreas = dockAreas; 105 | if ((dockAreas & DockAreas.DockLeft) != 0) 106 | checkBoxDockLeft.Checked = true; 107 | if ((dockAreas & DockAreas.DockRight) != 0) 108 | checkBoxDockRight.Checked = true; 109 | if ((dockAreas & DockAreas.DockTop) != 0) 110 | checkBoxDockTop.Checked = true; 111 | if ((dockAreas & DockAreas.DockTop) != 0) 112 | checkBoxDockTop.Checked = true; 113 | if ((dockAreas & DockAreas.DockBottom) != 0) 114 | checkBoxDockBottom.Checked = true; 115 | if ((dockAreas & DockAreas.Document) != 0) 116 | checkBoxDockFill.Checked = true; 117 | if ((dockAreas & DockAreas.Float) != 0) 118 | checkBoxFloat.Checked = true; 119 | } 120 | } 121 | 122 | private DockAreasEditor.DockAreasEditorControl m_ui = null; 123 | 124 | public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) 125 | { 126 | return UITypeEditorEditStyle.DropDown; 127 | } 128 | 129 | public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value) 130 | { 131 | if (m_ui == null) 132 | m_ui = new DockAreasEditor.DockAreasEditorControl(); 133 | 134 | m_ui.SetStates((DockAreas)value); 135 | 136 | IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService)); 137 | edSvc.DropDownControl(m_ui); 138 | 139 | return m_ui.DockAreas; 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockContentCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | 6 | namespace WeifenLuo.WinFormsUI.Docking 7 | { 8 | public class DockContentCollection : ReadOnlyCollection 9 | { 10 | private static List _emptyList = new List(0); 11 | 12 | internal DockContentCollection() 13 | : base(new List()) 14 | { 15 | } 16 | 17 | internal DockContentCollection(DockPane pane) 18 | : base(_emptyList) 19 | { 20 | m_dockPane = pane; 21 | } 22 | 23 | private DockPane m_dockPane = null; 24 | private DockPane DockPane 25 | { 26 | get { return m_dockPane; } 27 | } 28 | 29 | public new IDockContent this[int index] 30 | { 31 | get 32 | { 33 | if (DockPane == null) 34 | return Items[index] as IDockContent; 35 | else 36 | return GetVisibleContent(index); 37 | } 38 | } 39 | 40 | internal int Add(IDockContent content) 41 | { 42 | #if DEBUG 43 | if (DockPane != null) 44 | throw new InvalidOperationException(); 45 | #endif 46 | 47 | if (Contains(content)) 48 | return IndexOf(content); 49 | 50 | Items.Add(content); 51 | return Count - 1; 52 | } 53 | 54 | internal void AddAt(IDockContent content, int index) 55 | { 56 | #if DEBUG 57 | if (DockPane != null) 58 | throw new InvalidOperationException(); 59 | #endif 60 | 61 | if (index < 0 || index > Items.Count - 1) 62 | return; 63 | 64 | if (Contains(content)) 65 | return; 66 | 67 | Items.Insert(index, content); 68 | } 69 | 70 | public new bool Contains(IDockContent content) 71 | { 72 | if (DockPane == null) 73 | return Items.Contains(content); 74 | else 75 | return (GetIndexOfVisibleContents(content) != -1); 76 | } 77 | 78 | public new int Count 79 | { 80 | get 81 | { 82 | if (DockPane == null) 83 | return base.Count; 84 | else 85 | return CountOfVisibleContents; 86 | } 87 | } 88 | 89 | public new int IndexOf(IDockContent content) 90 | { 91 | if (DockPane == null) 92 | { 93 | if (!Contains(content)) 94 | return -1; 95 | else 96 | return Items.IndexOf(content); 97 | } 98 | else 99 | return GetIndexOfVisibleContents(content); 100 | } 101 | 102 | internal void Remove(IDockContent content) 103 | { 104 | if (DockPane != null) 105 | throw new InvalidOperationException(); 106 | 107 | if (!Contains(content)) 108 | return; 109 | 110 | Items.Remove(content); 111 | } 112 | 113 | private int CountOfVisibleContents 114 | { 115 | get 116 | { 117 | #if DEBUG 118 | if (DockPane == null) 119 | throw new InvalidOperationException(); 120 | #endif 121 | 122 | int count = 0; 123 | foreach (IDockContent content in DockPane.Contents) 124 | { 125 | if (content.DockHandler.DockState == DockPane.DockState) 126 | count++; 127 | } 128 | return count; 129 | } 130 | } 131 | 132 | private IDockContent GetVisibleContent(int index) 133 | { 134 | #if DEBUG 135 | if (DockPane == null) 136 | throw new InvalidOperationException(); 137 | #endif 138 | 139 | int currentIndex = -1; 140 | foreach (IDockContent content in DockPane.Contents) 141 | { 142 | if (content.DockHandler.DockState == DockPane.DockState) 143 | currentIndex++; 144 | 145 | if (currentIndex == index) 146 | return content; 147 | } 148 | throw (new ArgumentOutOfRangeException()); 149 | } 150 | 151 | private int GetIndexOfVisibleContents(IDockContent content) 152 | { 153 | #if DEBUG 154 | if (DockPane == null) 155 | throw new InvalidOperationException(); 156 | #endif 157 | 158 | if (content == null) 159 | return -1; 160 | 161 | int index = -1; 162 | foreach (IDockContent c in DockPane.Contents) 163 | { 164 | if (c.DockHandler.DockState == DockPane.DockState) 165 | { 166 | index++; 167 | 168 | if (c == content) 169 | return index; 170 | } 171 | } 172 | return -1; 173 | } 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockContentEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WeifenLuo.WinFormsUI.Docking 4 | { 5 | public class DockContentEventArgs : EventArgs 6 | { 7 | private IDockContent m_content; 8 | 9 | public DockContentEventArgs(IDockContent content) 10 | { 11 | m_content = content; 12 | } 13 | 14 | public IDockContent Content 15 | { 16 | get { return m_content; } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockOutlineBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace WeifenLuo.WinFormsUI.Docking 6 | { 7 | internal abstract class DockOutlineBase 8 | { 9 | public DockOutlineBase() 10 | { 11 | Init(); 12 | } 13 | 14 | private void Init() 15 | { 16 | SetValues(Rectangle.Empty, null, DockStyle.None, -1); 17 | SaveOldValues(); 18 | } 19 | 20 | private Rectangle m_oldFloatWindowBounds; 21 | protected Rectangle OldFloatWindowBounds 22 | { 23 | get { return m_oldFloatWindowBounds; } 24 | } 25 | 26 | private Control m_oldDockTo; 27 | protected Control OldDockTo 28 | { 29 | get { return m_oldDockTo; } 30 | } 31 | 32 | private DockStyle m_oldDock; 33 | protected DockStyle OldDock 34 | { 35 | get { return m_oldDock; } 36 | } 37 | 38 | private int m_oldContentIndex; 39 | protected int OldContentIndex 40 | { 41 | get { return m_oldContentIndex; } 42 | } 43 | 44 | protected bool SameAsOldValue 45 | { 46 | get 47 | { 48 | return FloatWindowBounds == OldFloatWindowBounds && 49 | DockTo == OldDockTo && 50 | Dock == OldDock && 51 | ContentIndex == OldContentIndex; 52 | } 53 | } 54 | 55 | private Rectangle m_floatWindowBounds; 56 | public Rectangle FloatWindowBounds 57 | { 58 | get { return m_floatWindowBounds; } 59 | } 60 | 61 | private Control m_dockTo; 62 | public Control DockTo 63 | { 64 | get { return m_dockTo; } 65 | } 66 | 67 | private DockStyle m_dock; 68 | public DockStyle Dock 69 | { 70 | get { return m_dock; } 71 | } 72 | 73 | private int m_contentIndex; 74 | public int ContentIndex 75 | { 76 | get { return m_contentIndex; } 77 | } 78 | 79 | public bool FlagFullEdge 80 | { 81 | get { return m_contentIndex != 0; } 82 | } 83 | 84 | private bool m_flagTestDrop = false; 85 | public bool FlagTestDrop 86 | { 87 | get { return m_flagTestDrop; } 88 | set { m_flagTestDrop = value; } 89 | } 90 | 91 | private void SaveOldValues() 92 | { 93 | m_oldDockTo = m_dockTo; 94 | m_oldDock = m_dock; 95 | m_oldContentIndex = m_contentIndex; 96 | m_oldFloatWindowBounds = m_floatWindowBounds; 97 | } 98 | 99 | protected abstract void OnShow(); 100 | 101 | protected abstract void OnClose(); 102 | 103 | private void SetValues(Rectangle floatWindowBounds, Control dockTo, DockStyle dock, int contentIndex) 104 | { 105 | m_floatWindowBounds = floatWindowBounds; 106 | m_dockTo = dockTo; 107 | m_dock = dock; 108 | m_contentIndex = contentIndex; 109 | FlagTestDrop = true; 110 | } 111 | 112 | private void TestChange() 113 | { 114 | if (m_floatWindowBounds != m_oldFloatWindowBounds || 115 | m_dockTo != m_oldDockTo || 116 | m_dock != m_oldDock || 117 | m_contentIndex != m_oldContentIndex) 118 | OnShow(); 119 | } 120 | 121 | public void Show() 122 | { 123 | SaveOldValues(); 124 | SetValues(Rectangle.Empty, null, DockStyle.None, -1); 125 | TestChange(); 126 | } 127 | 128 | public void Show(DockPane pane, DockStyle dock) 129 | { 130 | SaveOldValues(); 131 | SetValues(Rectangle.Empty, pane, dock, -1); 132 | TestChange(); 133 | } 134 | 135 | public void Show(DockPane pane, int contentIndex) 136 | { 137 | SaveOldValues(); 138 | SetValues(Rectangle.Empty, pane, DockStyle.Fill, contentIndex); 139 | TestChange(); 140 | } 141 | 142 | public void Show(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge) 143 | { 144 | SaveOldValues(); 145 | SetValues(Rectangle.Empty, dockPanel, dock, fullPanelEdge ? -1 : 0); 146 | TestChange(); 147 | } 148 | 149 | public void Show(Rectangle floatWindowBounds) 150 | { 151 | SaveOldValues(); 152 | SetValues(floatWindowBounds, null, DockStyle.None, -1); 153 | TestChange(); 154 | } 155 | 156 | public void Close() 157 | { 158 | OnClose(); 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockPaneCaptionBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using System.Drawing; 4 | using System.Runtime.InteropServices; 5 | using System.Security.Permissions; 6 | 7 | namespace WeifenLuo.WinFormsUI.Docking 8 | { 9 | public abstract class DockPaneCaptionBase : Control 10 | { 11 | protected internal DockPaneCaptionBase(DockPane pane) 12 | { 13 | m_dockPane = pane; 14 | 15 | SetStyle(ControlStyles.OptimizedDoubleBuffer | 16 | ControlStyles.ResizeRedraw | 17 | ControlStyles.UserPaint | 18 | ControlStyles.AllPaintingInWmPaint, true); 19 | SetStyle(ControlStyles.Selectable, false); 20 | } 21 | 22 | private DockPane m_dockPane; 23 | protected DockPane DockPane 24 | { 25 | get { return m_dockPane; } 26 | } 27 | 28 | protected DockPane.AppearanceStyle Appearance 29 | { 30 | get { return DockPane.Appearance; } 31 | } 32 | 33 | protected bool HasTabPageContextMenu 34 | { 35 | get { return DockPane.HasTabPageContextMenu; } 36 | } 37 | 38 | protected void ShowTabPageContextMenu(Point position) 39 | { 40 | DockPane.ShowTabPageContextMenu(this, position); 41 | } 42 | 43 | protected override void OnMouseUp(MouseEventArgs e) 44 | { 45 | base.OnMouseUp(e); 46 | 47 | if (e.Button == MouseButtons.Right) 48 | ShowTabPageContextMenu(new Point(e.X, e.Y)); 49 | } 50 | 51 | protected override void OnMouseDown(MouseEventArgs e) 52 | { 53 | base.OnMouseDown(e); 54 | 55 | if (e.Button == MouseButtons.Left && 56 | DockPane.DockPanel.AllowEndUserDocking && 57 | DockPane.AllowDockDragAndDrop && 58 | !DockHelper.IsDockStateAutoHide(DockPane.DockState) && 59 | DockPane.ActiveContent != null) 60 | DockPane.DockPanel.BeginDrag(DockPane); 61 | } 62 | 63 | [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] 64 | protected override void WndProc(ref Message m) 65 | { 66 | if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK) 67 | { 68 | if (DockHelper.IsDockStateAutoHide(DockPane.DockState)) 69 | { 70 | DockPane.DockPanel.ActiveAutoHideContent = null; 71 | return; 72 | } 73 | 74 | if (DockPane.IsFloat) 75 | DockPane.RestoreToPanel(); 76 | else 77 | DockPane.Float(); 78 | } 79 | base.WndProc(ref m); 80 | } 81 | 82 | internal void RefreshChanges() 83 | { 84 | if (IsDisposed) 85 | return; 86 | 87 | OnRefreshChanges(); 88 | } 89 | 90 | protected virtual void OnRightToLeftLayoutChanged() 91 | { 92 | } 93 | 94 | protected virtual void OnRefreshChanges() 95 | { 96 | } 97 | 98 | protected internal abstract int MeasureHeight(); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockPaneCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.ObjectModel; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Windows.Forms; 6 | 7 | namespace WeifenLuo.WinFormsUI.Docking 8 | { 9 | public class DockPaneCollection : ReadOnlyCollection 10 | { 11 | internal DockPaneCollection() 12 | : base(new List()) 13 | { 14 | } 15 | 16 | internal int Add(DockPane pane) 17 | { 18 | if (Items.Contains(pane)) 19 | return Items.IndexOf(pane); 20 | 21 | Items.Add(pane); 22 | return Count - 1; 23 | } 24 | 25 | internal void AddAt(DockPane pane, int index) 26 | { 27 | if (index < 0 || index > Items.Count - 1) 28 | return; 29 | 30 | if (Contains(pane)) 31 | return; 32 | 33 | Items.Insert(index, pane); 34 | } 35 | 36 | internal void Dispose() 37 | { 38 | for (int i=Count - 1; i>=0; i--) 39 | this[i].Close(); 40 | } 41 | 42 | internal void Remove(DockPane pane) 43 | { 44 | Items.Remove(pane); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockPanel.DragHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | using System.Drawing; 6 | using System.Drawing.Drawing2D; 7 | using System.ComponentModel; 8 | 9 | namespace WeifenLuo.WinFormsUI.Docking 10 | { 11 | partial class DockPanel 12 | { 13 | /// 14 | /// DragHandlerBase is the base class for drag handlers. The derived class should: 15 | /// 1. Define its public method BeginDrag. From within this public BeginDrag method, 16 | /// DragHandlerBase.BeginDrag should be called to initialize the mouse capture 17 | /// and message filtering. 18 | /// 2. Override the OnDragging and OnEndDrag methods. 19 | /// 20 | private abstract class DragHandlerBase : NativeWindow, IMessageFilter 21 | { 22 | protected DragHandlerBase() 23 | { 24 | } 25 | 26 | protected abstract Control DragControl 27 | { 28 | get; 29 | } 30 | 31 | private Point m_startMousePosition = Point.Empty; 32 | protected Point StartMousePosition 33 | { 34 | get { return m_startMousePosition; } 35 | private set { m_startMousePosition = value; } 36 | } 37 | 38 | protected bool BeginDrag() 39 | { 40 | // Avoid re-entrance; 41 | lock (this) 42 | { 43 | if (DragControl == null) 44 | return false; 45 | 46 | StartMousePosition = Control.MousePosition; 47 | 48 | if (!NativeMethods.DragDetect(DragControl.Handle, StartMousePosition)) 49 | return false; 50 | 51 | DragControl.FindForm().Capture = true; 52 | AssignHandle(DragControl.FindForm().Handle); 53 | Application.AddMessageFilter(this); 54 | return true; 55 | } 56 | } 57 | 58 | protected abstract void OnDragging(); 59 | 60 | protected abstract void OnEndDrag(bool abort); 61 | 62 | private void EndDrag(bool abort) 63 | { 64 | ReleaseHandle(); 65 | Application.RemoveMessageFilter(this); 66 | DragControl.FindForm().Capture = false; 67 | 68 | OnEndDrag(abort); 69 | } 70 | 71 | bool IMessageFilter.PreFilterMessage(ref Message m) 72 | { 73 | if (m.Msg == (int)Win32.Msgs.WM_MOUSEMOVE) 74 | OnDragging(); 75 | else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONUP) 76 | EndDrag(false); 77 | else if (m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED) 78 | EndDrag(true); 79 | else if (m.Msg == (int)Win32.Msgs.WM_KEYDOWN && (int)m.WParam == (int)Keys.Escape) 80 | EndDrag(true); 81 | 82 | return OnPreFilterMessage(ref m); 83 | } 84 | 85 | protected virtual bool OnPreFilterMessage(ref Message m) 86 | { 87 | return false; 88 | } 89 | 90 | protected sealed override void WndProc(ref Message m) 91 | { 92 | if (m.Msg == (int)Win32.Msgs.WM_CANCELMODE || m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED) 93 | EndDrag(true); 94 | 95 | base.WndProc(ref m); 96 | } 97 | } 98 | 99 | private abstract class DragHandler : DragHandlerBase 100 | { 101 | private DockPanel m_dockPanel; 102 | 103 | protected DragHandler(DockPanel dockPanel) 104 | { 105 | m_dockPanel = dockPanel; 106 | } 107 | 108 | public DockPanel DockPanel 109 | { 110 | get { return m_dockPanel; } 111 | } 112 | 113 | private IDragSource m_dragSource; 114 | protected IDragSource DragSource 115 | { 116 | get { return m_dragSource; } 117 | set { m_dragSource = value; } 118 | } 119 | 120 | protected sealed override Control DragControl 121 | { 122 | get { return DragSource == null ? null : DragSource.DragControl; } 123 | } 124 | 125 | protected sealed override bool OnPreFilterMessage(ref Message m) 126 | { 127 | if ((m.Msg == (int)Win32.Msgs.WM_KEYDOWN || m.Msg == (int)Win32.Msgs.WM_KEYUP) && 128 | ((int)m.WParam == (int)Keys.ControlKey || (int)m.WParam == (int)Keys.ShiftKey)) 129 | OnDragging(); 130 | 131 | return base.OnPreFilterMessage(ref m); 132 | } 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockPanel.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/DockPanel.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockWindow.SplitterControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Windows.Forms; 6 | 7 | namespace WeifenLuo.WinFormsUI.Docking 8 | { 9 | public partial class DockWindow 10 | { 11 | private class SplitterControl : SplitterBase 12 | { 13 | protected override int SplitterSize 14 | { 15 | get { return Measures.SplitterSize; } 16 | } 17 | 18 | protected override void StartDrag() 19 | { 20 | DockWindow window = Parent as DockWindow; 21 | if (window == null) 22 | return; 23 | 24 | window.DockPanel.BeginDrag(window, window.RectangleToScreen(Bounds)); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DockWindowCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | 5 | namespace WeifenLuo.WinFormsUI.Docking 6 | { 7 | public class DockWindowCollection : ReadOnlyCollection 8 | { 9 | internal DockWindowCollection(DockPanel dockPanel) 10 | : base(new List()) 11 | { 12 | Items.Add(new DockWindow(dockPanel, DockState.Document)); 13 | Items.Add(new DockWindow(dockPanel, DockState.DockLeft)); 14 | Items.Add(new DockWindow(dockPanel, DockState.DockRight)); 15 | Items.Add(new DockWindow(dockPanel, DockState.DockTop)); 16 | Items.Add(new DockWindow(dockPanel, DockState.DockBottom)); 17 | } 18 | 19 | public DockWindow this [DockState dockState] 20 | { 21 | get 22 | { 23 | if (dockState == DockState.Document) 24 | return Items[0]; 25 | else if (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide) 26 | return Items[1]; 27 | else if (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide) 28 | return Items[2]; 29 | else if (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide) 30 | return Items[3]; 31 | else if (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide) 32 | return Items[4]; 33 | 34 | throw (new ArgumentOutOfRangeException()); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DragForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace WeifenLuo.WinFormsUI.Docking 5 | { 6 | // Inspired by Chris Sano's article: 7 | // http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnwinforms/html/colorpicker.asp 8 | // In Sano's article, the DragForm needs to meet the following criteria: 9 | // (1) it was not to show up in the task bar; 10 | // ShowInTaskBar = false 11 | // (2) it needed to be the top-most window; 12 | // TopMost = true (not necessary here) 13 | // (3) its icon could not show up in the ALT+TAB window if the user pressed ALT+TAB during a drag-and-drop; 14 | // FormBorderStyle = FormBorderStyle.None; 15 | // Create with WS_EX_TOOLWINDOW window style. 16 | // Compares with the solution in the artile by setting FormBorderStyle as FixedToolWindow, 17 | // and then clip the window caption and border, this way is much simplier. 18 | // (4) it was not to steal focus from the application when displayed. 19 | // User Win32 ShowWindow API with SW_SHOWNOACTIVATE 20 | // In addition, this form should only for display and therefore should act as transparent, otherwise 21 | // WindowFromPoint will return this form, instead of the control beneath. Need BOTH of the following to 22 | // achieve this (don't know why, spent hours to try it out :( ): 23 | // 1. Enabled = false; 24 | // 2. WM_NCHITTEST returns HTTRANSPARENT 25 | internal class DragForm : Form 26 | { 27 | public DragForm() 28 | { 29 | FormBorderStyle = FormBorderStyle.None; 30 | ShowInTaskbar = false; 31 | SetStyle(ControlStyles.Selectable, false); 32 | Enabled = false; 33 | } 34 | 35 | protected override CreateParams CreateParams 36 | { 37 | get 38 | { 39 | CreateParams createParams = base.CreateParams; 40 | createParams.ExStyle |= (int)Win32.WindowExStyles.WS_EX_TOOLWINDOW; 41 | return createParams; 42 | } 43 | } 44 | 45 | protected override void WndProc(ref Message m) 46 | { 47 | if (m.Msg == (int)Win32.Msgs.WM_NCHITTEST) 48 | { 49 | m.Result = (IntPtr)Win32.HitTest.HTTRANSPARENT; 50 | return; 51 | } 52 | 53 | base.WndProc (ref m); 54 | } 55 | 56 | public virtual void Show(bool bActivate) 57 | { 58 | if (bActivate) 59 | Show(); 60 | else 61 | NativeMethods.ShowWindow(Handle, (int)Win32.ShowWindowStyles.SW_SHOWNOACTIVATE); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/DummyControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace WeifenLuo.WinFormsUI.Docking 5 | { 6 | internal class DummyControl : Control 7 | { 8 | public DummyControl() 9 | { 10 | SetStyle(ControlStyles.Selectable, false); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Enums.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Windows.Forms; 4 | 5 | namespace WeifenLuo.WinFormsUI.Docking 6 | { 7 | [Flags] 8 | [Serializable] 9 | [Editor(typeof(DockAreasEditor), typeof(System.Drawing.Design.UITypeEditor))] 10 | public enum DockAreas 11 | { 12 | Float = 1, 13 | DockLeft = 2, 14 | DockRight = 4, 15 | DockTop = 8, 16 | DockBottom = 16, 17 | Document = 32 18 | } 19 | 20 | public enum DockState 21 | { 22 | Unknown = 0, 23 | Float = 1, 24 | DockTopAutoHide = 2, 25 | DockLeftAutoHide = 3, 26 | DockBottomAutoHide = 4, 27 | DockRightAutoHide = 5, 28 | Document = 6, 29 | DockTop = 7, 30 | DockLeft = 8, 31 | DockBottom = 9, 32 | DockRight = 10, 33 | Hidden = 11 34 | } 35 | 36 | public enum DockAlignment 37 | { 38 | Left, 39 | Right, 40 | Top, 41 | Bottom 42 | } 43 | 44 | public enum DocumentStyle 45 | { 46 | DockingMdi, 47 | DockingWindow, 48 | DockingSdi, 49 | SystemMdi, 50 | } 51 | 52 | /// 53 | /// The location to draw the DockPaneStrip for Document style windows. 54 | /// 55 | public enum DocumentTabStripLocation 56 | { 57 | Top, 58 | Bottom 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/FloatWindowCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Drawing; 5 | using System.Windows.Forms; 6 | 7 | namespace WeifenLuo.WinFormsUI.Docking 8 | { 9 | public class FloatWindowCollection : ReadOnlyCollection 10 | { 11 | internal FloatWindowCollection() 12 | : base(new List()) 13 | { 14 | } 15 | 16 | internal int Add(FloatWindow fw) 17 | { 18 | if (Items.Contains(fw)) 19 | return Items.IndexOf(fw); 20 | 21 | Items.Add(fw); 22 | return Count - 1; 23 | } 24 | 25 | internal void Dispose() 26 | { 27 | for (int i=Count - 1; i>=0; i--) 28 | this[i].Close(); 29 | } 30 | 31 | internal void Remove(FloatWindow fw) 32 | { 33 | Items.Remove(fw); 34 | } 35 | 36 | internal void BringWindowToFront(FloatWindow fw) 37 | { 38 | Items.Remove(fw); 39 | Items.Add(fw); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Helpers/DockHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace WeifenLuo.WinFormsUI.Docking 6 | { 7 | internal static class DockHelper 8 | { 9 | public static bool IsDockStateAutoHide(DockState dockState) 10 | { 11 | if (dockState == DockState.DockLeftAutoHide || 12 | dockState == DockState.DockRightAutoHide || 13 | dockState == DockState.DockTopAutoHide || 14 | dockState == DockState.DockBottomAutoHide) 15 | return true; 16 | else 17 | return false; 18 | } 19 | 20 | public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas) 21 | { 22 | if (((dockableAreas & DockAreas.Float) == 0) && 23 | (dockState == DockState.Float)) 24 | return false; 25 | else if (((dockableAreas & DockAreas.Document) == 0) && 26 | (dockState == DockState.Document)) 27 | return false; 28 | else if (((dockableAreas & DockAreas.DockLeft) == 0) && 29 | (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide)) 30 | return false; 31 | else if (((dockableAreas & DockAreas.DockRight) == 0) && 32 | (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide)) 33 | return false; 34 | else if (((dockableAreas & DockAreas.DockTop) == 0) && 35 | (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide)) 36 | return false; 37 | else if (((dockableAreas & DockAreas.DockBottom) == 0) && 38 | (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide)) 39 | return false; 40 | else 41 | return true; 42 | } 43 | 44 | public static bool IsDockWindowState(DockState state) 45 | { 46 | if (state == DockState.DockTop || state == DockState.DockBottom || state == DockState.DockLeft || 47 | state == DockState.DockRight || state == DockState.Document) 48 | return true; 49 | else 50 | return false; 51 | } 52 | 53 | public static DockState ToggleAutoHideState(DockState state) 54 | { 55 | if (state == DockState.DockLeft) 56 | return DockState.DockLeftAutoHide; 57 | else if (state == DockState.DockRight) 58 | return DockState.DockRightAutoHide; 59 | else if (state == DockState.DockTop) 60 | return DockState.DockTopAutoHide; 61 | else if (state == DockState.DockBottom) 62 | return DockState.DockBottomAutoHide; 63 | else if (state == DockState.DockLeftAutoHide) 64 | return DockState.DockLeft; 65 | else if (state == DockState.DockRightAutoHide) 66 | return DockState.DockRight; 67 | else if (state == DockState.DockTopAutoHide) 68 | return DockState.DockTop; 69 | else if (state == DockState.DockBottomAutoHide) 70 | return DockState.DockBottom; 71 | else 72 | return state; 73 | } 74 | 75 | public static DockPane PaneAtPoint(Point pt, DockPanel dockPanel) 76 | { 77 | for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent) 78 | { 79 | IDockContent content = control as IDockContent; 80 | if (content != null && content.DockHandler.DockPanel == dockPanel) 81 | return content.DockHandler.Pane; 82 | 83 | DockPane pane = control as DockPane; 84 | if (pane != null && pane.DockPanel == dockPanel) 85 | return pane; 86 | } 87 | 88 | return null; 89 | } 90 | 91 | public static FloatWindow FloatWindowAtPoint(Point pt, DockPanel dockPanel) 92 | { 93 | for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent) 94 | { 95 | FloatWindow floatWindow = control as FloatWindow; 96 | if (floatWindow != null && floatWindow.DockPanel == dockPanel) 97 | return floatWindow; 98 | } 99 | 100 | return null; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Helpers/DrawHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Drawing2D; 4 | using System.Drawing.Imaging; 5 | using System.Windows.Forms; 6 | 7 | namespace WeifenLuo.WinFormsUI.Docking 8 | { 9 | internal static class DrawHelper 10 | { 11 | public static Point RtlTransform(Control control, Point point) 12 | { 13 | if (control.RightToLeft != RightToLeft.Yes) 14 | return point; 15 | else 16 | return new Point(control.Right - point.X, point.Y); 17 | } 18 | 19 | public static Rectangle RtlTransform(Control control, Rectangle rectangle) 20 | { 21 | if (control.RightToLeft != RightToLeft.Yes) 22 | return rectangle; 23 | else 24 | return new Rectangle(control.ClientRectangle.Right - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height); 25 | } 26 | 27 | public static GraphicsPath GetRoundedCornerTab(GraphicsPath graphicsPath, Rectangle rect, bool upCorner) 28 | { 29 | if (graphicsPath == null) 30 | graphicsPath = new GraphicsPath(); 31 | else 32 | graphicsPath.Reset(); 33 | 34 | int curveSize = 6; 35 | if (upCorner) 36 | { 37 | graphicsPath.AddLine(rect.Left, rect.Bottom, rect.Left, rect.Top + curveSize / 2); 38 | graphicsPath.AddArc(new Rectangle(rect.Left, rect.Top, curveSize, curveSize), 180, 90); 39 | graphicsPath.AddLine(rect.Left + curveSize / 2, rect.Top, rect.Right - curveSize / 2, rect.Top); 40 | graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Top, curveSize, curveSize), -90, 90); 41 | graphicsPath.AddLine(rect.Right, rect.Top + curveSize / 2, rect.Right, rect.Bottom); 42 | } 43 | else 44 | { 45 | graphicsPath.AddLine(rect.Right, rect.Top, rect.Right, rect.Bottom - curveSize / 2); 46 | graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize), 0, 90); 47 | graphicsPath.AddLine(rect.Right - curveSize / 2, rect.Bottom, rect.Left + curveSize / 2, rect.Bottom); 48 | graphicsPath.AddArc(new Rectangle(rect.Left, rect.Bottom - curveSize, curveSize, curveSize), 90, 90); 49 | graphicsPath.AddLine(rect.Left, rect.Bottom - curveSize / 2, rect.Left, rect.Top); 50 | } 51 | 52 | return graphicsPath; 53 | } 54 | 55 | public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap) 56 | { 57 | return CalculateGraphicsPathFromBitmap(bitmap, Color.Empty); 58 | } 59 | 60 | // From http://edu.cnzz.cn/show_3281.html 61 | public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap, Color colorTransparent) 62 | { 63 | GraphicsPath graphicsPath = new GraphicsPath(); 64 | if (colorTransparent == Color.Empty) 65 | colorTransparent = bitmap.GetPixel(0, 0); 66 | 67 | for(int row = 0; row < bitmap.Height; row ++) 68 | { 69 | int colOpaquePixel = 0; 70 | for(int col = 0; col < bitmap.Width; col ++) 71 | { 72 | if(bitmap.GetPixel(col, row) != colorTransparent) 73 | { 74 | colOpaquePixel = col; 75 | int colNext = col; 76 | for(colNext = colOpaquePixel; colNext < bitmap.Width; colNext ++) 77 | if(bitmap.GetPixel(colNext, row) == colorTransparent) 78 | break; 79 | 80 | graphicsPath.AddRectangle(new Rectangle(colOpaquePixel, row, colNext - colOpaquePixel, 1)); 81 | col = colNext; 82 | } 83 | } 84 | } 85 | return graphicsPath; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Helpers/ResourceHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Reflection; 4 | using System.Resources; 5 | using System.Windows.Forms; 6 | 7 | namespace WeifenLuo.WinFormsUI.Docking 8 | { 9 | internal static class ResourceHelper 10 | { 11 | private static ResourceManager _resourceManager = null; 12 | 13 | private static ResourceManager ResourceManager 14 | { 15 | get 16 | { 17 | if (_resourceManager == null) 18 | _resourceManager = new ResourceManager("WeifenLuo.WinFormsUI.Docking.Strings", typeof(ResourceHelper).Assembly); 19 | return _resourceManager; 20 | } 21 | 22 | } 23 | 24 | public static string GetString(string name) 25 | { 26 | return ResourceManager.GetString(name); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Helpers/Win32Helper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace WeifenLuo.WinFormsUI.Docking 6 | { 7 | internal static class Win32Helper 8 | { 9 | public static Control ControlAtPoint(Point pt) 10 | { 11 | return Control.FromChildHandle(NativeMethods.WindowFromPoint(pt)); 12 | } 13 | 14 | public static uint MakeLong(int low, int high) 15 | { 16 | return (uint)((high << 16) + low); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/InertButtonBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | using System.Drawing; 6 | using System.Drawing.Imaging; 7 | 8 | namespace WeifenLuo.WinFormsUI.Docking 9 | { 10 | internal abstract class InertButtonBase : Control 11 | { 12 | protected InertButtonBase() 13 | { 14 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 15 | BackColor = Color.Transparent; 16 | } 17 | 18 | public abstract Bitmap Image 19 | { 20 | get; 21 | } 22 | 23 | private bool m_isMouseOver = false; 24 | protected bool IsMouseOver 25 | { 26 | get { return m_isMouseOver; } 27 | private set 28 | { 29 | if (m_isMouseOver == value) 30 | return; 31 | 32 | m_isMouseOver = value; 33 | Invalidate(); 34 | } 35 | } 36 | 37 | protected override Size DefaultSize 38 | { 39 | get { return Resources.DockPane_Close.Size; } 40 | } 41 | 42 | protected override void OnMouseMove(MouseEventArgs e) 43 | { 44 | base.OnMouseMove(e); 45 | bool over = ClientRectangle.Contains(e.X, e.Y); 46 | if (IsMouseOver != over) 47 | IsMouseOver = over; 48 | } 49 | 50 | protected override void OnMouseEnter(EventArgs e) 51 | { 52 | base.OnMouseEnter(e); 53 | if (!IsMouseOver) 54 | IsMouseOver = true; 55 | } 56 | 57 | protected override void OnMouseLeave(EventArgs e) 58 | { 59 | base.OnMouseLeave(e); 60 | if (IsMouseOver) 61 | IsMouseOver = false; 62 | } 63 | 64 | protected override void OnPaint(PaintEventArgs e) 65 | { 66 | if (IsMouseOver && Enabled) 67 | { 68 | using (Pen pen = new Pen(ForeColor)) 69 | { 70 | e.Graphics.DrawRectangle(pen, Rectangle.Inflate(ClientRectangle, -1, -1)); 71 | } 72 | } 73 | 74 | using (ImageAttributes imageAttributes = new ImageAttributes()) 75 | { 76 | ColorMap[] colorMap = new ColorMap[2]; 77 | colorMap[0] = new ColorMap(); 78 | colorMap[0].OldColor = Color.FromArgb(0, 0, 0); 79 | colorMap[0].NewColor = ForeColor; 80 | colorMap[1] = new ColorMap(); 81 | colorMap[1].OldColor = Image.GetPixel(0, 0); 82 | colorMap[1].NewColor = Color.Transparent; 83 | 84 | imageAttributes.SetRemapTable(colorMap); 85 | 86 | e.Graphics.DrawImage( 87 | Image, 88 | new Rectangle(0, 0, Image.Width, Image.Height), 89 | 0, 0, 90 | Image.Width, 91 | Image.Height, 92 | GraphicsUnit.Pixel, 93 | imageAttributes); 94 | } 95 | 96 | base.OnPaint(e); 97 | } 98 | 99 | public void RefreshChanges() 100 | { 101 | if (IsDisposed) 102 | return; 103 | 104 | bool mouseOver = ClientRectangle.Contains(PointToClient(Control.MousePosition)); 105 | if (mouseOver != IsMouseOver) 106 | IsMouseOver = mouseOver; 107 | 108 | OnRefreshChanges(); 109 | } 110 | 111 | protected virtual void OnRefreshChanges() 112 | { 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Interfaces.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace WeifenLuo.WinFormsUI.Docking 6 | { 7 | public interface IDockContent 8 | { 9 | DockContentHandler DockHandler { get; } 10 | void OnActivated(EventArgs e); 11 | void OnDeactivate(EventArgs e); 12 | } 13 | 14 | public interface INestedPanesContainer 15 | { 16 | DockState DockState { get; } 17 | Rectangle DisplayingRectangle { get; } 18 | NestedPaneCollection NestedPanes { get; } 19 | VisibleNestedPaneCollection VisibleNestedPanes { get; } 20 | bool IsFloat { get; } 21 | } 22 | 23 | internal interface IDragSource 24 | { 25 | Control DragControl { get; } 26 | } 27 | 28 | internal interface IDockDragSource : IDragSource 29 | { 30 | Rectangle BeginDrag(Point ptMouse); 31 | bool IsDockStateValid(DockState dockState); 32 | bool CanDockTo(DockPane pane); 33 | void FloatAt(Rectangle floatWindowBounds); 34 | void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex); 35 | void DockTo(DockPanel panel, DockStyle dockStyle); 36 | } 37 | 38 | internal interface ISplitterDragSource : IDragSource 39 | { 40 | void BeginDrag(Rectangle rectSplitter); 41 | void EndDrag(); 42 | bool IsVertical { get; } 43 | Rectangle DragLimitBounds { get; } 44 | void MoveSplitter(int offset); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Localization.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | 4 | namespace WeifenLuo.WinFormsUI.Docking 5 | { 6 | [AttributeUsage(AttributeTargets.All)] 7 | internal sealed class LocalizedDescriptionAttribute : DescriptionAttribute 8 | { 9 | private bool m_initialized = false; 10 | 11 | public LocalizedDescriptionAttribute(string key) : base(key) 12 | { 13 | } 14 | 15 | public override string Description 16 | { 17 | get 18 | { 19 | if (!m_initialized) 20 | { 21 | string key = base.Description; 22 | DescriptionValue = ResourceHelper.GetString(key); 23 | if (DescriptionValue == null) 24 | DescriptionValue = String.Empty; 25 | 26 | m_initialized = true; 27 | } 28 | 29 | return DescriptionValue; 30 | } 31 | } 32 | } 33 | 34 | [AttributeUsage(AttributeTargets.All)] 35 | internal sealed class LocalizedCategoryAttribute : CategoryAttribute 36 | { 37 | public LocalizedCategoryAttribute(string key) : base(key) 38 | { 39 | } 40 | 41 | protected override string GetLocalizedString(string key) 42 | { 43 | return ResourceHelper.GetString(key); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Measures.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WeifenLuo.WinFormsUI.Docking 4 | { 5 | internal static class Measures 6 | { 7 | public const int SplitterSize = 4; 8 | } 9 | 10 | internal static class MeasurePane 11 | { 12 | public const int MinSize = 24; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/NestedDockingStatus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace WeifenLuo.WinFormsUI.Docking 5 | { 6 | public sealed class NestedDockingStatus 7 | { 8 | internal NestedDockingStatus(DockPane pane) 9 | { 10 | m_dockPane = pane; 11 | } 12 | 13 | private DockPane m_dockPane = null; 14 | public DockPane DockPane 15 | { 16 | get { return m_dockPane; } 17 | } 18 | 19 | private NestedPaneCollection m_nestedPanes = null; 20 | public NestedPaneCollection NestedPanes 21 | { 22 | get { return m_nestedPanes; } 23 | } 24 | 25 | private DockPane m_previousPane = null; 26 | public DockPane PreviousPane 27 | { 28 | get { return m_previousPane; } 29 | } 30 | 31 | private DockAlignment m_alignment = DockAlignment.Left; 32 | public DockAlignment Alignment 33 | { 34 | get { return m_alignment; } 35 | } 36 | 37 | private double m_proportion = 0.5; 38 | public double Proportion 39 | { 40 | get { return m_proportion; } 41 | } 42 | 43 | private bool m_isDisplaying = false; 44 | public bool IsDisplaying 45 | { 46 | get { return m_isDisplaying; } 47 | } 48 | 49 | private DockPane m_displayingPreviousPane = null; 50 | public DockPane DisplayingPreviousPane 51 | { 52 | get { return m_displayingPreviousPane; } 53 | } 54 | 55 | private DockAlignment m_displayingAlignment = DockAlignment.Left; 56 | public DockAlignment DisplayingAlignment 57 | { 58 | get { return m_displayingAlignment; } 59 | } 60 | 61 | private double m_displayingProportion = 0.5; 62 | public double DisplayingProportion 63 | { 64 | get { return m_displayingProportion; } 65 | } 66 | 67 | private Rectangle m_logicalBounds = Rectangle.Empty; 68 | public Rectangle LogicalBounds 69 | { 70 | get { return m_logicalBounds; } 71 | } 72 | 73 | private Rectangle m_paneBounds = Rectangle.Empty; 74 | public Rectangle PaneBounds 75 | { 76 | get { return m_paneBounds; } 77 | } 78 | 79 | private Rectangle m_splitterBounds = Rectangle.Empty; 80 | public Rectangle SplitterBounds 81 | { 82 | get { return m_splitterBounds; } 83 | } 84 | 85 | internal void SetStatus(NestedPaneCollection nestedPanes, DockPane previousPane, DockAlignment alignment, double proportion) 86 | { 87 | m_nestedPanes = nestedPanes; 88 | m_previousPane = previousPane; 89 | m_alignment = alignment; 90 | m_proportion = proportion; 91 | } 92 | 93 | internal void SetDisplayingStatus(bool isDisplaying, DockPane displayingPreviousPane, DockAlignment displayingAlignment, double displayingProportion) 94 | { 95 | m_isDisplaying = isDisplaying; 96 | m_displayingPreviousPane = displayingPreviousPane; 97 | m_displayingAlignment = displayingAlignment; 98 | m_displayingProportion = displayingProportion; 99 | } 100 | 101 | internal void SetDisplayingBounds(Rectangle logicalBounds, Rectangle paneBounds, Rectangle splitterBounds) 102 | { 103 | m_logicalBounds = logicalBounds; 104 | m_paneBounds = paneBounds; 105 | m_splitterBounds = splitterBounds; 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/NestedPaneCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Drawing; 5 | 6 | namespace WeifenLuo.WinFormsUI.Docking 7 | { 8 | public sealed class NestedPaneCollection : ReadOnlyCollection 9 | { 10 | private INestedPanesContainer m_container; 11 | private VisibleNestedPaneCollection m_visibleNestedPanes; 12 | 13 | internal NestedPaneCollection(INestedPanesContainer container) 14 | : base(new List()) 15 | { 16 | m_container = container; 17 | m_visibleNestedPanes = new VisibleNestedPaneCollection(this); 18 | } 19 | 20 | public INestedPanesContainer Container 21 | { 22 | get { return m_container; } 23 | } 24 | 25 | public VisibleNestedPaneCollection VisibleNestedPanes 26 | { 27 | get { return m_visibleNestedPanes; } 28 | } 29 | 30 | public DockState DockState 31 | { 32 | get { return Container.DockState; } 33 | } 34 | 35 | public bool IsFloat 36 | { 37 | get { return DockState == DockState.Float; } 38 | } 39 | 40 | internal void Add(DockPane pane) 41 | { 42 | if (pane == null) 43 | return; 44 | 45 | NestedPaneCollection oldNestedPanes = (pane.NestedPanesContainer == null) ? null : pane.NestedPanesContainer.NestedPanes; 46 | if (oldNestedPanes != null) 47 | oldNestedPanes.InternalRemove(pane); 48 | Items.Add(pane); 49 | if (oldNestedPanes != null) 50 | oldNestedPanes.CheckFloatWindowDispose(); 51 | } 52 | 53 | private void CheckFloatWindowDispose() 54 | { 55 | if (Count == 0 && Container.DockState == DockState.Float) 56 | { 57 | FloatWindow floatWindow = (FloatWindow)Container; 58 | if (!floatWindow.Disposing && !floatWindow.IsDisposed) 59 | NativeMethods.PostMessage(((FloatWindow)Container).Handle, FloatWindow.WM_CHECKDISPOSE, 0, 0); 60 | } 61 | } 62 | 63 | internal void Remove(DockPane pane) 64 | { 65 | InternalRemove(pane); 66 | CheckFloatWindowDispose(); 67 | } 68 | 69 | private void InternalRemove(DockPane pane) 70 | { 71 | if (!Contains(pane)) 72 | return; 73 | 74 | NestedDockingStatus statusPane = pane.NestedDockingStatus; 75 | DockPane lastNestedPane = null; 76 | for (int i=Count - 1; i> IndexOf(pane); i--) 77 | { 78 | if (this[i].NestedDockingStatus.PreviousPane == pane) 79 | { 80 | lastNestedPane = this[i]; 81 | break; 82 | } 83 | } 84 | 85 | if (lastNestedPane != null) 86 | { 87 | int indexLastNestedPane = IndexOf(lastNestedPane); 88 | Items.Remove(lastNestedPane); 89 | Items[IndexOf(pane)] = lastNestedPane; 90 | NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus; 91 | lastNestedDock.SetStatus(this, statusPane.PreviousPane, statusPane.Alignment, statusPane.Proportion); 92 | for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--) 93 | { 94 | NestedDockingStatus status = this[i].NestedDockingStatus; 95 | if (status.PreviousPane == pane) 96 | status.SetStatus(this, lastNestedPane, status.Alignment, status.Proportion); 97 | } 98 | } 99 | else 100 | Items.Remove(pane); 101 | 102 | statusPane.SetStatus(null, null, DockAlignment.Left, 0.5); 103 | statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5); 104 | statusPane.SetDisplayingBounds(Rectangle.Empty, Rectangle.Empty, Rectangle.Empty); 105 | } 106 | 107 | public DockPane GetDefaultPreviousPane(DockPane pane) 108 | { 109 | for (int i=Count-1; i>=0; i--) 110 | if (this[i] != pane) 111 | return this[i]; 112 | 113 | return null; 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Bottom.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Bottom.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Hotspot.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Hotspot.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_HotspotIndex.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_HotspotIndex.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Left.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Left.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Right.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Right.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Top.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Top.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelBottom.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelBottom.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelBottom_Active.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelBottom_Active.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelFill.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelFill.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelFill_Active.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelFill_Active.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelLeft.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelLeft.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelLeft_Active.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelLeft_Active.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelRight.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelRight.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelRight_Active.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelRight_Active.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelTop.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelTop.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockIndicator_PanelTop_Active.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockIndicator_PanelTop_Active.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockPane_AutoHide.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockPane_AutoHide.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockPane_Close.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockPane_Close.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockPane_Dock.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockPane_Dock.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockPane_Option.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockPane_Option.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/DockPane_OptionOverflow.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/DockPane_OptionOverflow.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/Dockindicator_PaneDiamond_Fill.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/Dockindicator_PaneDiamond_Fill.bmp -------------------------------------------------------------------------------- /WinFormsUI/Docking/Resources/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/WinFormsUI/Docking/Resources/Thumbs.db -------------------------------------------------------------------------------- /WinFormsUI/Docking/SplitterBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Windows.Forms; 6 | 7 | namespace WeifenLuo.WinFormsUI.Docking 8 | { 9 | internal class SplitterBase : Control 10 | { 11 | public SplitterBase() 12 | { 13 | SetStyle(ControlStyles.Selectable, false); 14 | } 15 | 16 | public override DockStyle Dock 17 | { 18 | get { return base.Dock; } 19 | set 20 | { 21 | SuspendLayout(); 22 | base.Dock = value; 23 | 24 | if (Dock == DockStyle.Left || Dock == DockStyle.Right) 25 | Width = SplitterSize; 26 | else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom) 27 | Height = SplitterSize; 28 | else 29 | Bounds = Rectangle.Empty; 30 | 31 | if (Dock == DockStyle.Left || Dock == DockStyle.Right) 32 | Cursor = Cursors.VSplit; 33 | else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom) 34 | Cursor = Cursors.HSplit; 35 | else 36 | Cursor = Cursors.Default; 37 | 38 | ResumeLayout(); 39 | } 40 | } 41 | 42 | protected virtual int SplitterSize 43 | { 44 | get { return 0; } 45 | } 46 | 47 | protected override void OnMouseDown(MouseEventArgs e) 48 | { 49 | base.OnMouseDown(e); 50 | 51 | if (e.Button != MouseButtons.Left) 52 | return; 53 | 54 | StartDrag(); 55 | } 56 | 57 | protected virtual void StartDrag() 58 | { 59 | } 60 | 61 | protected override void WndProc(ref Message m) 62 | { 63 | // eat the WM_MOUSEACTIVATE message 64 | if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE) 65 | return; 66 | 67 | base.WndProc(ref m); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /WinFormsUI/Docking/Win32/NativeMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Runtime.InteropServices; 4 | using System.Diagnostics.CodeAnalysis; 5 | using WeifenLuo.WinFormsUI.Docking.Win32; 6 | 7 | namespace WeifenLuo.WinFormsUI.Docking 8 | { 9 | internal static class NativeMethods 10 | { 11 | [DllImport("User32.dll", CharSet=CharSet.Auto)] 12 | [return: MarshalAs(UnmanagedType.Bool)] 13 | public static extern bool DragDetect(IntPtr hWnd, Point pt); 14 | 15 | [DllImport("User32.dll", CharSet=CharSet.Auto)] 16 | public static extern IntPtr GetFocus(); 17 | 18 | [DllImport("User32.dll", CharSet=CharSet.Auto)] 19 | public static extern IntPtr SetFocus(IntPtr hWnd); 20 | 21 | [DllImport("User32.dll", CharSet=CharSet.Auto)] 22 | [return: MarshalAs(UnmanagedType.Bool)] 23 | public static extern bool PostMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam); 24 | 25 | [DllImport("User32.dll", CharSet=CharSet.Auto)] 26 | public static extern uint SendMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam); 27 | 28 | [DllImport("User32.dll", CharSet=CharSet.Auto)] 29 | public static extern int ShowWindow(IntPtr hWnd, short cmdShow); 30 | 31 | [DllImport("User32.dll", CharSet=CharSet.Auto)] 32 | public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndAfter, int X, int Y, int Width, int Height, FlagsSetWindowPos flags); 33 | 34 | [DllImport("user32.dll", CharSet = CharSet.Auto)] 35 | public static extern int GetWindowLong(IntPtr hWnd, int Index); 36 | 37 | [DllImport("user32.dll", CharSet = CharSet.Auto)] 38 | public static extern int SetWindowLong(IntPtr hWnd, int Index, int Value); 39 | 40 | [DllImport("user32.dll", CharSet=CharSet.Auto)] 41 | public static extern int ShowScrollBar(IntPtr hWnd, int wBar, int bShow); 42 | 43 | [DllImport("user32.dll", CharSet=CharSet.Auto)] 44 | //********************************* 45 | // FxCop bug, suppress the message 46 | //********************************* 47 | [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", MessageId = "0")] 48 | public static extern IntPtr WindowFromPoint(Point point); 49 | 50 | [DllImport("Kernel32.dll", CharSet = CharSet.Auto)] 51 | public static extern int GetCurrentThreadId(); 52 | 53 | public delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam); 54 | 55 | [DllImport("user32.dll")] 56 | public static extern IntPtr SetWindowsHookEx(Win32.HookType code, HookProc func, IntPtr hInstance, int threadID); 57 | 58 | [DllImport("user32.dll")] 59 | public static extern int UnhookWindowsHookEx(IntPtr hhook); 60 | 61 | [DllImport("user32.dll")] 62 | public static extern IntPtr CallNextHookEx(IntPtr hhook, int code, IntPtr wParam, IntPtr lParam); 63 | } 64 | } -------------------------------------------------------------------------------- /WinFormsUI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Diagnostics.CodeAnalysis; 6 | 7 | [assembly: AssemblyTitle("DockPanel Suite for .Net 2.0")] 8 | [assembly: AssemblyDescription(".Net Docking Library for Windows Forms")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Weifen Luo")] 11 | [assembly: AssemblyProduct("DockPanel Suite")] 12 | [assembly: AssemblyCopyright("Copyright © Weifen Luo 2007")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | [assembly: CLSCompliant(true)] 16 | 17 | [assembly: ComVisible(false)] 18 | 19 | [assembly: Guid("9d690ef9-ce19-4c69-874c-e24d8eb36aff")] 20 | 21 | [assembly: AssemblyVersion("2.3.1.*")] 22 | [assembly: AssemblyFileVersion("2.3.1.0")] 23 | 24 | [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Weifen")] 25 | [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Luo")] 26 | [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Weifen")] 27 | [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Luo")] 28 | [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Dockable")] -------------------------------------------------------------------------------- /WinFormsUI/license.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007 Weifen Luo (email: weifenluo@yahoo.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /buildhelper/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | using System.Diagnostics; 8 | 9 | namespace buildhelper 10 | { 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | if (args.Length == 1) // updating Version Info 16 | { 17 | string infoPath = args[0]; 18 | if (!infoPath.EndsWith("AssemblyInfo.cs")) 19 | { 20 | Console.WriteLine("Please specify the 'AssemblyInfo.cs' you want to update."); 21 | return; 22 | } 23 | 24 | if (!File.Exists(infoPath)) 25 | { 26 | Console.WriteLine(infoPath + " does not exist."); 27 | return; 28 | } 29 | 30 | try 31 | { 32 | StreamReader reader = File.OpenText(infoPath); 33 | string contents = reader.ReadToEnd(); 34 | reader.Close(); 35 | Regex version = new Regex(@"(\d+\.\d+\.)(\d+)(\.)(\d+)"); 36 | Match versionMatch = version.Match(contents); 37 | string oldVersion = versionMatch.Value; 38 | #if DEBUG 39 | string newVersion = versionMatch.Groups[1].Value + 40 | versionMatch.Groups[2].Value + 41 | versionMatch.Groups[3].Value + 42 | (Convert.ToUInt32(versionMatch.Groups[4].Value) + 1).ToString(); 43 | #else 44 | string newVersion = versionMatch.Groups[1].Value + 45 | (Convert.ToUInt32(versionMatch.Groups[2].Value) + 1).ToString() + 46 | versionMatch.Groups[3].Value + 47 | (Convert.ToUInt32(versionMatch.Groups[4].Value) + 1).ToString(); 48 | #endif 49 | contents = contents.Replace(oldVersion, newVersion); 50 | StreamWriter writer = File.CreateText(infoPath); 51 | writer.Write(contents); 52 | writer.Close(); 53 | Console.WriteLine(string.Format("New version is [{0}]", newVersion)); 54 | } 55 | catch (Exception ex) 56 | { 57 | Console.WriteLine(ex.Message); 58 | } 59 | return; 60 | } 61 | 62 | if (args.Length == 2) // updating WiX Version Info 63 | { 64 | FileVersionInfo version = FileVersionInfo.GetVersionInfo(args[0]); 65 | StreamWriter sw = new StreamWriter(args[1]); 66 | sw.WriteLine(""); 67 | sw.WriteLine(" "); 68 | sw.WriteLine(""); 69 | sw.Close(); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /buildhelper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Allgemeine Informationen über eine Assembly werden über die folgenden 6 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 7 | // die mit einer Assembly verknüpft sind. 8 | [assembly: AssemblyTitle("buildhelper")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("buildhelper")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar 18 | // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von 19 | // COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. 20 | [assembly: ComVisible(false)] 21 | 22 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird 23 | [assembly: Guid("3430edbf-ff75-49b5-a532-835abd929e47")] 24 | 25 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: 26 | // 27 | // Hauptversion 28 | // Nebenversion 29 | // Buildnummer 30 | // Revision 31 | // 32 | // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern 33 | // übernehmen, indem Sie "*" eingeben: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /buildhelper/buildhelper.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.30729 7 | 2.0 8 | {D5599C1D-3A8B-4EBA-B54A-1B17E68CDC6C} 9 | Exe 10 | Properties 11 | buildhelper 12 | buildhelper 13 | v3.5 14 | 512 15 | buildhelper.Program 16 | 17 | 18 | 3.5 19 | 20 | publish\ 21 | true 22 | Disk 23 | false 24 | Foreground 25 | 7 26 | Days 27 | false 28 | false 29 | true 30 | 0 31 | 1.0.0.%2a 32 | false 33 | false 34 | true 35 | 36 | 37 | true 38 | full 39 | false 40 | bin\Debug\ 41 | DEBUG;TRACE 42 | prompt 43 | 4 44 | AllRules.ruleset 45 | 46 | 47 | pdbonly 48 | true 49 | bin\Release\ 50 | TRACE 51 | prompt 52 | 4 53 | AllRules.ruleset 54 | 55 | 56 | true 57 | bin\x86\Debug\ 58 | DEBUG;TRACE 59 | full 60 | x86 61 | prompt 62 | AllRules.ruleset 63 | 64 | 65 | bin\x86\Release\ 66 | TRACE 67 | true 68 | pdbonly 69 | x86 70 | prompt 71 | AllRules.ruleset 72 | 73 | 74 | 75 | 76 | 3.5 77 | 78 | 79 | 3.5 80 | 81 | 82 | 3.5 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | False 94 | .NET Framework 3.5 SP1 Client Profile 95 | false 96 | 97 | 98 | False 99 | .NET Framework 3.5 SP1 100 | true 101 | 102 | 103 | False 104 | Windows Installer 3.1 105 | true 106 | 107 | 108 | 109 | 116 | 117 | copy "$(TargetPath)" "$(SolutionDir)buildhelper.exe" 118 | 119 | -------------------------------------------------------------------------------- /dbghelptest/Makefile: -------------------------------------------------------------------------------- 1 | all: testline.exe 2 | 3 | testline.exe: testline.o 4 | gcc -g -o testline.exe testline.o libdbghelp.a 5 | 6 | testline.o: testline.c 7 | gcc -g -I. -c testline.c -------------------------------------------------------------------------------- /dbghelptest/dbghelp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/dbghelptest/dbghelp.dll -------------------------------------------------------------------------------- /dbghelptest/libdbghelp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactos/reactosdbg/6e23c445628f1e96300a93c8df568449858a21b7/dbghelptest/libdbghelp.a --------------------------------------------------------------------------------