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); } }); }
private int WaitForEvent(uint msec = uint.MaxValue) { return(Control.WaitForEvent(DEBUG_WAIT.DEFAULT, msec)); }