Utility class that helps to manage unmanaged memory
More...
|
static IntPtr | Allocate (int size) |
| Allocates unmanaged zero-filled memory More...
|
|
static void | Free (ref IntPtr memory) |
| Frees previously allocated unmanaged memory More...
|
|
static int | SizeOf (Type structureType) |
| Returns the unmanaged size of the structure in bytes More...
|
|
static void | Write (IntPtr memory, byte[] content) |
| Copies content of byte array to unmanaged memory More...
|
|
static void | Write (IntPtr memory, object structure) |
| Copies content of structure to unmanaged memory More...
|
|
static byte [] | Read (IntPtr memory, int size) |
| Creates copy of unmanaged memory contet More...
|
|
static object | Read (IntPtr memory, Type structureType) |
| Copies content of unmanaged memory to the newly allocated managed structure More...
|
|
static void | Read (IntPtr memory, object structure) |
| Copies content of unmanaged memory to the existing managed structure More...
|
|
Utility class that helps to manage unmanaged memory
◆ Allocate()
static IntPtr Net.Pkcs11Interop.Common.UnmanagedMemory.Allocate |
( |
int |
size | ) |
|
|
static |
Allocates unmanaged zero-filled memory
- Parameters
-
size | Number of bytes required |
- Returns
- Pointer to newly allocated unmanaged zero-filled memory
◆ Free()
static void Net.Pkcs11Interop.Common.UnmanagedMemory.Free |
( |
ref IntPtr |
memory | ) |
|
|
static |
Frees previously allocated unmanaged memory
- Parameters
-
memory | Pointer to the previously allocated unmanaged memory |
◆ Read() [1/3]
static byte [] Net.Pkcs11Interop.Common.UnmanagedMemory.Read |
( |
IntPtr |
memory, |
|
|
int |
size |
|
) |
| |
|
static |
Creates copy of unmanaged memory contet
- Parameters
-
memory | Memory that should be copied |
size | Number of bytes that should be copied |
- Returns
- Copy of unmanaged memory contet
◆ Read() [2/3]
static object Net.Pkcs11Interop.Common.UnmanagedMemory.Read |
( |
IntPtr |
memory, |
|
|
Type |
structureType |
|
) |
| |
|
static |
Copies content of unmanaged memory to the newly allocated managed structure
- Parameters
-
memory | Memory that should be copied |
structureType | Type of structure that should be created |
- Returns
- Structure of requested type
◆ Read() [3/3]
static void Net.Pkcs11Interop.Common.UnmanagedMemory.Read |
( |
IntPtr |
memory, |
|
|
object |
structure |
|
) |
| |
|
static |
Copies content of unmanaged memory to the existing managed structure
- Parameters
-
memory | Memory that should be copied |
structure | Object to which data should be copied |
◆ SizeOf()
static int Net.Pkcs11Interop.Common.UnmanagedMemory.SizeOf |
( |
Type |
structureType | ) |
|
|
static |
Returns the unmanaged size of the structure in bytes
- Parameters
-
structureType | Type of structure whose size should be determined |
- Returns
- Unmanaged size of the structure in bytes
◆ Write() [1/2]
static void Net.Pkcs11Interop.Common.UnmanagedMemory.Write |
( |
IntPtr |
memory, |
|
|
byte [] |
content |
|
) |
| |
|
static |
Copies content of byte array to unmanaged memory
- Parameters
-
memory | Previously allocated unmanaged memory to copy to |
content | Byte array to copy from |
◆ Write() [2/2]
static void Net.Pkcs11Interop.Common.UnmanagedMemory.Write |
( |
IntPtr |
memory, |
|
|
object |
structure |
|
) |
| |
|
static |
Copies content of structure to unmanaged memory
- Parameters
-
memory | Previously allocated unmanaged memory to copy to |
structure | Structure to copy from |
◆ DebugModeEnabled
bool Net.Pkcs11Interop.Common.UnmanagedMemory.DebugModeEnabled |
|
staticgetset |
Flag indicating whether all memory allocations should be logged
The documentation for this class was generated from the following file: