Skip to content

Marshalling fix for 3-IntPtr args cdecl calls. #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Marshalling fix for 3-IntPtr args cdecl calls.
  • Loading branch information
dse committed Oct 1, 2017
commit 580f13fb273e0f53b84b081d510093e50698c37b
6 changes: 2 additions & 4 deletions src/runtime/nativecall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ internal class NativeCall
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void Void_1_Delegate(IntPtr a1);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate IntPtr IntPtr_3_Delegate(IntPtr a1, IntPtr a2, IntPtr a3);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int Int_3_Delegate(IntPtr a1, IntPtr a2, IntPtr a3);

Expand All @@ -40,7 +37,8 @@ public static void Void_Call_1(IntPtr fp, IntPtr a1)

public static IntPtr Call_3(IntPtr fp, IntPtr a1, IntPtr a2, IntPtr a3)
{
return ((IntPtr_3_Delegate)Marshal.GetDelegateForFunctionPointer(fp, typeof(IntPtr_3_Delegate)))(a1, a2, a3);
var d = (Interop.TernaryFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(Interop.TernaryFunc));
return d(a1, a2, a3);
}


Expand Down