![Xcalibur Systems LLC Logo](../icons/logo.png) |
ProcessHelperCreateProcess Method |
Creates a new process and its primary thread. The new process runs in the security context
of the calling process.
CreateProcess function Namespace: Xcalibur.NativeMethods.V2.ProcessesAssembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax[DllImportAttribute("coredll.dll", CharSet = CharSet.Auto)]
public static bool CreateProcess(
string applicationName,
string commandLine,
IntPtr processAttributes,
IntPtr threadAttributes,
bool inheritHandles,
uint creationFlags,
IntPtr environment,
string currentDirectory,
IntPtr startupInfo,
out ProcessInformation processInformation
)
<DllImportAttribute("coredll.dll", CharSet := CharSet.Auto>]
Public Shared Function CreateProcess (
applicationName As String,
commandLine As String,
processAttributes As IntPtr,
threadAttributes As IntPtr,
inheritHandles As Boolean,
creationFlags As UInteger,
environment As IntPtr,
currentDirectory As String,
startupInfo As IntPtr,
<OutAttribute> ByRef processInformation As ProcessInformation
) As Boolean
public:
[DllImportAttribute(L"coredll.dll", CharSet = CharSet::Auto)]
static bool CreateProcess(
String^ applicationName,
String^ commandLine,
IntPtr processAttributes,
IntPtr threadAttributes,
bool inheritHandles,
unsigned int creationFlags,
IntPtr environment,
String^ currentDirectory,
IntPtr startupInfo,
[OutAttribute] ProcessInformation% processInformation
)
[<DllImportAttribute("coredll.dll", CharSet = CharSet.Auto)>]
static member CreateProcess :
applicationName : string *
commandLine : string *
processAttributes : IntPtr *
threadAttributes : IntPtr *
inheritHandles : bool *
creationFlags : uint32 *
environment : IntPtr *
currentDirectory : string *
startupInfo : IntPtr *
processInformation : ProcessInformation byref -> bool
Parameters
- applicationName String
- The name of the module to be executed. This module can be a
Windows-based application. It can be some other type of module (for example, MS-DOS or OS/2)
if the appropriate subsystem is available on the local computer.
- commandLine String
- The command line to be executed. The maximum length of this
string is 32,768 characters, including the Unicode terminating null character. If
applicationName is NULL, the module name portion of lpCommandLine is limited to
MAX_PATH (260) characters.
- processAttributes IntPtr
- A pointer to a
structure that determines whether the returned handle to the new process object can be
inherited by child processes. If lpProcessAttributes is NULL, the handle cannot be
inherited.
- threadAttributes IntPtr
- A pointer to a structure
that determines whether the returned handle to the new thread object can be inherited by
child processes. If threadAttributes is NULL, the handle cannot be inherited.
- inheritHandles Boolean
- If this parameter is TRUE, each inheritable handle in the
calling process is inherited by the new process. If the parameter is FALSE, the handles are
not inherited. Note that inherited handles have the same value and access rights as the
original handles.
- creationFlags UInt32
- The flags that control the priority class and the creation of
the process. For a list of values, see .
- environment IntPtr
- A pointer to the environment block for the new process. If this
parameter is NULL, the new process uses the environment of the calling process.
- currentDirectory String
- The full path to the current directory for the process. The
string can also specify a UNC path.
- startupInfo IntPtr
- A pointer to a or STARTUPINFOEX
structure.
- processInformation ProcessInformation
- A pointer to a
structure that receives identification information about the new process.
Return Value
BooleanIf the function fails, the return value is zero. To get extended error
information, call .
See Also