@@ -45,8 +45,10 @@ use ironrdp_pdu::input::fast_path::{
4545use ironrdp_pdu:: input:: mouse:: PointerFlags ;
4646use ironrdp_pdu:: input:: { InputEventError , MousePdu } ;
4747use ironrdp_pdu:: nego:: NegoRequestData ;
48- use ironrdp_pdu:: rdp:: capability_sets:: MajorPlatformType ;
49- use ironrdp_pdu:: rdp:: client_info:: PerformanceFlags ;
48+ use ironrdp_pdu:: rdp:: capability_sets:: {
49+ client_codecs_capabilities, BitmapCodecs , MajorPlatformType ,
50+ } ;
51+ use ironrdp_pdu:: rdp:: client_info:: { PerformanceFlags , TimezoneInfo } ;
5052use ironrdp_pdu:: rdp:: RdpError ;
5153use ironrdp_pdu:: PduError ;
5254use ironrdp_pdu:: PduResult ;
@@ -60,7 +62,7 @@ use ironrdp_session::SessionErrorKind::Reason;
6062use ironrdp_session:: { reason_err, SessionError , SessionResult } ;
6163use ironrdp_svc:: { SvcMessage , SvcProcessor , SvcProcessorMessages } ;
6264use ironrdp_tokio:: { single_sequence_step_read, Framed , FramedWrite , TokioStream } ;
63- use log:: debug;
65+ use log:: { debug, error } ;
6466use rand:: { Rng , TryRngCore } ;
6567use std:: error:: Error ;
6668use std:: fmt:: { Debug , Display , Formatter } ;
@@ -195,11 +197,11 @@ impl Client {
195197 } ) ;
196198 let drdynvc_client = DrdynvcClient :: new ( ) . with_dynamic_channel ( display_control) ;
197199
198- let mut connector = ironrdp_connector :: ClientConnector :: new ( connector_config . clone ( ) )
199- . with_server_addr ( server_socket_addr)
200- . with_static_channel ( drdynvc_client) // require for resizing
201- . with_static_channel ( Rdpsnd :: new ( Box :: new ( NoopRdpsndBackend { } ) ) ) // required for rdpdr to work
202- . with_static_channel ( rdpdr) ; // required for smart card + directory sharing
200+ let mut connector =
201+ ironrdp_connector :: ClientConnector :: new ( connector_config . clone ( ) , server_socket_addr)
202+ . with_static_channel ( drdynvc_client) // require for resizing
203+ . with_static_channel ( Rdpsnd :: new ( Box :: new ( NoopRdpsndBackend { } ) ) ) // required for rdpdr to work
204+ . with_static_channel ( rdpdr) ; // required for smart card + directory sharing
203205
204206 if params. allow_clipboard {
205207 connector = connector. with_static_channel ( Cliprdr :: new ( Box :: new (
@@ -377,7 +379,6 @@ impl Client {
377379 & mut read_stream,
378380 sequence. as_mut ( ) ,
379381 & mut buf,
380- None ,
381382 )
382383 . await ?;
383384
@@ -671,7 +672,7 @@ impl Client {
671672 event : FastPathInputEvent ,
672673 ) -> ClientResult < ( ) > {
673674 write_stream
674- . write_all ( & encode_vec ( & FastPathInput ( vec ! [ event] ) ) ?)
675+ . write_all ( & encode_vec ( & FastPathInput :: single ( event) ) ?)
675676 . await ?;
676677 Ok ( ( ) )
677678 }
@@ -1387,6 +1388,8 @@ fn create_config(params: &ConnectParams, pin: String, cgo_handle: CgoHandle) ->
13871388 } ,
13881389 enable_tls : true ,
13891390 enable_credssp : params. ad && params. nla ,
1391+ enable_audio_playback : false ,
1392+ timezone_info : TimezoneInfo :: default ( ) ,
13901393 credentials : Credentials :: SmartCard {
13911394 config : params. ad . then ( || SmartCardIdentity {
13921395 csp_name : "Microsoft Base Smart Card Crypto Provider" . to_string ( ) ,
@@ -1413,13 +1416,19 @@ fn create_config(params: &ConnectParams, pin: String, cgo_handle: CgoHandle) ->
14131416 // Changing this to 16 gets us uncompressed bitmaps on machines configured like
14141417 // https://github.com/Devolutions/IronRDP/blob/55d11a5000ebd474c2ddc294b8b3935554443112/README.md?plain=1#L17-L36
14151418 color_depth : 32 ,
1419+ // Try to configure the client to use remotefx only. This should never fail in practice, but just in
1420+ // case we'll log an error and fall back to defaults.
1421+ codecs : client_codecs_capabilities ( & [ "remotefx" ] ) . unwrap_or_else ( |err| {
1422+ error ! ( "Failed to configure client for remotefx: {}" , err) ;
1423+ BitmapCodecs :: default ( )
1424+ } ) ,
14161425 } ) ,
14171426 dig_product_id : "" . to_string ( ) ,
14181427 // `client_dir` is apparently unimportant, however most RDP clients hardcode this value (including FreeRDP):
14191428 // https://github.com/FreeRDP/FreeRDP/blob/4e24b966c86fdf494a782f0dfcfc43a057a2ea60/libfreerdp/core/settings.c#LL49C34-L49C70
14201429 client_dir : "C:\\ Windows\\ System32\\ mstscax.dll" . to_string ( ) ,
14211430 platform : MajorPlatformType :: UNSPECIFIED ,
1422- no_server_pointer : false ,
1431+ enable_server_pointer : true ,
14231432 autologon : true ,
14241433 pointer_software_rendering : false ,
14251434 // Send the username in the request cookie, which is sent in the initial connection request.
0 commit comments