Ejemplo n.º 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));
        }
		public static ICorDebugProcess CreateProcess(this EmbeddedCLRCorDebugClass instance, string lpApplicationName, string lpCommandLine, ref _SECURITY_ATTRIBUTES lpProcessAttributes, ref _SECURITY_ATTRIBUTES lpThreadAttributes, int bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, uint lpStartupInfo,
		uint lpProcessInformation, CorDebugCreateProcessFlags debuggingFlags)
		{
			ICorDebugProcess ppProcess;
			instance.__CreateProcess(lpApplicationName, lpCommandLine, ref lpProcessAttributes, ref lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation,
			debuggingFlags, out ppProcess);
			ProcessOutParameter(lpProcessAttributes);
			ProcessOutParameter(lpThreadAttributes);
			ProcessOutParameter(ppProcess);
			return ppProcess;
		}
Ejemplo n.º 3
0
 public virtual extern void CreateProcess(
     [In][MarshalAs(UnmanagedType.LPWStr)] string lpApplicationName,
     [In][MarshalAs(UnmanagedType.LPWStr)] string lpCommandLine,
     [In] SECURITY_ATTRIBUTES lpProcessAttributes,
     [In] SECURITY_ATTRIBUTES lpThreadAttributes,
     [In] int bInheritHandles,
     [In] uint dwCreationFlags,
     [In] IntPtr lpEnvironment,
     [In][MarshalAs(UnmanagedType.LPWStr)] string lpCurrentDirectory,
     [In] STARTUPINFO lpStartupInfo,
     [In] PROCESS_INFORMATION lpProcessInformation,
     [In] CorDebugCreateProcessFlags debuggingFlags,
     [Out][MarshalAs(UnmanagedType.Interface)]
     out ICorDebugProcess ppProcess);
Ejemplo n.º 4
0
        public CorProcess CreateProcess (
                                         String                      applicationName,
                                         String                      commandLine,
                                         SECURITY_ATTRIBUTES         processAttributes,
                                         SECURITY_ATTRIBUTES         threadAttributes,
                                         bool                        inheritHandles,
                                         int                         creationFlags,
                                         IntPtr                      environment,  
                                         String                      currentDirectory,
                                         STARTUPINFO                 startupInfo,
                                         ref PROCESS_INFORMATION     processInformation,
                                         CorDebugCreateProcessFlags  debuggingFlags)
        {
            /*
             * If commandLine is: <c:\a b\a arg1 arg2> and c:\a.exe does not exist, 
             *    then without this logic, "c:\a b\a.exe" would be tried next.
             * To prevent this ambiguity, this forces the user to quote if the path 
             *    has spaces in it: <"c:\a b\a" arg1 arg2>
             */
            if(null == applicationName && !commandLine.StartsWith("\""))
            {
                int firstSpace = commandLine.IndexOf(" ");
                if(firstSpace != -1)
                    commandLine = String.Format(CultureInfo.InvariantCulture, "\"{0}\" {1}", commandLine.Substring(0,firstSpace), commandLine.Substring(firstSpace, commandLine.Length-firstSpace));
            }

            ICorDebugProcess proc = null;

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

            return CorProcess.GetCorProcess(proc);
        }
Ejemplo n.º 5
0
 public CorProcess CreateProcess(
                                  String applicationName,
                                  String commandLine,
                                  SECURITY_ATTRIBUTES processAttributes,
                                  SECURITY_ATTRIBUTES threadAttributes,
                                  bool inheritHandles,
                                  int creationFlags,
                                  IntPtr environment,
                                  String currentDirectory,
                                  STARTUPINFO startupInfo,
                                  ref PROCESS_INFORMATION processInformation,
                                  CorDebugCreateProcessFlags debuggingFlags)
 {
     return CreateProcess(null,
                          applicationName,
                          commandLine,
                          processAttributes,
                          threadAttributes,
                          inheritHandles,
                          creationFlags,
                          environment,
                          currentDirectory,
                          startupInfo,
                          ref processInformation,
                          debuggingFlags);
 }
Ejemplo n.º 6
0
        public ICorDebugProcess CreateProcess(string lpApplicationName, string lpCommandLine, ref Debugger.Interop.CorDebug._SECURITY_ATTRIBUTES lpProcessAttributes, ref Debugger.Interop.CorDebug._SECURITY_ATTRIBUTES lpThreadAttributes, int bInheritHandles, uint dwCreationFlags, System.IntPtr lpEnvironment, string lpCurrentDirectory, uint lpStartupInfo, uint lpProcessInformation, CorDebugCreateProcessFlags debuggingFlags)
        {
            ICorDebugProcess ppProcess;

            Debugger.Interop.CorDebug.ICorDebugProcess out_ppProcess;
            this.WrappedObject.CreateProcess(lpApplicationName, lpCommandLine, ref lpProcessAttributes, ref lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation, ((Debugger.Interop.CorDebug.CorDebugCreateProcessFlags)(debuggingFlags)), out out_ppProcess);
            ppProcess = ICorDebugProcess.Wrap(out_ppProcess);
            return(ppProcess);
        }
        int ICorDebug.CreateProcess(string lpApplicationName, string lpCommandLine, _SECURITY_ATTRIBUTES lpProcessAttributes, _SECURITY_ATTRIBUTES lpThreadAttributes, int bInheritHandles, uint dwCreationFlags, System.IntPtr lpEnvironment, string lpCurrentDirectory, _STARTUPINFO lpStartupInfo, _PROCESS_INFORMATION lpProcessInformation, CorDebugCreateProcessFlags debuggingFlags, out ICorDebugProcess ppProcess)
        {
            ppProcess = null;

            return(COM_HResults.E_NOTIMPL);
        }
 public virtual extern void CreateProcess([In, MarshalAs(UnmanagedType.LPWStr)] string lpApplicationName, [In, MarshalAs(UnmanagedType.LPWStr)] string lpCommandLine, [In] ref _SECURITY_ATTRIBUTES lpProcessAttributes, [In] ref _SECURITY_ATTRIBUTES lpThreadAttributes, [In] int bInheritHandles, [In] uint dwCreationFlags, [In] IntPtr lpEnvironment, [In, MarshalAs(UnmanagedType.LPWStr)] string lpCurrentDirectory, [In, ComAliasName("Debugger.Interop.CorDebug.ULONG_PTR")] uint lpStartupInfo, [In, ComAliasName("Debugger.Interop.CorDebug.ULONG_PTR")] uint lpProcessInformation, [In] CorDebugCreateProcessFlags debuggingFlags, [MarshalAs(UnmanagedType.Interface)] out ICorDebugProcess ppProcess);
Ejemplo n.º 9
0
        int ICorDebug.CreateProcess( string lpApplicationName, string lpCommandLine, _SECURITY_ATTRIBUTES lpProcessAttributes, _SECURITY_ATTRIBUTES lpThreadAttributes, int bInheritHandles, uint dwCreationFlags, System.IntPtr lpEnvironment, string lpCurrentDirectory, _STARTUPINFO lpStartupInfo, _PROCESS_INFORMATION lpProcessInformation, CorDebugCreateProcessFlags debuggingFlags, out ICorDebugProcess ppProcess )
        {
            ppProcess = null;

            return Utility.COM_HResults.E_NOTIMPL;
        }