@@ -414,15 +414,6 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
414
414
switch (spec -> native ) {
415
415
case MONO_NATIVE_LPARRAY :
416
416
break ;
417
- case MONO_NATIVE_SAFEARRAY :
418
- #ifndef DISABLE_COM
419
- if (spec -> data .safearray_data .elem_type != MONO_VARIANT_VARIANT ) {
420
- char * msg = g_strdup ("Only SAFEARRAY(VARIANT) marshalling to managed code is implemented." );
421
- cb_to_mono -> methodBuilder .emit_exception_marshal_directive (mb , msg );
422
- return conv_arg ;
423
- }
424
- return mono_cominterop_emit_marshal_safearray (m , argnum , t , spec , conv_arg , conv_arg_type , action );
425
- #endif
426
417
default : {
427
418
char * msg = g_strdup ("Unsupported array type marshalling to managed code." );
428
419
cb_to_mono -> methodBuilder .emit_exception_marshal_directive (mb , msg );
@@ -2618,108 +2609,6 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
2618
2609
return conv_arg ;
2619
2610
}
2620
2611
2621
- static int
2622
- emit_marshal_variant_ilgen (EmitMarshalContext * m , int argnum , MonoType * t ,
2623
- MonoMarshalSpec * spec ,
2624
- int conv_arg , MonoType * * conv_arg_type ,
2625
- MarshalAction action )
2626
- {
2627
- #ifndef DISABLE_COM
2628
- MonoMethodBuilder * mb = m -> mb ;
2629
- MonoType * variant_type = m_class_get_byval_arg (mono_class_get_variant_class ());
2630
- MonoType * variant_type_byref = mono_class_get_byref_type (mono_class_get_variant_class ());
2631
- MonoType * object_type = cb_to_mono -> get_object_type ();
2632
-
2633
- switch (action ) {
2634
- case MARSHAL_ACTION_CONV_IN : {
2635
- conv_arg = cb_to_mono -> methodBuilder .add_local (mb , variant_type );
2636
-
2637
- if (m_type_is_byref (t ))
2638
- * conv_arg_type = variant_type_byref ;
2639
- else
2640
- * conv_arg_type = variant_type ;
2641
-
2642
- if (m_type_is_byref (t ) && !(t -> attrs & PARAM_ATTRIBUTE_IN ) && t -> attrs & PARAM_ATTRIBUTE_OUT )
2643
- break ;
2644
-
2645
- cb_to_mono -> methodBuilder .emit_ldarg (mb , argnum );
2646
- if (m_type_is_byref (t ))
2647
- cb_to_mono -> methodBuilder .emit_byte (mb , CEE_LDIND_REF );
2648
- cb_to_mono -> methodBuilder .emit_ldloc_addr (mb , conv_arg );
2649
- cb_to_mono -> methodBuilder .emit_managed_call (mb , mono_get_Marshal_GetNativeVariantForObject (), NULL );
2650
- break ;
2651
- }
2652
-
2653
- case MARSHAL_ACTION_CONV_OUT : {
2654
- if (m_type_is_byref (t ) && (t -> attrs & PARAM_ATTRIBUTE_OUT || !(t -> attrs & PARAM_ATTRIBUTE_IN ))) {
2655
- cb_to_mono -> methodBuilder .emit_ldarg (mb , argnum );
2656
- cb_to_mono -> methodBuilder .emit_ldloc_addr (mb , conv_arg );
2657
- cb_to_mono -> methodBuilder .emit_managed_call (mb , mono_get_Marshal_GetObjectForNativeVariant (), NULL );
2658
- cb_to_mono -> methodBuilder .emit_byte (mb , CEE_STIND_REF );
2659
- }
2660
-
2661
- cb_to_mono -> methodBuilder .emit_ldloc_addr (mb , conv_arg );
2662
- cb_to_mono -> methodBuilder .emit_managed_call (mb , mono_get_Variant_Clear (), NULL );
2663
- break ;
2664
- }
2665
-
2666
- case MARSHAL_ACTION_PUSH :
2667
- if (m_type_is_byref (t ))
2668
- cb_to_mono -> methodBuilder .emit_ldloc_addr (mb , conv_arg );
2669
- else
2670
- cb_to_mono -> methodBuilder .emit_ldloc (mb , conv_arg );
2671
- break ;
2672
-
2673
- case MARSHAL_ACTION_CONV_RESULT : {
2674
- char * msg = g_strdup ("Marshalling of VARIANT not supported as a return type." );
2675
- cb_to_mono -> methodBuilder .emit_exception_marshal_directive (mb , msg );
2676
- break ;
2677
- }
2678
-
2679
- case MARSHAL_ACTION_MANAGED_CONV_IN : {
2680
- conv_arg = cb_to_mono -> methodBuilder .add_local (mb , object_type );
2681
-
2682
- if (m_type_is_byref (t ))
2683
- * conv_arg_type = variant_type_byref ;
2684
- else
2685
- * conv_arg_type = variant_type ;
2686
-
2687
- if (m_type_is_byref (t ) && !(t -> attrs & PARAM_ATTRIBUTE_IN ) && t -> attrs & PARAM_ATTRIBUTE_OUT )
2688
- break ;
2689
-
2690
- if (m_type_is_byref (t ))
2691
- cb_to_mono -> methodBuilder .emit_ldarg (mb , argnum );
2692
- else
2693
- cb_to_mono -> methodBuilder .emit_ldarg_addr (mb , argnum );
2694
- cb_to_mono -> methodBuilder .emit_managed_call (mb , mono_get_Marshal_GetObjectForNativeVariant (), NULL );
2695
- cb_to_mono -> methodBuilder .emit_stloc (mb , conv_arg );
2696
- break ;
2697
- }
2698
-
2699
- case MARSHAL_ACTION_MANAGED_CONV_OUT : {
2700
- if (m_type_is_byref (t ) && (t -> attrs & PARAM_ATTRIBUTE_OUT || !(t -> attrs & PARAM_ATTRIBUTE_IN ))) {
2701
- cb_to_mono -> methodBuilder .emit_ldloc (mb , conv_arg );
2702
- cb_to_mono -> methodBuilder .emit_ldarg (mb , argnum );
2703
- cb_to_mono -> methodBuilder .emit_managed_call (mb , mono_get_Marshal_GetNativeVariantForObject (), NULL );
2704
- }
2705
- break ;
2706
- }
2707
-
2708
- case MARSHAL_ACTION_MANAGED_CONV_RESULT : {
2709
- char * msg = g_strdup ("Marshalling of VARIANT not supported as a return type." );
2710
- cb_to_mono -> methodBuilder .emit_exception_marshal_directive (mb , msg );
2711
- break ;
2712
- }
2713
-
2714
- default :
2715
- g_assert_not_reached ();
2716
- }
2717
- #endif /* DISABLE_COM */
2718
-
2719
- return conv_arg ;
2720
- }
2721
-
2722
-
2723
2612
static int
2724
2613
emit_marshal_ilgen (EmitMarshalContext * m , int argnum , MonoType * t ,
2725
2614
MonoMarshalSpec * spec , int conv_arg ,
@@ -2741,23 +2630,6 @@ emit_marshal_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
2741
2630
return emit_marshal_string_ilgen (m , argnum , t , spec , conv_arg , conv_arg_type , action );
2742
2631
case MONO_TYPE_CLASS :
2743
2632
case MONO_TYPE_OBJECT :
2744
- #if !defined(DISABLE_COM )
2745
- if (spec && spec -> native == MONO_NATIVE_STRUCT )
2746
- return emit_marshal_variant_ilgen (m , argnum , t , spec , conv_arg , conv_arg_type , action );
2747
- #endif
2748
-
2749
- #if !defined(DISABLE_COM )
2750
- if ((spec && (spec -> native == MONO_NATIVE_IUNKNOWN ||
2751
- spec -> native == MONO_NATIVE_IDISPATCH ||
2752
- spec -> native == MONO_NATIVE_INTERFACE )) ||
2753
- (t -> type == MONO_TYPE_CLASS && mono_cominterop_is_interface (t -> data .klass )))
2754
- return mono_cominterop_emit_marshal_com_interface (m , argnum , t , spec , conv_arg , conv_arg_type , action );
2755
- if (spec && (spec -> native == MONO_NATIVE_SAFEARRAY ) &&
2756
- (spec -> data .safearray_data .elem_type == MONO_VARIANT_VARIANT ) &&
2757
- ((action == MARSHAL_ACTION_CONV_OUT ) || (action == MARSHAL_ACTION_CONV_IN ) || (action == MARSHAL_ACTION_PUSH )))
2758
- return mono_cominterop_emit_marshal_safearray (m , argnum , t , spec , conv_arg , conv_arg_type , action );
2759
- #endif
2760
-
2761
2633
if (cb_to_mono -> try_get_safehandle_class () != NULL && t -> data .klass &&
2762
2634
cb_to_mono -> is_subclass_of_internal (t -> data .klass , cb_to_mono -> try_get_safehandle_class (), FALSE))
2763
2635
return emit_marshal_safehandle_ilgen (m , argnum , t , spec , conv_arg , conv_arg_type , action );
0 commit comments