public void CreateProcessAndAttach(string CommandLine) { if (_disposed) { throw new ApplicationException("Object already disposed"); } logger.Debug("CreateProcessAndAttach: " + CommandLine); count++; dbgClient.CreateProcessAndAttach(0, CommandLine, 1, 0, 0); try { while (!exitDebugger.WaitOne(0, false) && !handledException.WaitOne(0, false)) { dbgControl.WaitForEvent(0, 100); } } catch (Exception ex) { logger.Debug(ex.ToString()); //Debugger.Break(); } logger.Debug("EndSession"); dbgClient.EndSession((uint)Const.DEBUG_END_ACTIVE_TERMINATE); }