Desktop Functions: Smart Device Functions:
|
Search Results for "CreateProcess" in [All]advapi32
static extern bool CreateProcessAsUser(
Private Declare Auto Function CreateProcessAsUser Lib "advapi32" ( _
Private Shared Function CreateProcessAsUser( _ The Unicode version of this function, CreateProcessAsUserW, can modify the contents of this string. Therefore, this parameter cannot be a pointer to read-only memory (such as a const variable or a literal string). If this parameter is a constant string, the function may cause an access violation.
if (!CreateProcessAsUser(hToken, String.Empty, commandLine,
throw new Exception("Failed to CreateProcessAsUser");
If Not CreateProcessAsUser(hToken, "", strCmdLine, Nothing, _
static extern TODO CreateProcessAsUserW(TODO);
Declare Function CreateProcessAsUserW Lib "advapi32.dll" (TODO) As TODO
public static extern bool CreateProcessWithLogonW(
Public Function CreateProcessWithLogonW(ByVal userName As String, ByVal domain As String, ByVal password As String, ByVal logonFlags As UInt32, ByVal applicationName As String, ByVal commandLine As String, ByVal creationFlags As UInt32, ByVal environment As UInt32, ByVal currentDirectory As String, ByRef startupInfo As StartupInfo, ByRef processInformation As ProcessInformation) As Boolean
Public Function CreateProcessWithLogonW(ByVal userName As String, ByVal domain As String, ByVal password As String, ByVal logonFlags As UInt32, ByVal applicationName As String, ByVal commandLine As String, ByVal creationFlags As UInt32, ByVal environment As UInt32, ByVal currentDirectory As String, ByRef startupInfo As StartupInfo, ByRef processInformation As ProcessInformation) As Boolean
CreateProcessWithLogonW(user, domain, password, Convert.ToUInt32(1), _
public static extern bool CreateProcessWithLogonW(
CreateProcessWithLogonW( The following enum (Create Process Flags) can be used by CreateProcess, CreateProcessAsUser, CreateProcessWithLogonW, and CreateProcessWithTokenW.
enum CreateProcessFlags
enum CreateProcessFlags : uint
Enum CreateProcessFlags rapi
public extern static bool CeCreateProcess(
CeCreateProcess("myapp.exe", String.Empty, IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, ref pi) Structures
public static extern bool CreateProcessWithTokenW(IntPtr hToken, LogonFlags dwLogonFlags, string lpApplicationName, string lpCommandLine, CreationFlags dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [In] ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);
public static extern bool CreateProcessWithTokenW(
Public Shared Function CreateProcessWithTokenW(hToken As IntPtr, dwLogonFlags As Integer, lpApplicationName As String, lpCommandLine As String, dwCreationFlags As Integer, lpEnvironment As IntPtr, lpCurrentDirectory As IntPtr, ByRef lpStartupInfo As STARTUPINFO, ByRef lpProcessInformation As PROCESS_INFORMATION) As Boolean 7: DEBUG_EVENT
public CREATE_PROCESS_DEBUG_INFO CreateProcessInfo 10: STARTUPINFO See CreateProcess and InitializeProcThreadAttributeList,UpdateProcThreadAttribute Do not forget to set the size of your object after filling in the attributes, before calling CreateProcess 11: STARTUPINFOEX See CreateProcess and InitializeProcThreadAttributeList/UpdateProcThreadAttribute Do not forget to set the size of your object after filling in the attributes, before calling CreateProcess Enums12: HRESULT
public const int CO_E_CREATEPROCESS_FAILURE = unchecked((int)0x80004018);
public const int CO_E_RUNAS_CREATEPROCESS_FAILURE = unchecked((int)0x80004019);
Public Const CO_E_CREATEPROCESS_FAILURE As Integer = CInt(&H80004018UI)
Public Const CO_E_RUNAS_CREATEPROCESS_FAILURE As Integer = CInt(&H80004019UI) 13: ProcessAccess
CreateProcess = 0x0080,
/// STARTUPINFO structure passed to the CreateProcess function by the
''' STARTUPINFO structure passed to the CreateProcess function by the
/// STARTUPINFO structure passed to the CreateProcess function by the
''' STARTUPINFO structure passed to the CreateProcess function by the kernel3216: ActivateActCtx
private const uint CREATEPROCESS_MANIFEST_RESOURCE_ID = 1;
actCtx.lpResourceName = CREATEPROCESS_MANIFEST_RESOURCE_ID; 17: CreateProcess
static extern bool CreateProcess(
Shared Function CreateProcess( _
def CreateProcess( Replace STARTUPINFO with STARTUPINFOEX to use UpdateProcThreadAttribute and extend CreateProcess. Make sure you include the flag EXTENDED_STARTUPINFO_PRESENT (0x00080000)
retValue = CreateProcess(Application,CommandLine,
retValue = CreateProcess(Application, CommandLine, pSec, tSec, False, NORMAL_PRIORITY_CLASS, IntPtr.Zero, vbNull, sInfo, pInfo) 18: CreateProcessW
static extern bool CreateProcess(string lpApplicationName, string lpCommandLine,
Declare Function CreateProcessW Lib "kernel32.dll" (TODO) As TODO 20: OpenProcess
CreateProcess = 0x000000080,
CreateProcess = &H80 Constants22: WINERROR
public const int CO_E_CREATEPROCESS_FAILURE = (int)(0x80004018 - 0x100000000);
public const int CO_E_RUNAS_CREATEPROCESS_FAILURE = (int)(0x80004019 - 0x100000000); ntdllcoredll24: CreateProcess
static extern bool CreateProcess(
Declare Function CreateProcess Lib "coredll.dll" (ByVal imageName As String, ByVal cmdLine As String, ByVal lpProcessAttributes As IntPtr, ByVal lpThreadAttributes As IntPtr, ByVal boolInheritHandles As Int32, ByVal dwCreationFlags As Int32, ByVal lpEnvironment As IntPtr, ByVal lpszCurrentDir As IntPtr, ByVal si As Byte(), ByVal pi As IntPtr) As Integer
CreateProcess(
CreateProcessWait("calc.exe", "", pi, out ret) private static bool CreateProcessWait( String ExeName, String CmdLine, ProcessInfo pi, out uint retCode ){
intRet= CreateProcessAPI(ExeName, CmdLine, IntPtr.Zero, IntPtr.Zero, Both of the below examples assume that pi is an instnace of a ProcessInfo class. Examples of the ProcessInfo class can be found on the CreateProcess page. userenv
/// the different CreateProcess calls 28: LoadUserProfile Note that it is your responsibility to load the user's registry hive into the HKEY_USERS registry key with the LoadUserProfile function before calling CreateProcessAsUser. This is because CreateProcessAsUser does not load the specified user's profile into HKEY_USERS. This means that access to information in the HKEY_CURRENT_USER registry key may not produce results consistent with a normal interactive logon. shell32 |