Browse Source

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

pull/8/head
Joseph Henry 5 years ago
parent
commit
1e2a3cae10
No known key found for this signature in database
GPG Key ID: C45B33FF5EBC9344
  1. 3
      examples/csharp/Node.cs

3
examples/csharp/Node.cs

@ -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;
}

Loading…
Cancel
Save