Calling convention fix for C# callback delegate from C++

This commit is contained in:
Joseph Henry
2021-01-08 14:45:00 -08:00
parent 1723df9bf3
commit 1e2a3cae10

View File

@@ -15,6 +15,7 @@ using System.Runtime.InteropServices;
using System;
// Prototype of callback used by ZeroTier to signal events to C# application
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void CSharpCallbackWithStruct(IntPtr msgPtr);
/// <summary>
@@ -473,7 +474,7 @@ namespace ZeroTier
struct zts_callback_msg
{
public short eventCode;
[MarshalAs(UnmanagedType.LPStruct, SizeConst = 4)]
//[MarshalAs(UnmanagedType.LPStruct, SizeConst = 4)]
public IntPtr node;
public IntPtr network;
}