C# Class sudo.NativeMethods

Show file Open project: DeCarabas/sudo

Public Methods

Method Description
AttachConsole ( int dwProcessId ) : void
CreateFile ( string fileName, FileAccess fileAccess, FileShare fileShare, FileMode fileMode, FileAttributes flags ) : Stream
CreateProcess ( string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory ) : PROCESS_INFORMATION
FreeConsole ( ) : void
GetExitCodeProcess ( IntPtr hProcess ) : int
ReadFile ( SafeFileHandle file, byte buffer, int offset, int count ) : int
WaitForSingleObject ( IntPtr hHandle, int dwMilliseconds ) : int
WriteFile ( SafeFileHandle file, byte buffer, int offset, int count ) : int

Private Methods

Method Description
_AttachConsole ( int dwProcessId ) : bool
_CreateFile ( string fileName, [ fileAccess, [ fileShare, IntPtr securityAttributes, [ creationDisposition, [ flags, IntPtr template ) : SafeFileHandle
_CreateProcess ( string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [ lpStartupInfo, PROCESS_INFORMATION &lpProcessInformation ) : bool
_FreeConsole ( ) : bool
_GetExitCodeProcess ( IntPtr hProcess, int &lpExitCode ) : bool
_ReadFile ( SafeFileHandle hFile, byte lpBuffer, int nNumberOfBytesToRead, int &lpNumberOfBytesRead, IntPtr lpOverlapped ) : bool
_WaitForSingleObject ( [ hHandle, [ dwMilliseconds ) : int
_WriteFile ( SafeFileHandle hFile, byte lpBuffer, int nNumberOfBytesToWrite, int &lpNumberOfBytesWritten, IntPtr lpOverlapped ) : bool

Method Details

AttachConsole() public static method

public static AttachConsole ( int dwProcessId ) : void
dwProcessId int
return void

CreateFile() public static method

public static CreateFile ( string fileName, FileAccess fileAccess, FileShare fileShare, FileMode fileMode, FileAttributes flags ) : Stream
fileName string
fileAccess FileAccess
fileShare FileShare
fileMode FileMode
flags FileAttributes
return Stream

CreateProcess() public static method

public static CreateProcess ( string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory ) : PROCESS_INFORMATION
lpApplicationName string
lpCommandLine string
lpProcessAttributes System.IntPtr
lpThreadAttributes System.IntPtr
bInheritHandles bool
dwCreationFlags uint
lpEnvironment System.IntPtr
lpCurrentDirectory string
return PROCESS_INFORMATION

FreeConsole() public static method

public static FreeConsole ( ) : void
return void

GetExitCodeProcess() public static method

public static GetExitCodeProcess ( IntPtr hProcess ) : int
hProcess System.IntPtr
return int

ReadFile() public static method

public static ReadFile ( SafeFileHandle file, byte buffer, int offset, int count ) : int
file SafeFileHandle
buffer byte
offset int
count int
return int

WaitForSingleObject() public static method

public static WaitForSingleObject ( IntPtr hHandle, int dwMilliseconds ) : int
hHandle System.IntPtr
dwMilliseconds int
return int

WriteFile() public static method

public static WriteFile ( SafeFileHandle file, byte buffer, int offset, int count ) : int
file SafeFileHandle
buffer byte
offset int
count int
return int