+#ifdef TARGET_WIN32
+ /*
+ * On Windows the default pinvoke calling convention is STDCALL but
+ * we need CDECL since this is actually an icall.
+ */
+ signature->call_convention = MONO_CALL_C;
+#endif
+ } else if (m->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {