diff --git a/YDotNet/Infrastructure/MemoryReader.cs b/YDotNet/Infrastructure/MemoryReader.cs index 862e3b64..d0e222c5 100644 --- a/YDotNet/Infrastructure/MemoryReader.cs +++ b/YDotNet/Infrastructure/MemoryReader.cs @@ -12,8 +12,12 @@ internal static byte[] ReadBytes(nint handle, uint length) { var data = new byte[length]; + Console.WriteLine($"(1) Data: {data == null} | {data.Length}"); + Marshal.Copy(handle, data, startIndex: 0, (int) length); + Console.WriteLine("(2) Copied to data"); + return data; } diff --git a/YDotNet/Native/UndoManager/Events/UndoEventNative.cs b/YDotNet/Native/UndoManager/Events/UndoEventNative.cs index 396af51c..fa83b781 100644 --- a/YDotNet/Native/UndoManager/Events/UndoEventNative.cs +++ b/YDotNet/Native/UndoManager/Events/UndoEventNative.cs @@ -22,6 +22,9 @@ internal struct UndoEventNative return null; } + Console.WriteLine($"OriginHandle: {OriginHandle}"); + Console.WriteLine($"OriginLength: {OriginLength}"); + return MemoryReader.ReadBytes(OriginHandle, OriginLength); } }