Skip to content

feat(ffi): expose API for RDCleanPath (generated C# code and Rust FFI changes only) #864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ diplomat-runtime = "0.7"
ironrdp = { path = "../crates/ironrdp", features = ["session", "connector", "dvc", "svc", "rdpdr", "rdpsnd", "graphics", "input", "cliprdr", "displaycontrol"] }
ironrdp-cliprdr-native.path = "../crates/ironrdp-cliprdr-native"
ironrdp-core = { path = "../crates/ironrdp-core", features = ["alloc"] }
ironrdp-rdcleanpath = { path = "../crates/ironrdp-rdcleanpath" }
sspi = { version = "0.16", features = ["network_client"] }
thiserror = "1"
tracing = { version = "0.1", features = ["log"] }
Expand Down
39 changes: 39 additions & 0 deletions ffi/dotnet/Devolutions.IronRdp/Generated/RawRdCleanPathPdu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// <auto-generated/> by Diplomat

#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;

using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105

namespace Devolutions.IronRdp.Raw;

#nullable enable

[StructLayout(LayoutKind.Sequential)]
public partial struct RdCleanPathPdu
{
private const string NativeLib = "DevolutionsIronRdp";

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathPdu_to_der", ExactSpelling = true)]
public static unsafe extern RdcleanpathFfiResultBoxVecU8BoxIronRdpError ToDer(RdCleanPathPdu* self);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathPdu_get_hint", ExactSpelling = true)]
public static unsafe extern PduHint* GetHint();

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathPdu_from_der", ExactSpelling = true)]
public static unsafe extern RdcleanpathFfiResultBoxRdCleanPathPduBoxIronRdpError FromDer(byte* der, nuint derSz);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathPdu_get_x224_connection_pdu", ExactSpelling = true)]
public static unsafe extern RdcleanpathFfiResultBoxVecU8BoxIronRdpError GetX224ConnectionPdu(RdCleanPathPdu* self);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathPdu_get_server_cert_chain", ExactSpelling = true)]
public static unsafe extern RdcleanpathFfiResultBoxServerCertChainBoxIronRdpError GetServerCertChain(RdCleanPathPdu* self);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathPdu_get_server_addr", ExactSpelling = true)]
public static unsafe extern RdcleanpathFfiResultVoidBoxIronRdpError GetServerAddr(RdCleanPathPdu* self, DiplomatWriteable* serverAddr);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathPdu_destroy", ExactSpelling = true)]
public static unsafe extern void Destroy(RdCleanPathPdu* self);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// <auto-generated/> by Diplomat

#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;

using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105

namespace Devolutions.IronRdp.Raw;

#nullable enable

[StructLayout(LayoutKind.Sequential)]
public partial struct RdCleanPathRequestBuilder
{
private const string NativeLib = "DevolutionsIronRdp";

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathRequestBuilder_new", ExactSpelling = true)]
public static unsafe extern RdCleanPathRequestBuilder* New();

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathRequestBuilder_with_x224_pdu", ExactSpelling = true)]
public static unsafe extern void WithX224Pdu(RdCleanPathRequestBuilder* self, VecU8* x224Pdu);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathRequestBuilder_with_destination", ExactSpelling = true)]
public static unsafe extern void WithDestination(RdCleanPathRequestBuilder* self, byte* destination, nuint destinationSz);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathRequestBuilder_with_proxy_auth", ExactSpelling = true)]
public static unsafe extern void WithProxyAuth(RdCleanPathRequestBuilder* self, byte* proxyAuth, nuint proxyAuthSz);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathRequestBuilder_with_pcb", ExactSpelling = true)]
public static unsafe extern void WithPcb(RdCleanPathRequestBuilder* self, byte* pcb, nuint pcbSz);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathRequestBuilder_build", ExactSpelling = true)]
public static unsafe extern RdcleanpathFfiResultBoxRdCleanPathPduBoxIronRdpError Build(RdCleanPathRequestBuilder* self);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "RdCleanPathRequestBuilder_destroy", ExactSpelling = true)]
public static unsafe extern void Destroy(RdCleanPathRequestBuilder* self);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// <auto-generated/> by Diplomat

#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;

using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105

namespace Devolutions.IronRdp.Raw;

#nullable enable

[StructLayout(LayoutKind.Sequential)]
public partial struct RdcleanpathFfiResultBoxRdCleanPathPduBoxIronRdpError
{
[StructLayout(LayoutKind.Explicit)]
private unsafe struct InnerUnion
{
[FieldOffset(0)]
internal RdCleanPathPdu* ok;
[FieldOffset(0)]
internal IronRdpError* err;
}

private InnerUnion _inner;

[MarshalAs(UnmanagedType.U1)]
public bool isOk;

public unsafe RdCleanPathPdu* Ok
{
get
{
return _inner.ok;
}
}

public unsafe IronRdpError* Err
{
get
{
return _inner.err;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// <auto-generated/> by Diplomat

#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;

using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105

namespace Devolutions.IronRdp.Raw;

#nullable enable

[StructLayout(LayoutKind.Sequential)]
public partial struct RdcleanpathFfiResultBoxServerCertChainBoxIronRdpError
{
[StructLayout(LayoutKind.Explicit)]
private unsafe struct InnerUnion
{
[FieldOffset(0)]
internal ServerCertChain* ok;
[FieldOffset(0)]
internal IronRdpError* err;
}

private InnerUnion _inner;

[MarshalAs(UnmanagedType.U1)]
public bool isOk;

public unsafe ServerCertChain* Ok
{
get
{
return _inner.ok;
}
}

public unsafe IronRdpError* Err
{
get
{
return _inner.err;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// <auto-generated/> by Diplomat

#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;

using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105

namespace Devolutions.IronRdp.Raw;

#nullable enable

[StructLayout(LayoutKind.Sequential)]
public partial struct RdcleanpathFfiResultBoxVecU8BoxIronRdpError
{
[StructLayout(LayoutKind.Explicit)]
private unsafe struct InnerUnion
{
[FieldOffset(0)]
internal VecU8* ok;
[FieldOffset(0)]
internal IronRdpError* err;
}

private InnerUnion _inner;

[MarshalAs(UnmanagedType.U1)]
public bool isOk;

public unsafe VecU8* Ok
{
get
{
return _inner.ok;
}
}

public unsafe IronRdpError* Err
{
get
{
return _inner.err;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// <auto-generated/> by Diplomat

#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;

using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105

namespace Devolutions.IronRdp.Raw;

#nullable enable

[StructLayout(LayoutKind.Sequential)]
public partial struct RdcleanpathFfiResultVoidBoxIronRdpError
{
[StructLayout(LayoutKind.Explicit)]
private unsafe struct InnerUnion
{
[FieldOffset(0)]
internal IronRdpError* err;
}

private InnerUnion _inner;

[MarshalAs(UnmanagedType.U1)]
public bool isOk;

public unsafe IronRdpError* Err
{
get
{
return _inner.err;
}
}
}
30 changes: 30 additions & 0 deletions ffi/dotnet/Devolutions.IronRdp/Generated/RawServerCertChain.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// <auto-generated/> by Diplomat

#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;

using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105

namespace Devolutions.IronRdp.Raw;

#nullable enable

[StructLayout(LayoutKind.Sequential)]
public partial struct ServerCertChain
{
private const string NativeLib = "DevolutionsIronRdp";

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ServerCertChain_get_len", ExactSpelling = true)]
public static unsafe extern nuint GetLen(ServerCertChain* self);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ServerCertChain_get_vecu8", ExactSpelling = true)]
public static unsafe extern UtilsFfiResultBoxVecU8BoxIronRdpError GetVecu8(ServerCertChain* self, nuint index);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ServerCertChain_get_slice", ExactSpelling = true)]
public static unsafe extern UtilsFfiResultBoxBytesSliceBoxIronRdpError GetSlice(ServerCertChain* self, nuint index);

[DllImport(NativeLib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ServerCertChain_destroy", ExactSpelling = true)]
public static unsafe extern void Destroy(ServerCertChain* self);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// <auto-generated/> by Diplomat

#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;

using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105

namespace Devolutions.IronRdp.Raw;

#nullable enable

[StructLayout(LayoutKind.Sequential)]
public partial struct UtilsFfiResultBoxBytesSliceBoxIronRdpError
{
[StructLayout(LayoutKind.Explicit)]
private unsafe struct InnerUnion
{
[FieldOffset(0)]
internal BytesSlice* ok;
[FieldOffset(0)]
internal IronRdpError* err;
}

private InnerUnion _inner;

[MarshalAs(UnmanagedType.U1)]
public bool isOk;

public unsafe BytesSlice* Ok
{
get
{
return _inner.ok;
}
}

public unsafe IronRdpError* Err
{
get
{
return _inner.err;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// <auto-generated/> by Diplomat

#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;

using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105

namespace Devolutions.IronRdp.Raw;

#nullable enable

[StructLayout(LayoutKind.Sequential)]
public partial struct UtilsFfiResultBoxVecU8BoxIronRdpError
{
[StructLayout(LayoutKind.Explicit)]
private unsafe struct InnerUnion
{
[FieldOffset(0)]
internal VecU8* ok;
[FieldOffset(0)]
internal IronRdpError* err;
}

private InnerUnion _inner;

[MarshalAs(UnmanagedType.U1)]
public bool isOk;

public unsafe VecU8* Ok
{
get
{
return _inner.ok;
}
}

public unsafe IronRdpError* Err
{
get
{
return _inner.err;
}
}
}
Loading
Loading