chore: update .NET bindings (#551)

This commit is contained in:
Benoît Cortier
2024-09-23 05:46:33 -04:00
committed by GitHub
parent c5a4abd112
commit a002057016
5 changed files with 22 additions and 24 deletions
@@ -15,11 +15,13 @@ public enum IronRdpErrorKind
{
Generic = 0,
PduError = 1,
CredsspError = 2,
Consumed = 3,
IO = 4,
AccessDenied = 5,
IncorrectEnumType = 6,
Clipboard = 7,
WrongOS = 8,
EncodeError = 2,
DecodeError = 3,
CredsspError = 4,
Consumed = 5,
IO = 6,
AccessDenied = 7,
IncorrectEnumType = 8,
Clipboard = 9,
WrongOS = 10,
}
@@ -15,11 +15,13 @@ public enum IronRdpErrorKind
{
Generic = 0,
PduError = 1,
CredsspError = 2,
Consumed = 3,
IO = 4,
AccessDenied = 5,
IncorrectEnumType = 6,
Clipboard = 7,
WrongOS = 8,
EncodeError = 2,
DecodeError = 3,
CredsspError = 4,
Consumed = 5,
IO = 6,
AccessDenied = 7,
IncorrectEnumType = 8,
Clipboard = 9,
WrongOS = 10,
}
@@ -17,7 +17,7 @@ public partial struct PduHint
private const string NativeLib = "DevolutionsIronRdp";
[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "PduHint_find_size", ExactSpelling = true)]
public static unsafe extern ConnectorFfiResultBoxOptionalUsizeBoxIronRdpError FindSize(PduHint* self, byte* bytes, nuint bytesSz, bool* matched);
public static unsafe extern ConnectorFfiResultBoxOptionalUsizeBoxIronRdpError FindSize(PduHint* self, byte* bytes, nuint bytesSz);
[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "PduHint_destroy", ExactSpelling = true)]
public static unsafe extern void Destroy(PduHint* self);
@@ -16,11 +16,8 @@ public partial struct WinCliprdr
{
private const string NativeLib = "DevolutionsIronRdp";
/// <summary>
/// SAFETY: `hwnd` must be a valid window handle
/// </summary>
[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "WinCliprdr_new", ExactSpelling = true)]
public static unsafe extern ClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError New(nint hwnd);
public static unsafe extern ClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError New();
[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "WinCliprdr_next_clipboard_message", ExactSpelling = true)]
public static unsafe extern ClipboardWindowsFfiResultOptBoxClipboardMessageBoxIronRdpError NextClipboardMessage(WinCliprdr* self);
@@ -29,18 +29,15 @@ public partial class WinCliprdr: IDisposable
_inner = handle;
}
/// <summary>
/// SAFETY: `hwnd` must be a valid window handle
/// </summary>
/// <exception cref="IronRdpException"></exception>
/// <returns>
/// A <c>WinCliprdr</c> allocated on Rust side.
/// </returns>
public static WinCliprdr New(nint hwnd)
public static WinCliprdr New()
{
unsafe
{
Raw.ClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError result = Raw.WinCliprdr.New(hwnd);
Raw.ClipboardWindowsFfiResultBoxWinCliprdrBoxIronRdpError result = Raw.WinCliprdr.New();
if (!result.isOk)
{
throw new IronRdpException(new IronRdpError(result.Err));