private Dumper(string applicationPath, string dumpPath, bool miniDump) { this.dumpPath = dumpPath; this.miniDump = miniDump; // Create debugging client IDebugClient clientBase = DebugClient.DebugCreate(); // Cast to upper clients client = (IDebugClient7)clientBase; control = (IDebugControl7)client; client.SetEventCallbacks(this); client.CreateProcessAndAttach(0, applicationPath, 0x00000002); }
public void Attach() { Task.Run(() => { this.Client = DebugClient.DebugCreate(); IDebugClient7 client = this.Client as IDebugClient7; IDebugControl6 control = this.Client as IDebugControl6; client.SetOutputCallbacksWide(new OutputCallBacks()); client.SetEventCallbacksWide(new EventCallBacks(control)); this.Client.AttachProcess(0, unchecked ((UInt32)this.SystemProcess.Id), DebugAttach.InvasiveNoInitialBreak); while (true) { control.WaitForEvent(0, UInt32.MaxValue); } }); }