aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/embeddable-dll-service/csharp/Service.cs
diff options
context:
space:
mode:
Diffstat (limited to 'embeddable-dll-service/csharp/Service.cs')
-rw-r--r--embeddable-dll-service/csharp/Service.cs14
1 files changed, 1 insertions, 13 deletions
diff --git a/embeddable-dll-service/csharp/Service.cs b/embeddable-dll-service/csharp/Service.cs
index 1375a3cb..4ad9fe47 100644
--- a/embeddable-dll-service/csharp/Service.cs
+++ b/embeddable-dll-service/csharp/Service.cs
@@ -19,20 +19,8 @@ namespace Tunnel
private const string LongName = "Example WireGuard Tunnel Client";
private const string Description = "A WireGuard tunnel created by example code.";
- [StructLayout(LayoutKind.Sequential)]
- private struct GoString
- {
- public string str;
- public long len;
- }
-
[DllImport("tunnel.dll", EntryPoint = "WireGuardTunnelService", CallingConvention = CallingConvention.Cdecl)]
- private static extern bool WireGuardTunnelService(GoString configFile);
-
- public static bool Run(string configFile)
- {
- return WireGuardTunnelService(new GoString { str = configFile, len = configFile.Length });
- }
+ public static extern bool Run([MarshalAs(UnmanagedType.LPWStr)] string configFile);
public static NamedPipeClientStream GetPipe(string configFile)
{