Ok, this works:
[StructLayout(LayoutKind.Explicit, Size = 28)] public unsafe struct HandleProxy { [FieldOffset(0), MarshalAs(UnmanagedType.I4)] public JSValueType _ValueType;
... and this is not ...
[StructLayout(LayoutKind.Explicit, Size = 20)] public unsafe struct ValueProxy { [FieldOffset(0), MarshalAs(UnmanagedType.I4)] public JSValueType _ValueType;
So what's the difference? I'm missing something. Calling "DisposeValueProxy () gives the following error:
“Parameter # 1 cannot be marshaled”: pointers cannot refer to marshaled structures. Use ByRef instead.
(and yes, I can just use IntPtr / void * instead of "ValueProxy *", but that's not my point).
Calling "DisposeHandleProxy ()" works fine.
Let's see if anyone can figure it out.;)
source share