C# 클래스 Statman.Util.Injection.CustomMarshal

파일 보기 프로젝트 열기: OrfeasZ/Statman 1 사용 예제들

공개 메소드들

메소드 설명
IsCustomMarshalObject ( object o ) : bool

Determines whether a specific object is CustomMarshalable

IsCustomMarshalType ( Type t ) : bool

Determines if a given type is CustomMarshalable (i.e. contains any fields with CustomMarshalAsAttribute)

PtrToStructure ( IntPtr ptr, Type structureType ) : object

Marshal an unmanaged to pointer to a managed object. If structureType is not CustomMarshalable, this function is the same as Marshal.StructureToPtr.

RebaseUnmanagedStructure ( IntPtr baseAddress, IntPtr targetAddress, Type structureType ) : void

Rebases all pointers in a CustomMarshalable structure to be valid pointers in a target address space. If structureType is not CustomMarshalable, this function does nothing.

SizeOf ( Type t ) : int
SizeOf ( object o ) : int

Returns the runtime size of a CustomMarshalable object. If object is not CustomMarshalable, this function is the same as Marshal.SizeOf

StructureToPtr ( object structure, IntPtr ptr, bool fDeleteOld ) : void

Marshal a managed object to an unmanaged chunk of memory. If structure is not CustomMarshalable this function is the same as Marshal.StructureToPtr.

메소드 상세

IsCustomMarshalObject() 공개 정적인 메소드

Determines whether a specific object is CustomMarshalable
public static IsCustomMarshalObject ( object o ) : bool
o object Object to check
리턴 bool

IsCustomMarshalType() 공개 정적인 메소드

Determines if a given type is CustomMarshalable (i.e. contains any fields with CustomMarshalAsAttribute)
public static IsCustomMarshalType ( Type t ) : bool
t System.Type Type to check
리턴 bool

PtrToStructure() 공개 정적인 메소드

Marshal an unmanaged to pointer to a managed object. If structureType is not CustomMarshalable, this function is the same as Marshal.StructureToPtr.
public static PtrToStructure ( IntPtr ptr, Type structureType ) : object
ptr System.IntPtr Pointer to unmanaged memory
structureType System.Type Type of managed object to instantiate
리턴 object

RebaseUnmanagedStructure() 공개 정적인 메소드

Rebases all pointers in a CustomMarshalable structure to be valid pointers in a target address space. If structureType is not CustomMarshalable, this function does nothing.
public static RebaseUnmanagedStructure ( IntPtr baseAddress, IntPtr targetAddress, Type structureType ) : void
baseAddress System.IntPtr Pointer to unmanaged structure in this process
targetAddress System.IntPtr Base address of structure in target process
structureType System.Type Type of structure
리턴 void

SizeOf() 공개 정적인 메소드

public static SizeOf ( Type t ) : int
t System.Type
리턴 int

SizeOf() 공개 정적인 메소드

Returns the runtime size of a CustomMarshalable object. If object is not CustomMarshalable, this function is the same as Marshal.SizeOf
public static SizeOf ( object o ) : int
o object Object to calculate runtime size of
리턴 int

StructureToPtr() 공개 정적인 메소드

Marshal a managed object to an unmanaged chunk of memory. If structure is not CustomMarshalable this function is the same as Marshal.StructureToPtr.
public static StructureToPtr ( object structure, IntPtr ptr, bool fDeleteOld ) : void
structure object A managed object to marshal to unmanaged memory.
ptr System.IntPtr Pointer to unmanaged memory. This must be allocated before call
fDeleteOld bool Indicates whether to delete old memory first
리턴 void