C++/CLI ライブラリの関数を定義しました。
extern "C"
{
INT_PTR __cdecl brl_graphics_Graphics(int Width, int Height, int Depth, int Hertz, int Flags);
}
そして、これはそれを呼び出す関数です。これは単なるラッパーです:
IntPtr BlitzMax::BlitzMax::Graphics(int Width, int Height, int Depth, int Hertz, int Flags)
{
return IntPtr(brl_graphics_Graphics(Width, Height, Depth, Hertz, Flags));
}
C# アプリケーションから呼び出すと、AccessViolationException が発生します。何らかの理由で、逆アセンブリで cdecl 呼び出し規則が使用されていません。
push dword ptr [ebp+10h]
push dword ptr [ebp+0Ch]
push dword ptr [ebp+8]
mov ecx,dword ptr [ebp-4]
mov edx,dword ptr [ebp-8]
call FFD595B8