Skip to content

Commit f6c3d3b

Browse files
committed
fix: use CallingConvention and MarshalAs, v0.22.2
1 parent d34e453 commit f6c3d3b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

TonLibDotNet/TonClient.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ public TonClient(ILogger<TonClient> logger, Microsoft.Extensions.Options.IOption
3030
this.tonOptions = options?.Value ?? throw new ArgumentNullException(nameof(options));
3131
}
3232

33-
[DllImport(TonLibResolver.DllNamePlaceholder)]
33+
[DllImport(TonLibResolver.DllNamePlaceholder, CallingConvention = CallingConvention.Cdecl)]
3434
private static extern IntPtr tonlib_client_json_create();
3535

36-
[DllImport(TonLibResolver.DllNamePlaceholder)]
36+
[DllImport(TonLibResolver.DllNamePlaceholder, CallingConvention = CallingConvention.Cdecl)]
3737
private static extern void tonlib_client_json_destroy(IntPtr client);
3838

39-
[DllImport(TonLibResolver.DllNamePlaceholder)]
39+
[DllImport(TonLibResolver.DllNamePlaceholder, CallingConvention = CallingConvention.Cdecl)]
4040
private static extern void tonlib_client_set_verbosity_level(int level);
4141

42-
[DllImport(TonLibResolver.DllNamePlaceholder, CharSet = CharSet.Ansi)]
43-
private static extern IntPtr tonlib_client_json_execute(IntPtr client, string request);
42+
[DllImport(TonLibResolver.DllNamePlaceholder, CallingConvention = CallingConvention.Cdecl)]
43+
private static extern IntPtr tonlib_client_json_execute(IntPtr client, [MarshalAs(UnmanagedType.LPStr)] string request);
4444

45-
[DllImport(TonLibResolver.DllNamePlaceholder, CharSet = CharSet.Ansi)]
46-
private static extern void tonlib_client_json_send(IntPtr client, string request);
45+
[DllImport(TonLibResolver.DllNamePlaceholder, CallingConvention = CallingConvention.Cdecl)]
46+
private static extern void tonlib_client_json_send(IntPtr client, [MarshalAs(UnmanagedType.LPStr)] string request);
4747

48-
[DllImport(TonLibResolver.DllNamePlaceholder)]
48+
[DllImport(TonLibResolver.DllNamePlaceholder, CallingConvention = CallingConvention.Cdecl)]
4949
private static extern IntPtr tonlib_client_json_receive(IntPtr client, double timeout);
5050

5151
public OptionsInfo? OptionsInfo { get; private set; }

TonLibDotNet/TonLibDotNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<RepositoryType>git</RepositoryType>
1717
<PackageTags>ton, toncoin, the-open-network, tonlib, tonlibjson</PackageTags>
1818
<PackageLicenseFile>LICENSE</PackageLicenseFile>
19-
<Version>0.21.1</Version>
19+
<Version>0.21.2</Version>
2020
<PackageReleaseNotes>A lot of changes, see GitHub changelog.</PackageReleaseNotes>
2121
<Description>TonLib (tonlibjson) wrapper for accessing Telegram Open Network lite servers (nodes) via ADNL protocol.</Description>
2222
<GenerateDocumentationFile>True</GenerateDocumentationFile>

0 commit comments

Comments
 (0)