diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-08-13 17:04:37 +0000 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-08-13 17:07:48 +0000 |
commit | 4fcf53f8170049674e59acbd765e3f740a260c29 (patch) | |
tree | 9d100395cd60130c26a2fc4316a4065a1e24d577 | |
parent | conf: split registry key open and create (diff) | |
download | wireguard-windows-4fcf53f8170049674e59acbd765e3f740a260c29.tar.xz wireguard-windows-4fcf53f8170049674e59acbd765e3f740a260c29.zip |
embeddable-dll-service: csharp: specify stdcall, not cdecl
wireguard.h uses the WINAPI macro, which is __stdcall, so mark these as
such.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | embeddable-dll-service/csharp/TunnelDll/Driver.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embeddable-dll-service/csharp/TunnelDll/Driver.cs b/embeddable-dll-service/csharp/TunnelDll/Driver.cs index 2e7b69a5..857d6a63 100644 --- a/embeddable-dll-service/csharp/TunnelDll/Driver.cs +++ b/embeddable-dll-service/csharp/TunnelDll/Driver.cs @@ -12,11 +12,11 @@ namespace Tunnel { public class Driver { - [DllImport("wireguard.dll", EntryPoint = "WireGuardOpenAdapter", CallingConvention = CallingConvention.Cdecl, SetLastError = true)] + [DllImport("wireguard.dll", EntryPoint = "WireGuardOpenAdapter", CallingConvention = CallingConvention.StdCall, SetLastError = true)] private static extern IntPtr openAdapter([MarshalAs(UnmanagedType.LPWStr)] string pool, [MarshalAs(UnmanagedType.LPWStr)] string name); - [DllImport("wireguard.dll", EntryPoint = "WireGuardFreeAdapter", CallingConvention = CallingConvention.Cdecl)] + [DllImport("wireguard.dll", EntryPoint = "WireGuardFreeAdapter", CallingConvention = CallingConvention.StdCall)] private static extern void freeAdapter(IntPtr adapter); - [DllImport("wireguard.dll", EntryPoint = "WireGuardGetConfiguration", CallingConvention = CallingConvention.Cdecl, SetLastError = true)] + [DllImport("wireguard.dll", EntryPoint = "WireGuardGetConfiguration", CallingConvention = CallingConvention.StdCall, SetLastError = true)] private static extern bool getConfiguration(IntPtr adapter, byte[] iface, ref UInt32 bytes); private const string defaultPool = "WireGuard"; |