Merge pull request #3948 from henricm/fix-pinvoke-utf8-windows
[mono.git] / mono / metadata / metadata.c
index 36a954cd8b036e73716d1d806fd2a83a465f7098..973c4ca8bf3fd71660817db7391b2c5c30fa107f 100644 (file)
@@ -5815,7 +5815,7 @@ handle_enum:
                                *conv = MONO_MARSHAL_CONV_STR_TBSTR;
                                return MONO_NATIVE_TBSTR;
                        case MONO_NATIVE_UTF8STR:
-                               *conv = MONO_MARSHAL_CONV_STR_LPTSTR;
+                               *conv = MONO_MARSHAL_CONV_STR_UTF8STR;
                                return MONO_NATIVE_UTF8STR;
                        case MONO_NATIVE_BYVALTSTR:
                                if (unicode)
@@ -6634,8 +6634,8 @@ mono_metadata_get_corresponding_event_from_generic_type_definition (MonoEvent *e
                return event;
 
        gtd = mono_class_get_generic_class (event->parent)->container_class;
-       offset = event - event->parent->ext->events;
-       return gtd->ext->events + offset;
+       offset = event - mono_class_get_ext (event->parent)->events;
+       return mono_class_get_ext (gtd)->events + offset;
 }
 
 /*
@@ -6652,8 +6652,8 @@ mono_metadata_get_corresponding_property_from_generic_type_definition (MonoPrope
                return property;
 
        gtd = mono_class_get_generic_class (property->parent)->container_class;
-       offset = property - property->parent->ext->properties;
-       return gtd->ext->properties + offset;
+       offset = property - mono_class_get_ext (property->parent)->properties;
+       return mono_class_get_ext (gtd)->properties + offset;
 }
 
 MonoWrapperCaches*