Calling convention fix for C# callback delegate from C++
This commit is contained in:
@@ -15,6 +15,7 @@ using System.Runtime.InteropServices;
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
// Prototype of callback used by ZeroTier to signal events to C# application
|
// Prototype of callback used by ZeroTier to signal events to C# application
|
||||||
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void CSharpCallbackWithStruct(IntPtr msgPtr);
|
public delegate void CSharpCallbackWithStruct(IntPtr msgPtr);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -473,7 +474,7 @@ namespace ZeroTier
|
|||||||
struct zts_callback_msg
|
struct zts_callback_msg
|
||||||
{
|
{
|
||||||
public short eventCode;
|
public short eventCode;
|
||||||
[MarshalAs(UnmanagedType.LPStruct, SizeConst = 4)]
|
//[MarshalAs(UnmanagedType.LPStruct, SizeConst = 4)]
|
||||||
public IntPtr node;
|
public IntPtr node;
|
||||||
public IntPtr network;
|
public IntPtr network;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user