int IDebugEngineLaunch2.LaunchSuspended(string pszServer, IDebugPort2 pPort, string pszExe, string pszArgs, string pszDir, string bstrEnv, string pszOptions, enum_LAUNCH_FLAGS dwLaunchFlags, uint hStdInput, uint hStdOutput, uint hStdError, IDebugEventCallback2 pCallback, out IDebugProcess2 ppProcess) { ppProcess = new AD7Process(pPort); this.process = ppProcess; callback = new AD7.EngineCallback(this, pCallback); return(0); }
int IDebugEngineLaunch2.LaunchSuspended(string pszServer, IDebugPort2 pPort, string pszExe, string pszArgs, string pszDir, string bstrEnv, string pszOptions, enum_LAUNCH_FLAGS dwLaunchFlags, uint hStdInput, uint hStdOutput, uint hStdError, IDebugEventCallback2 pCallback, out IDebugProcess2 ppProcess) { string[] p = pszExe.Split(':'); callback = new AD7.EngineCallback(this, pCallback); debugged = new AD7.DebuggedProcessVS(this, p[0], int.Parse(p[1])); while (debugged.Connecting) { System.Threading.Thread.Sleep(10); } if (debugged.Connected) { if (debugged.CheckDebugServerVersion()) { ppProcess = new AD7Process(pPort); this.process = ppProcess; debugged.OnDisconnected = OnDisconnected; return(Constants.S_OK); } else { debugged.Close(); MessageBox.Show(String.Format("ILRuntime Debugger version mismatch\n Expected version:{0}\n Actual version:{1}", DebuggerServer.Version, DebuggedProcess.RemoteDebugVersion), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); debugged = null; ppProcess = null; return(Constants.S_FALSE); } } else { MessageBox.Show("Cannot connect to ILRuntime", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); debugged = null; ppProcess = null; return(Constants.S_FALSE); } }