Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

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, _

.
Documentation
.

static extern TODO CreateProcessAsUserW(TODO);

.

Declare Function CreateProcessAsUserW Lib "advapi32.dll" (TODO) As TODO

.
Documentation
[CreateProcessAsUserW] on MSDN
.

  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(

.
Documentation
[CreateProcessWithLogonW] on MSDN
.

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)

.
Documentation
[CeCreateProcess] on MSDN

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

.
Documentation
[CreateProcessWithTokenW] on MSDN
.

  public CREATE_PROCESS_DEBUG_INFO CreateProcessInfo

.
Summary
.
Summary
The SECURITY_ATTRIBUTES structure contains the security descriptor for an object and specifies whether the handle retrieved by specifying this structure is inheritable. This structure provides security settings for objects created by various functions, such as CreateFile, CreatePipe, CreateProcess, or RegCreateKeyEx.
.
Summary
.

See CreateProcess and InitializeProcThreadAttributeList,UpdateProcThreadAttribute

.

Do not forget to set the size of your object after filling in the attributes, before calling CreateProcess

.
Summary
.

See CreateProcess and InitializeProcThreadAttributeList/UpdateProcThreadAttribute

.

Do not forget to set the size of your object after filling in the attributes, before calling CreateProcess

Enums

.

    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)

.

    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

kernel32

.

    private const uint CREATEPROCESS_MANIFEST_RESOURCE_ID = 1;

.

        actCtx.lpResourceName = CREATEPROCESS_MANIFEST_RESOURCE_ID;

.

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)

.
Documentation
[CreateProcess] on MSDN
.

static extern bool CreateProcess(string lpApplicationName, string lpCommandLine,

.

Declare Function CreateProcessW Lib "kernel32.dll" (TODO) As TODO

.
Documentation
[CreateProcessW] on MSDN
.
Summary
.

        CreateProcess = 0x000000080,

.

    CreateProcess = &H80

Constants

.
Summary
CreateProcess dwCreationFlag constant values
.

        public const int CO_E_CREATEPROCESS_FAILURE = (int)(0x80004018 - 0x100000000);

.

        public const int CO_E_RUNAS_CREATEPROCESS_FAILURE = (int)(0x80004019 - 0x100000000);

ntdll

.

def RtlCreateProcessParametersEx(

.
Documentation
[RtlCreateProcessParametersEx] on MSDN

coredll

.

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

.

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


 
Access PInvoke.net directly from VS: