@@ -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
@@ -1376,6 +1377,8 @@ fn create_config(params: &ConnectParams, pin: String, cgo_handle: CgoHandle) ->
13761377 } ,
13771378 enable_tls : true ,
13781379 enable_credssp : params. ad && params. nla ,
1380+ enable_audio_playback : false ,
1381+ timezone_info : TimezoneInfo :: default ( ) ,
13791382 credentials : Credentials :: SmartCard {
13801383 config : params. ad . then ( || SmartCardIdentity {
13811384 csp_name : "Microsoft Base Smart Card Crypto Provider" . to_string ( ) ,
@@ -1402,13 +1405,19 @@ fn create_config(params: &ConnectParams, pin: String, cgo_handle: CgoHandle) ->
14021405 // Changing this to 16 gets us uncompressed bitmaps on machines configured like
14031406 // https://github.com/Devolutions/IronRDP/blob/55d11a5000ebd474c2ddc294b8b3935554443112/README.md?plain=1#L17-L36
14041407 color_depth : 32 ,
1408+ // Try to congiure the client to use remotefx only. This should never fail in practice, but just in
1409+ // case we'll log an error and fall back to defaults.
1410+ codecs : client_codecs_capabilities ( & [ "remotefx" ] ) . unwrap_or_else ( |err| {
1411+ error ! ( "Failed to configure client for remotefx: {}" , err) ;
1412+ BitmapCodecs :: default ( )
1413+ } ) ,
14051414 } ) ,
14061415 dig_product_id : "" . to_string ( ) ,
14071416 // `client_dir` is apparently unimportant, however most RDP clients hardcode this value (including FreeRDP):
14081417 // https://github.com/FreeRDP/FreeRDP/blob/4e24b966c86fdf494a782f0dfcfc43a057a2ea60/libfreerdp/core/settings.c#LL49C34-L49C70
14091418 client_dir : "C:\\ Windows\\ System32\\ mstscax.dll" . to_string ( ) ,
14101419 platform : MajorPlatformType :: UNSPECIFIED ,
1411- no_server_pointer : false ,
1420+ enable_server_pointer : true ,
14121421 autologon : true ,
14131422 pointer_software_rendering : false ,
14141423 // Send the username in the request cookie, which is sent in the initial connection request.
0 commit comments