public Array ToArray() { var blob = new SharedMemoryBlob(Process.GetProcessById(ProcessId), GetBaseAddress()); var array = Array.CreateInstance(ValueType, Length); var tempHandle = GCHandle.Alloc(array, GCHandleType.Pinned); var destination = Marshal.UnsafeAddrOfPinnedArrayElement(array, 0); blob.ReadAndWrite(destination, ByteLength); tempHandle.Free(); return(array); }
public void CopyTo(IntPtr targetAddress) { var blob = new SharedMemoryBlob(Process.GetProcessById(ProcessId), GetBaseAddress()); blob.ReadAndWrite(targetAddress, ByteLength); }