C# Класс Net.Pkcs11Interop.Common.UnmanagedMemory

Utility class that helps to manage unmanaged memory
Показать файл Открыть проект

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

Метод Описание
Allocate ( int size ) : IntPtr

Allocates unmanaged zero-filled memory

Free ( IntPtr &memory ) : void

Frees previously allocated unmanaged memory

Read ( IntPtr memory, int size ) : byte[]

Creates copy of unmanaged memory contet

Read ( IntPtr memory, Type structureType ) : object

Copies content of unmanaged memory to the newly allocated managed structure

Read ( IntPtr memory, object structure ) : void

Copies content of unmanaged memory to the existing managed structure

SizeOf ( Type structureType ) : int

Returns the unmanaged size of the structure in bytes

Write ( IntPtr memory, byte content ) : void

Copies content of byte array to unmanaged memory

Write ( IntPtr memory, object structure ) : void

Copies content of structure to unmanaged memory

Описание методов

Allocate() публичный статический Метод

Allocates unmanaged zero-filled memory
public static Allocate ( int size ) : IntPtr
size int Number of bytes required
Результат System.IntPtr

Free() публичный статический Метод

Frees previously allocated unmanaged memory
public static Free ( IntPtr &memory ) : void
memory System.IntPtr Pointer to the previously allocated unmanaged memory
Результат void

Read() публичный статический Метод

Creates copy of unmanaged memory contet
public static Read ( IntPtr memory, int size ) : byte[]
memory System.IntPtr Memory that should be copied
size int Number of bytes that should be copied
Результат byte[]

Read() публичный статический Метод

Copies content of unmanaged memory to the newly allocated managed structure
public static Read ( IntPtr memory, Type structureType ) : object
memory System.IntPtr Memory that should be copied
structureType System.Type Type of structure that should be created
Результат object

Read() публичный статический Метод

Copies content of unmanaged memory to the existing managed structure
public static Read ( IntPtr memory, object structure ) : void
memory System.IntPtr Memory that should be copied
structure object Object to which data should be copied
Результат void

SizeOf() публичный статический Метод

Returns the unmanaged size of the structure in bytes
public static SizeOf ( Type structureType ) : int
structureType System.Type Type of structure whose size should be determined
Результат int

Write() публичный статический Метод

Copies content of byte array to unmanaged memory
public static Write ( IntPtr memory, byte content ) : void
memory System.IntPtr Previously allocated unmanaged memory to copy to
content byte Byte array to copy from
Результат void

Write() публичный статический Метод

Copies content of structure to unmanaged memory
public static Write ( IntPtr memory, object structure ) : void
memory System.IntPtr Previously allocated unmanaged memory to copy to
structure object Structure to copy from
Результат void