public static extern bool WaitForDebugEvent(out DebugEvent pDebugEvent, int dwMilliseconds);
void DispatchEvent(DebugEvent e) { Program.OutputMessage("DispatchEvent code={0} pid=0x{1:X8} tid=0x{2:X8}", e.EventCode, e.ProcessId, e.ThreadId); State = TargetState.Paused; /* todo: do something with some of these events! */ if (e.EventCode == DebugEventCode.LoadDll) { var sb = new StringBuilder(1024); Psapi.GetMappedFileName(pi.hProcess, e.LoadDll.lpBaseOfDll, sb, sb.Capacity); Program.OutputMessage("LoadDll: {0} @ 0x{1:X8}", sb.ToString(), (uint)(ulong)e.LoadDll.lpBaseOfDll.ToInt64()); } }