Click or drag to resize

SafeNativeMemoryT Class

Represents a wrapper class for a buffer allocated with AllocHGlobal(Int32) and the size of T.
Inheritance Hierarchy

Namespace: TomsToolbox.Desktop
Assembly: TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public class SafeNativeMemory<T> : SafeNativeMemory
where T : struct, new()

Type Parameters

T

The SafeNativeMemoryT type exposes the following members.

Constructors
 NameDescription
Public methodSafeNativeMemoryT Initializes a new instance of the SafeNativeMemoryT class.
Public methodSafeNativeMemoryT(Int32) Initializes a new instance of the SafeNativeMemoryT class.
Top
Properties
 NameDescription
Public propertyIsInvalid When overridden in a derived class, gets a value indicating whether the handle value is invalid.
(Inherited from SafeNativeMemory)
Public propertySize Gets the size of the allocated buffer.
(Inherited from SafeNativeMemory)
Top
Methods
 NameDescription
Public methodAllocate Allocates a buffer with the specified size.
(Inherited from SafeNativeMemory)
Public methodReadInt32 Reads a 32-bit signed integer from unmanaged memory.
(Inherited from SafeNativeMemory)
Public methodReadIntPtr Reads a processor native sized integer from unmanaged memory.
(Inherited from SafeNativeMemory)
Protected methodReleaseHandle When overridden in a derived class, executes the code required to free the handle.
(Inherited from SafeNativeMemory)
Public methodToStructure Marshal the memory from native to .NET.
Top
Operators
 NameDescription
Public operatorStatic member(SafeNativeMemoryT to T) Performs an implicit conversion from SafeNativeMemory to IntPtr.
Top
Extension Methods
 NameDescription
Public Extension MethodSafeCastT Performs a cast from object to T, avoiding possible null violations if T is a value type.
(Defined by ObjectExtensions)
Top
See Also