public static SafeFileHandle DuplicateHandle(this SafeFileHandle sourceHandle, ProcessHandle sourceAndTargetProcess, FileAccessRights desiredAccess, bool inheritHandle, DuplicateHandleOptions options) { SafeFileHandle targetHandle; if (!NativeMethods.DuplicateHandle(sourceAndTargetProcess, sourceHandle, sourceAndTargetProcess, out targetHandle, desiredAccess, inheritHandle, options)) { ErrorHelper.ThrowCustomWin32Exception(); } return targetHandle; }
public IProcessInformation CreateAsUser(TokenHandle token, string applicationName, string commandLine, bool inheritHandles, ProcessCreationFlags creationFlags, EnvironmentBlockHandle environment, string currentDirectory, ProcessStartInfo startInfo, ProcessSecurity processSecurity = null, ThreadSecurity threadSecurity = null) { return(ProcessHandle.CreateAsUser(token, applicationName, commandLine, inheritHandles, creationFlags, environment, currentDirectory, startInfo, processSecurity, threadSecurity)); }
public ProcessWaitHandle(ProcessHandle processHandle) { SafeWaitHandle waitHandle; if (!NativeMethods.DuplicateHandle(GetCurrentProcess(), processHandle, GetCurrentProcess(), out waitHandle, 0, false, DuplicateHandleOptions.SameAccess)) { ErrorHelper.ThrowCustomWin32Exception(); } SafeWaitHandle = waitHandle; }
public static extern bool TerminateProcess(ProcessHandle processHandle, int exitCode);
public static extern bool OpenProcessToken(ProcessHandle processHandle, TokenAccessRights desiredAccess, out TokenHandle tokenHandle);
public static extern bool IsWow64Process(ProcessHandle processHandle, [Out] [MarshalAs(UnmanagedType.Bool)] out bool isWow64Process);
public static extern bool GetProcessTimes(ProcessHandle processHandle, out long creationTime, out long exitTime, out long kernelTime, out long userTime);
public static extern bool DuplicateHandle(ProcessHandle sourceProcessHandle, ProcessHandle sourceHandle, ProcessHandle targetProcess, out SafeWaitHandle targetHandle, uint desiredAccess, bool inheritHandle, DuplicateHandleOptions options);
public static extern bool IsWow64Process(ProcessHandle processHandle, [Out][MarshalAs(UnmanagedType.Bool)] out bool isWow64Process);
public static extern bool IsProcessInJob(ProcessHandle processHandle, JobObjectHandle jobHandle, out bool result);
public static extern int GetProcessId(ProcessHandle processHandle);
public IProcessInformation CreateWithToken(TokenHandle token, ProcessLogonFlags logonFlags, string applicationName, string commandLine, ProcessCreationFlags creationFlags, EnvironmentBlockHandle environment, string currentDirectory, ProcessStartInfo startupInfo) { return(ProcessHandle.CreateWithToken(token, logonFlags, applicationName, commandLine, creationFlags, environment, currentDirectory, startupInfo)); }
public ProcessSecurity(ProcessHandle handle, AccessControlSections includeSections, bool isContainer = false) : base(isContainer, ResourceType.KernelObject, handle, includeSections) { }
public static extern bool K32GetProcessMemoryInfo(ProcessHandle processHandle, out ProcessMemoryCountersEx memoryCounters, int size);
public static extern bool QueryFullProcessImageNameW(ProcessHandle processHandle, PathFormat format, [Out] StringBuilder exeName, ref uint size);
public ProcessExitMonitor(ProcessHandle processHandle) { _processWaitHandle = new ProcessWaitHandle(processHandle); ThreadPool.RegisterWaitForSingleObject(_processWaitHandle, HandleExited, null, -1, true); }
public Process(ProcessHandle handle) { _handle = handle; }
public void AssignProcess(ProcessHandle processHandle) { _handle.AssignProcess(processHandle); }
public static extern bool DuplicateHandle(ProcessHandle sourceProcessHandle, SafeHandle sourceHandle, ProcessHandle targetProcess, out SafeFileHandle targetHandle, FileAccessRights desiredAccess, bool inheritHandle, DuplicateHandleOptions options);
public IProcessInformation CreateWithLogin(string username, string domain, string password, ProcessLogonFlags logonFlags, string applicationName, string commandLine, ProcessCreationFlags creationFlags, EnvironmentBlockHandle environment, string currentDirectory, ProcessStartInfo startupInfo) { return(ProcessHandle.CreateWithLogin(username, domain, password, logonFlags, applicationName, commandLine, creationFlags, environment, currentDirectory, startupInfo)); }
public IProcess OpenProcess(int processId, ProcessAccessRights desiredAccess = ProcessAccessRights.AllAccess, bool inheritHandle = false) { var handle = ProcessHandle.OpenProcess(processId, desiredAccess, inheritHandle); return(new Process(handle)); }
public static extern bool GetExitCodeProcess(ProcessHandle processHandle, out int exitCode);
public static extern bool AssignProcessToJobObject(JobObjectHandle handle, ProcessHandle processHandle);