mirror of
https://github.com/netbirdio/IronRDP.git
synced 2026-05-22 18:43:12 -07:00
chore: update .NET bindings (#551)
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user