Skip to content
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

GetReaderIcon #33779

Merged
merged 19 commits into from
Oct 20, 2023
2 changes: 1 addition & 1 deletion lib/srv/desktop/rdp/rdpclient/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ x509-parser = "0.14"
sspi = { version = "0.10.1", features = ["network_client", "dns_resolver"] }
static_init = "1.0.3"

# # TODO: update once https://github.com/Devolutions/IronRDP/pull/230 lands
# TODO: change when https://github.com/Devolutions/IronRDP/pull/230 lands
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "dfca83db55140e839a9b41049b4a2170f93af287" }
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "dfca83db55140e839a9b41049b4a2170f93af287" }
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "dfca83db55140e839a9b41049b4a2170f93af287" }
Expand Down
1 change: 1 addition & 0 deletions lib/srv/desktop/rdp/rdpclient/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use ironrdp_pdu::input::mouse::PointerFlags;
use ironrdp_pdu::input::{InputEventError, MousePdu};
use ironrdp_pdu::nego::SecurityProtocol;
use ironrdp_pdu::rdp::capability_sets::MajorPlatformType;
use ironrdp_pdu::rdp::client_info::ClientInfoFlags;
use ironrdp_pdu::rdp::RdpError;
use ironrdp_pdu::{PduError, PduParsing};
use ironrdp_rdpdr::pdu::RdpdrPdu;
Expand Down
25 changes: 21 additions & 4 deletions lib/srv/desktop/rdp/rdpclient/src/rdpdr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ use ironrdp_pdu::utils::CharacterSet;
use ironrdp_pdu::{custom_err, other_err, PduResult};
use ironrdp_rdpdr::pdu::esc::{
rpce, CardProtocol, CardState, CardStateFlags, ConnectCall, ConnectReturn, ContextCall,
EstablishContextReturn, GetDeviceTypeIdCall, GetDeviceTypeIdReturn, GetStatusChangeCall,
GetStatusChangeReturn, HCardAndDispositionCall, ListReadersReturn, ReadCacheCall,
ReadCacheReturn, ReaderStateCommonCall, ScardCall, StatusReturn, TransmitCall, TransmitReturn,
WriteCacheCall,
EstablishContextReturn, GetDeviceTypeIdCall, GetDeviceTypeIdReturn, GetReaderIconReturn,
GetStatusChangeCall, GetStatusChangeReturn, HCardAndDispositionCall, ListReadersReturn,
ReadCacheCall, ReadCacheReturn, ReaderStateCommonCall, ScardCall, StatusReturn, TransmitCall,
TransmitReturn, WriteCacheCall,
};
use ironrdp_rdpdr::pdu::RdpdrPdu;
use ironrdp_rdpdr::{
Expand Down Expand Up @@ -186,6 +186,10 @@ impl RdpdrBackend for TeleportRdpdrBackend {
ScardCall::WriteCacheCall(call) => self.handle_write_cache(req, call),
_ => Self::unsupported_combo_error(req.io_control_code, call),
},
ScardIoCtlCode::GetReaderIcon => match call {
ScardCall::GetReaderIconCall(_) => self.handle_get_reader_icon(req),
_ => Self::unsupported_combo_error(req.io_control_code, call),
},
_ => Err(custom_err!(
"TeleportRdpdrBackend::handle_scard_call",
TeleportRdpdrBackendError(format!(
Expand Down Expand Up @@ -518,6 +522,19 @@ impl TeleportRdpdrBackend {
self.write_rdpdr_response(req, Box::new(LongReturn::new(ReturnCode::Success)))
}

fn handle_get_reader_icon(
&mut self,
req: DeviceControlRequest<ScardIoCtlCode>,
) -> PduResult<()> {
self.write_rdpdr_response(
req,
Box::new(GetReaderIconReturn::new(
ReturnCode::UnsupportedFeature,
vec![],
)),
)
}

fn create_get_status_change_return(
call: GetStatusChangeCall,
) -> rpce::Pdu<GetStatusChangeReturn> {
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/ironrdp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tracing-web = "0.1.2"
time = { version = "0.3", features = ["wasm-bindgen"] }
console_error_panic_hook = "0.1.7"

# TODO: update once https://github.com/Devolutions/IronRDP/pull/230 lands
# TODO: change when https://github.com/Devolutions/IronRDP/pull/230 lands
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "dfca83db55140e839a9b41049b4a2170f93af287" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "dfca83db55140e839a9b41049b4a2170f93af287" }
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "dfca83db55140e839a9b41049b4a2170f93af287" }
Expand Down