C# Class UlteriusServer.Api.Win32.ProcessStarter

Class that allows running applications with full admin rights. In addition the application launched will bypass the Vista UAC prompt.
ファイルを表示 Open project: Ulterius/server

Public Methods

Method Description
StartProcessAndBypassUAC ( string applicationName, PROCESS_INFORMATION &procInfo ) : bool

Launches the given application with full admin rights, and in addition bypasses the Vista UAC prompt

Private Methods

Method Description
CloseHandle ( IntPtr hSnapshot ) : bool
CreateProcessAsUser ( IntPtr hToken, string lpApplicationName, string lpCommandLine, SECURITY_ATTRIBUTES &lpProcessAttributes, SECURITY_ATTRIBUTES &lpThreadAttributes, bool bInheritHandle, int dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, STARTUPINFO &lpStartupInfo, PROCESS_INFORMATION &lpProcessInformation ) : bool
DuplicateTokenEx ( IntPtr ExistingTokenHandle, uint dwDesiredAccess, SECURITY_ATTRIBUTES &lpThreadAttributes, int TokenType, int ImpersonationLevel, IntPtr &DuplicateTokenHandle ) : bool
OpenProcess ( uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId ) : IntPtr
OpenProcessToken ( IntPtr ProcessHandle, int DesiredAccess, IntPtr &TokenHandle ) : bool
ProcessIdToSessionId ( uint dwProcessId, uint &pSessionId ) : bool
WTSGetActiveConsoleSessionId ( ) : uint

Method Details

StartProcessAndBypassUAC() public static method

Launches the given application with full admin rights, and in addition bypasses the Vista UAC prompt
public static StartProcessAndBypassUAC ( string applicationName, PROCESS_INFORMATION &procInfo ) : bool
applicationName string The name of the application to launch
procInfo PROCESS_INFORMATION Process information regarding the launched application that gets returned to the caller
return bool