return 100;
}
- [UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)]
- public delegate int TestDelegate(StructWithCtor* ptrStruct, ref StructWithCtor refStruct);
-
public static unsafe int Main()
{
- TestDelegate del = (TestDelegate)StructWithCtorTest;
+ TestDelegate del = (TestDelegate)Delegate.CreateDelegate(typeof(TestDelegate), typeof(CopyCtor).GetMethod("StructWithCtorTest"));
StructWithCtor s1 = new StructWithCtor();
StructWithCtor s2 = new StructWithCtor();
s1._instanceField = 1;
.assembly extern System.Runtime.CompilerServices.VisualC { }
.assembly CopyCtorUtil { }
+.class auto ansi sealed public TestDelegate
+ extends [mscorlib]System.MulticastDelegate
+{
+ .custom instance void [mscorlib]System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.CallingConvention) = ( 01 00 03 00 00 00 00 00 )
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor(object 'object',
+ native int 'method') runtime managed
+ {
+ } // end of method TestDelegate::.ctor
+
+ .method public hidebysig newslot virtual
+ instance int32 Invoke(valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)* ptrStruct,
+ valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)& refStruct) runtime managed
+ {
+ } // end of method TestDelegate::Invoke
+
+ .method public hidebysig newslot virtual
+ instance class [mscorlib]System.IAsyncResult
+ BeginInvoke(valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)* ptrStruct,
+ valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)& refStruct,
+ class [mscorlib]System.AsyncCallback callback,
+ object 'object') runtime managed
+ {
+ } // end of method TestDelegate::BeginInvoke
+
+ .method public hidebysig newslot virtual
+ instance int32 EndInvoke(valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)& refStruct,
+ class [mscorlib]System.IAsyncResult result) runtime managed
+ {
+ } // end of method TestDelegate::EndInvoke
+
+} // end of class TestDelegate
+
.class public sealed sequential ansi beforefieldinit StructWithCtor
extends [mscorlib]System.ValueType
{