예제 #1
0
 /// <nodoc />
 public static CreateDetouredProcessStatus CreateDetouredProcess(
     string lpcwCommandLine,
     int dwCreationFlags,
     IntPtr lpEnvironment,
     string lpcwWorkingDirectory,
     SafeHandle hStdInput,
     SafeHandle hStdOutput,
     SafeHandle hStdError,
     SafeHandle hJob,
     IProcessInjector injector,
     bool addProcessToContainer,
     out SafeProcessHandle phProcess,
     out SafeThreadHandle phThread,
     out int pdwProcessId,
     out int errorCode)
 {
     return(s_nativeMethods.CreateDetouredProcess(
                lpcwCommandLine,
                dwCreationFlags,
                lpEnvironment,
                lpcwWorkingDirectory,
                hStdInput,
                hStdOutput,
                hStdError,
                hJob,
                injector,
                addProcessToContainer,
                out phProcess,
                out phThread,
                out pdwProcessId,
                out errorCode));
 }
예제 #2
0
        /// <inheritdoc />
        public CreateDetouredProcessStatus CreateDetouredProcess(
            string lpcwCommandLine,
            int dwCreationFlags,
            IntPtr lpEnvironment,
            string lpcwWorkingDirectory,
            SafeHandle hStdInput,
            SafeHandle hStdOutput,
            SafeHandle hStdError,
            SafeHandle hJob,
            IProcessInjector injector,
            bool addProcessToSilo,
            out SafeProcessHandle phProcess,
            out SafeThreadHandle phThread,
            out int pdwProcessId,
            out int errorCode)
        {
            Assert64Process();

            var status = ExternCreateDetouredProcess(
                lpcwCommandLine,
                dwCreationFlags,
                lpEnvironment,
                lpcwWorkingDirectory,
                hStdInput,
                hStdOutput,
                hStdError,
                hJob,
                injector == null ? IntPtr.Zero : injector.Injector(),
                addProcessToSilo,
                out phProcess,
                out phThread,
                out pdwProcessId);

            errorCode = status == CreateDetouredProcessStatus.Succeeded ? 0 : Marshal.GetLastWin32Error();

            // TODO: Enforce this postcondition.
            // Contract.Assume(status == CreateDetouredProcessStatus.Succeeded || errorCode != 0, "Expected a valid error code on failure.");
            return(status);
        }
예제 #3
0
        => new byte[0];     // TODO: this is only used for communication between BuildXL and external sandboxed process, which we don't do yet on Unix systems.

        /// <inheritdoc />
        public CreateDetouredProcessStatus CreateDetouredProcess(string lpcwCommandLine, int dwCreationFlags, IntPtr lpEnvironment, string lpcwWorkingDirectory, SafeHandle hStdInput, SafeHandle hStdOutput, SafeHandle hStdError, SafeHandle hJob, IProcessInjector injector, bool addProcessToSilo, out SafeProcessHandle phProcess, out SafeThreadHandle phThread, out int pdwProcessId, out int errorCode)
        => throw new NotImplementedException();