Click or drag to resize

SafeNativeMemory Class

Represents a wrapper class for a buffer allocated with AllocHGlobal(Int32)
Inheritance Hierarchy

Namespace:  TomsToolbox.Desktop
Assembly:  TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 1.0.74.0
Syntax
public class SafeNativeMemory : SafeHandle

The SafeNativeMemory type exposes the following members.

Constructors
  NameDescription
Public methodSafeNativeMemory
Initializes a new instance of the SafeNativeMemory class with no buffer allocated.
Public methodSafeNativeMemory(Int32)
Initializes a new instance of the SafeNativeMemory class.
Public methodSafeNativeMemory(IntPtr, Int32)
Initializes a new instance of the SafeNativeMemory class.
Top
Properties
  NameDescription
Public propertyIsInvalid
When overridden in a derived class, gets a value indicating whether the handle value is invalid.
(Overrides SafeHandleIsInvalid.)
Public propertySize
Gets the size of the allocated buffer.
Top
Methods
  NameDescription
Public methodAllocate
Allocates a buffer with the specified size.
Public methodReadInt32
Reads a 32-bit signed integer from unmanaged memory.
Public methodReadIntPtr
Reads a processor native sized integer from unmanaged memory.
Protected methodReleaseHandle
When overridden in a derived class, executes the code required to free the handle.
(Overrides SafeHandleReleaseHandle.)
Top
Extension Methods
  NameDescription
Public Extension MethodSafeCastT
Performs a cast from object to T, avoiding possible null violations if T is a value type.

[CanBeNull]

(Defined by ObjectExtensions.)
Top
See Also