예제 #1
0
        // Launch a process under the control of the debugger.
        //
        // Parameters are the same as the Win32 CreateProcess call.
        //
        // The caller should remember to execute:
        //
        //    Microsoft.Win32.Interop.Windows.CloseHandle (
        //      processInformation.hProcess);
        //
        // after CreateProcess returns.
        public DebuggedProcess CreateProcess(
            String appName,
            String commandLine,
            SECURITY_ATTRIBUTES processAttributes,
            SECURITY_ATTRIBUTES threadAttributes,
            bool inheritHandles,
            int creationFlags,
            int environment,                    // ???
            String currentDirectory,
            STARTUPINFO startupInfo,
            ref PROCESS_INFORMATION processInformation,
            CorDebugCreateProcessFlags debuggingFlags)
        {
            ICorDebugProcess proc = null;

            m_debugger.CreateProcess(
                appName,
                commandLine,
                processAttributes,
                threadAttributes,
                inheritHandles ? 1 : 0,
                (uint)creationFlags,
                environment,
                currentDirectory,
                startupInfo,
                processInformation,
                debuggingFlags,
                out proc);

            return(new DebuggedProcess(proc));
        }