public static MDbgEngine detach(this MDbgEngine engine) { if (engine.hasActiveProcess()) { engine.process().Detach().WaitOne(); } return(engine); }