Ejemplo n.º 1
0
            public static IntPtr Create(
                QueryInterfaceDelegate queryInterface,
                AddRefDelegate addRef,
                ReleaseDelegate release,
                BarDelegate bar)
            {
                var instance = new ManualVTable
                {
                    QueryInterface = Marshal.GetFunctionPointerForDelegate(queryInterface),
                    AddRef         = Marshal.GetFunctionPointerForDelegate(addRef),
                    Release        = Marshal.GetFunctionPointerForDelegate(release),
                    Bar            = Marshal.GetFunctionPointerForDelegate(bar)
                };
                var marshalledInstance = Marshal.AllocHGlobal(Marshal.SizeOf(instance));

                Marshal.StructureToPtr(instance, marshalledInstance, false);
                return(marshalledInstance);
            }
Ejemplo n.º 2
0
            public static IntPtr Create(
				QueryInterfaceDelegate queryInterface,
				AddRefDelegate addRef,
				ReleaseDelegate release,
				BarDelegate bar)
            {
                var instance = new ManualVTable
                {
                    QueryInterface = Marshal.GetFunctionPointerForDelegate(queryInterface),
                    AddRef = Marshal.GetFunctionPointerForDelegate(addRef),
                    Release = Marshal.GetFunctionPointerForDelegate(release),
                    Bar = Marshal.GetFunctionPointerForDelegate(bar)
                };
                var marshalledInstance = Marshal.AllocHGlobal(Marshal.SizeOf(instance));
                Marshal.StructureToPtr(instance, marshalledInstance, false);
                return marshalledInstance;
            }
Ejemplo n.º 3
0
 public static int Main_old()
 {
     BarDelegate Delegate_TestClass_delegate36_B = new BarDelegate(Bar);
     return Delegate_TestClass_delegate36_B(new int[] { 1, 2, 3 }) - Delegate_TestClass_delegate36_B(new int[] { 1, 2 });
 }