C# Class IronPython.Modules.PythonSubprocess

Datei anzeigen Open project: jschementi/iron Class Usage Examples

Public Methods

Method Description
CreatePipe ( CodeContext context, object pSec, int bufferSize ) : PythonTuple
CreateProcess ( CodeContext context, string applicationName, string commandLineArgs, object pSec, object tSec, int bInheritHandles, uint dwCreationFlags, PythonDictionary lpEnvironment, string lpCurrentDirectory, object lpStartupInfo ) : PythonTuple
DuplicateHandle ( CodeContext context, BigInteger sourceProcess, BigInteger handle, BigInteger targetProcess, int desiredAccess, bool inherit_handle, object DUPLICATE_SAME_ACCESS ) : PythonSubprocessHandle
DuplicateHandle ( CodeContext context, BigInteger sourceProcess, PythonSubprocessHandle handle, BigInteger targetProcess, int desiredAccess, bool inherit_handle, object DUPLICATE_SAME_ACCESS ) : PythonSubprocessHandle

Duplicates a subprocess handle which was created for piping. This is only called when we're duplicating the handle to make it inheritable to the child process. In CPython the parent handle is always reliably garbage collected. Because we know this handle is not going to be used we close the handle being duplicated.

GetCurrentProcess ( ) : PythonSubprocessHandle
GetExitCodeProcess ( PythonSubprocessHandle hProcess ) : int
GetModuleFileName ( object ignored ) : string
GetStdHandle ( int STD_OUTPUT_HANDLE ) : object
GetVersion ( ) : int
TerminateProcess ( PythonSubprocessHandle handle, object uExitCode ) : bool
WaitForSingleObject ( PythonSubprocessHandle handle, int dwMilliseconds ) : int

Private Methods

Method Description
CloseHandle ( IntPtr hObject ) : bool
CreatePipePI ( IntPtr &hReadPipe, IntPtr &hWritePipe, SECURITY_ATTRIBUTES &lpPipeAttributes, uint nSize ) : bool
CreateProcessPI ( string lpApplicationName, string lpCommandLine, SECURITY_ATTRIBUTES &lpProcessAttributes, SECURITY_ATTRIBUTES &lpThreadAttributes, [ bInheritHandles, uint dwCreationFlags, string lpEnvironment, string lpCurrentDirectory, [ lpStartupInfo, PROCESS_INFORMATION &lpProcessInformation ) : bool
DuplicateHandlePI ( IntPtr hSourceProcessHandle, IntPtr hSourceHandle, IntPtr hTargetProcessHandle, IntPtr &lpTargetHandle, uint dwDesiredAccess, [ bInheritHandle, uint dwOptions ) : bool
EnvironmentToNative ( PythonDictionary lpEnvironment ) : string
GetCurrentProcessPI ( ) : IntPtr
GetExitCodeProcessPI ( IntPtr hProcess, int &lpExitCode ) : bool
GetStdHandlePI ( int nStdHandle ) : IntPtr
GetVersionPI ( ) : int
TerminateProcessPI ( IntPtr hProcess, uint uExitCode ) : bool
WaitForSingleObjectPI ( IntPtr hHandle, int dwMilliseconds ) : int

Method Details

CreatePipe() public static method

public static CreatePipe ( CodeContext context, object pSec, int bufferSize ) : PythonTuple
context CodeContext
pSec object
bufferSize int
return PythonTuple

CreateProcess() public static method

public static CreateProcess ( CodeContext context, string applicationName, string commandLineArgs, object pSec, object tSec, int bInheritHandles, uint dwCreationFlags, PythonDictionary lpEnvironment, string lpCurrentDirectory, object lpStartupInfo ) : PythonTuple
context CodeContext
applicationName string
commandLineArgs string
pSec object
tSec object
bInheritHandles int
dwCreationFlags uint
lpEnvironment PythonDictionary
lpCurrentDirectory string
lpStartupInfo object
return PythonTuple

DuplicateHandle() public static method

public static DuplicateHandle ( CodeContext context, BigInteger sourceProcess, BigInteger handle, BigInteger targetProcess, int desiredAccess, bool inherit_handle, object DUPLICATE_SAME_ACCESS ) : PythonSubprocessHandle
context CodeContext
sourceProcess BigInteger
handle BigInteger
targetProcess BigInteger
desiredAccess int
inherit_handle bool
DUPLICATE_SAME_ACCESS object
return PythonSubprocessHandle

DuplicateHandle() public static method

Duplicates a subprocess handle which was created for piping. This is only called when we're duplicating the handle to make it inheritable to the child process. In CPython the parent handle is always reliably garbage collected. Because we know this handle is not going to be used we close the handle being duplicated.
public static DuplicateHandle ( CodeContext context, BigInteger sourceProcess, PythonSubprocessHandle handle, BigInteger targetProcess, int desiredAccess, bool inherit_handle, object DUPLICATE_SAME_ACCESS ) : PythonSubprocessHandle
context CodeContext
sourceProcess BigInteger
handle PythonSubprocessHandle
targetProcess BigInteger
desiredAccess int
inherit_handle bool
DUPLICATE_SAME_ACCESS object
return PythonSubprocessHandle

GetCurrentProcess() public static method

public static GetCurrentProcess ( ) : PythonSubprocessHandle
return PythonSubprocessHandle

GetExitCodeProcess() public static method

public static GetExitCodeProcess ( PythonSubprocessHandle hProcess ) : int
hProcess PythonSubprocessHandle
return int

GetModuleFileName() public static method

public static GetModuleFileName ( object ignored ) : string
ignored object
return string

GetStdHandle() public static method

public static GetStdHandle ( int STD_OUTPUT_HANDLE ) : object
STD_OUTPUT_HANDLE int
return object

GetVersion() public static method

public static GetVersion ( ) : int
return int

TerminateProcess() public static method

public static TerminateProcess ( PythonSubprocessHandle handle, object uExitCode ) : bool
handle PythonSubprocessHandle
uExitCode object
return bool

WaitForSingleObject() public static method

public static WaitForSingleObject ( PythonSubprocessHandle handle, int dwMilliseconds ) : int
handle PythonSubprocessHandle
dwMilliseconds int
return int