return (++fails);
}
-extern "C" DLL_EXPORT int GetResult()
+extern "C" DLL_EXPORT int _cdecl GetResult()
{
return fails;
}
typedef LPSTR (_cdecl* delegate_cdecl)(LPSTR* ppstr);
-extern "C" DLL_EXPORT delegate_cdecl CLPStr_DelegatePInvoke()
+extern "C" DLL_EXPORT delegate_cdecl _cdecl CLPStr_DelegatePInvoke()
{
return CLPStr_InOutByRef;
}
}
typedef BOOL(_cdecl *CdeclCallBack)(char ** pstr);
-extern "C" BOOL DLL_EXPORT DoCallBack_MarshalRefCharArray_Cdecl(CdeclCallBack caller)
+extern "C" BOOL DLL_EXPORT _cdecl DoCallBack_MarshalRefCharArray_Cdecl(CdeclCallBack caller)
{
char * str = (char*)CoTaskMemAlloc(LEN);
for(int i = 0;i<LEN;i++)
}
typedef BOOL(__stdcall *StdCallBack)(char ** pstr);
-extern "C" BOOL DLL_EXPORT DoCallBack_MarshalRefCharArray_Stdcall(StdCallBack caller)
+extern "C" BOOL DLL_EXPORT __stdcall DoCallBack_MarshalRefCharArray_Stdcall(StdCallBack caller)
{
char * str = (char*)CoTaskMemAlloc(LEN);
for(int i = 0;i<LEN;i++)
}
typedef BOOL (_cdecl * DelegatePInvoke_Cdecl)(char **pstr);
-extern "C" DLL_EXPORT DelegatePInvoke_Cdecl DelegatePinvoke_Cdecl()
+extern "C" DLL_EXPORT DelegatePInvoke_Cdecl _cdecl DelegatePinvoke_Cdecl()
{
return MarshalRefCharArray_Cdecl;
}
typedef BOOL (__stdcall * DelegatePInvoke_Stdcall)(char **pstr);
-extern "C" DLL_EXPORT DelegatePInvoke_Stdcall DelegatePinvoke_Stdcall()
+extern "C" DLL_EXPORT DelegatePInvoke_Stdcall __stdcall DelegatePinvoke_Stdcall()
{
return MarshalRefCharArray_Stdcall;
}
\ No newline at end of file
const int ARRAY_SIZE = 100;
typedef struct { char arr[ARRAY_SIZE]; } S_CHARByValArray;
-extern "C" DLL_EXPORT BOOL TakeByValTStr(S_CHARByValArray s, int size)
+extern "C" DLL_EXPORT BOOL _cdecl TakeByValTStr(S_CHARByValArray s, int size)
{
return true;
-}
\ No newline at end of file
+}
.class auto ansi Pin1_Test
{
- .method public static pinvokeimpl("mirror" cdecl) int32 Ret_Ptr(void *) il managed preservesig{ }
- .method public static pinvokeimpl("mirror" cdecl) void Set_Val(void*,int32 c) il managed preservesig { }
+ .method public static pinvokeimpl("mirror" winapi) int32 Ret_Ptr(void *) il managed preservesig{ }
+ .method public static pinvokeimpl("mirror" winapi) void Set_Val(void*,int32 c) il managed preservesig { }
.method public static int32 Main(class [mscorlib]System.String[] args) il managed
{
.entrypoint