C# 클래스 Net.Pkcs11Interop.Common.UnmanagedMemory

Utility class that helps to manage unmanaged memory
파일 보기 프로젝트 열기: Pkcs11Interop/Pkcs11Interop

공개 메소드들

메소드 설명
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