1740 {
1744 global::Interop.Kernel32.STARTUPINFO
lpStartupInfo =
default(global::Interop.Kernel32.STARTUPINFO);
1745 global::Interop.Kernel32.PROCESS_INFORMATION
lpProcessInformation =
default(global::Interop.Kernel32.PROCESS_INFORMATION);
1746 global::Interop.Kernel32.SECURITY_ATTRIBUTES
procSecAttrs =
default(global::Interop.Kernel32.SECURITY_ATTRIBUTES);
1755 {
1756 try
1757 {
1760 {
1762 {
1764 }
1765 else
1766 {
1768 }
1770 {
1772 }
1773 else
1774 {
1776 }
1778 {
1780 }
1781 else
1782 {
1784 }
1789 }
1790 int num = 0;
1792 {
1793 num |= 0x8000000;
1794 }
1796 if (
startInfo._environmentVariables !=
null)
1797 {
1798 num |= 0x400;
1800 }
1802 if (
text2.Length == 0)
1803 {
1805 }
1807 bool flag;
1809 {
1811 {
1813 }
1814 global::Interop.Advapi32.LogonFlags
logonFlags = (global::Interop.Advapi32.LogonFlags)0;
1816 {
1817 logonFlags = global::Interop.Advapi32.LogonFlags.LOGON_WITH_PROFILE;
1818 }
1820 {
1822 {
1824 {
1826 try
1827 {
1828 flag = global::Interop.Advapi32.CreateProcessWithLogonW(
startInfo.UserName,
startInfo.Domain, (
intPtr !=
IntPtr.Zero) ?
intPtr : ((
IntPtr)
ptr),
logonFlags,
null,
cmdLine, num, (
IntPtr)
ptr2,
text2,
ref lpStartupInfo,
ref lpProcessInformation);
1829 if (!flag)
1830 {
1832 }
1833 }
1834 finally
1835 {
1837 {
1839 }
1840 }
1841 }
1842 }
1843 }
1844 }
1845 else
1846 {
1848 {
1850 {
1852 if (!flag)
1853 {
1855 }
1856 }
1857 }
1858 }
1860 {
1862 }
1864 {
1866 }
1867 if (!flag)
1868 {
1871 }
1872 }
1873 finally
1874 {
1878 }
1879 }
1881 {
1885 }
1887 {
1890 }
1892 {
1895 }
1898 {
1899 return false;
1900 }
1903 return true;
1904 }
static string GetEnvironmentVariablesBlock(IDictionary< string, string > sd)
void SetProcessHandle(SafeProcessHandle processHandle)
static readonly object s_createProcessLock
static void BuildCommandLine(ProcessStartInfo startInfo, ref System.Text.ValueStringBuilder commandLine)
StreamReader _standardError
void CreatePipe(out SafeFileHandle parentHandle, out SafeFileHandle childHandle, bool parentInputs)
StreamWriter _standardInput
static Win32Exception CreateExceptionForErrorStartingProcess(string errorMessage, int errorCode, string fileName, string workingDirectory)
void SetProcessId(int processId)
StreamReader _standardOutput
static string GetErrorMessage(int error)
static Encoding GetEncoding(int codePage)
static unsafe void ZeroFreeGlobalAllocUnicode(IntPtr s)
static IntPtr SecureStringToGlobalAllocUnicode(SecureString s)
static int GetLastWin32Error()
static void InitHandle(SafeHandle safeHandle, IntPtr handle)
static string CantSetDuplicatePassword
static string InvalidApplication