C# Class Statman.Util.Injection.CustomMarshal

Afficher le fichier Open project: OrfeasZ/Statman Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

IsCustomMarshalObject() public static méthode

Determines whether a specific object is CustomMarshalable
public static IsCustomMarshalObject ( object o ) : bool
o object Object to check
Résultat bool

IsCustomMarshalType() public static méthode

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
Résultat bool

PtrToStructure() public static méthode

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
Résultat object

RebaseUnmanagedStructure() public static méthode

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
Résultat void

SizeOf() public static méthode

public static SizeOf ( Type t ) : int
t System.Type
Résultat int

SizeOf() public static méthode

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
Résultat int

StructureToPtr() public static méthode

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
Résultat void