C# Class Binarysharp.MemoryManagement.Helpers.HandleManipulator

Static helper class providing tools for manipulating handles.
Exibir arquivo Open project: ZenLulz/MemorySharp

Public Methods

Method Description
CloseHandle ( IntPtr handle ) : void

Closes an open object handle.

HandleToProcess ( SafeMemoryHandle processHandle ) : Process

Converts an handle into a Process object assuming this is a process handle.

HandleToProcessId ( SafeMemoryHandle processHandle ) : int

Converts an handle into a process id assuming this is a process handle.

HandleToThread ( SafeMemoryHandle threadHandle ) : ProcessThread

Converts an handle into a ProcessThread object assuming this is a thread handle.

HandleToThreadId ( SafeMemoryHandle threadHandle ) : int

Converts an handle into a thread id assuming this is a thread handle.

ValidateAsArgument ( IntPtr handle, string argumentName ) : void

Validates an handle to fit correctly as argument.

ValidateAsArgument ( SafeMemoryHandle handle, string argumentName ) : void

Validates an handle to fit correctly as argument.

Method Details

CloseHandle() public static method

Closes an open object handle.
public static CloseHandle ( IntPtr handle ) : void
handle System.IntPtr A valid handle to an open object.
return void

HandleToProcess() public static method

Converts an handle into a Process object assuming this is a process handle.
public static HandleToProcess ( SafeMemoryHandle processHandle ) : Process
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A valid handle to an opened process.
return System.Diagnostics.Process

HandleToProcessId() public static method

Converts an handle into a process id assuming this is a process handle.
public static HandleToProcessId ( SafeMemoryHandle processHandle ) : int
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A valid handle to an opened process.
return int

HandleToThread() public static method

Converts an handle into a ProcessThread object assuming this is a thread handle.
public static HandleToThread ( SafeMemoryHandle threadHandle ) : ProcessThread
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A valid handle to an opened thread.
return System.Diagnostics.ProcessThread

HandleToThreadId() public static method

Converts an handle into a thread id assuming this is a thread handle.
public static HandleToThreadId ( SafeMemoryHandle threadHandle ) : int
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A valid handle to an opened thread.
return int

ValidateAsArgument() public static method

Validates an handle to fit correctly as argument.
public static ValidateAsArgument ( IntPtr handle, string argumentName ) : void
handle System.IntPtr A handle to validate.
argumentName string The name of the argument that represents the handle in its original function.
return void

ValidateAsArgument() public static method

Validates an handle to fit correctly as argument.
public static ValidateAsArgument ( SafeMemoryHandle handle, string argumentName ) : void
handle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to validate.
argumentName string The name of the argument that represents the handle in its original function.
return void