C# Класс Statman.Util.Injection.CustomMarshal

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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