예제 #1
0
        public static int *ConvertToUnmanaged(IntWrapperWithoutGetPinnableReference managed)
        {
            int *ret = (int *)Marshal.AllocCoTaskMem(sizeof(int));

            *ret = managed.i;
            return(ret);
        }
예제 #2
0
 public void FromManaged(IntWrapperWithoutGetPinnableReference managed) => _managed = managed;
예제 #3
0
 public static ref int GetPinnableReference(IntWrapperWithoutGetPinnableReference wrapper) => ref wrapper.i;
예제 #4
0
 // We explicitly throw here as we're expecting to use the stateless GetPinnableReference method
 public void FromManaged(IntWrapperWithoutGetPinnableReference managed) => throw new NotImplementedException();