14 private unsafe
void* _ptr;
16 private RuntimeType _ptrType;
25 _ptr = ((
IntPtr)info.GetValue(
"_ptr", typeof(
IntPtr))).ToPointer();
26 _ptrType = (RuntimeType)info.GetValue(
"_ptrType", typeof(RuntimeType));
38 public unsafe
static object Box(
void* ptr,
Type type)
48 RuntimeType runtimeType = type as RuntimeType;
49 if (runtimeType ==
null)
55 pointer._ptrType = runtimeType;
65 public unsafe
static void*
Unbox(
object ptr)
74 internal RuntimeType GetPointerType()
80 internal unsafe
object GetPointerValue()
91 info.AddValue(
"_ptr",
new IntPtr(_ptr));
92 info.AddValue(
"_ptrType", _ptrType);
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Provides information about, and means to manipulate, the current environment and platform....
bool IsPointer
Gets a value indicating whether the T:System.Type is a pointer.
Provides a wrapper class for pointers.
A platform-specific type that is used to represent a pointer or a handle.
Represents type declarations: class types, interface types, array types, value types,...
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
The exception that is thrown when one of the arguments provided to a method is not valid.
static unsafe void * Unbox(object ptr)
Returns the stored pointer.
Allows an object to control its own serialization and deserialization.
Specifies that the class can be serialized.
static unsafe object Box(void *ptr, Type type)
Boxes the supplied unmanaged memory pointer and the type associated with that pointer into a managed ...
void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a T:System.Runtime.Serialization.SerializationInfo with the data needed to serialize the ta...