mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-08-04 15:18:17 +00:00
feat(rdpdr): add USER_LOGGEDON flag support
As I was debugging some related issue, I implemented that. It may become useful some day. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
f9b6992e74
commit
5e78f91713
3 changed files with 16 additions and 1 deletions
|
@ -207,6 +207,7 @@ impl SvcProcessor for Rdpdr {
|
|||
}
|
||||
RdpdrPdu::ServerDeviceAnnounceResponse(pdu) => self.handle_server_device_announce_response(pdu),
|
||||
RdpdrPdu::DeviceIoRequest(pdu) => self.handle_device_io_request(pdu, &mut src),
|
||||
RdpdrPdu::UserLoggedon => Ok(vec![]),
|
||||
// TODO: This can eventually become a `_ => {}` block, but being explicit for now
|
||||
// to make sure we don't miss handling new RdpdrPdu variants here during active development.
|
||||
RdpdrPdu::ClientNameRequest(_)
|
||||
|
|
|
@ -364,7 +364,9 @@ impl CapabilityMessage {
|
|||
protocol_minor_version: VERSION_MINOR_12,
|
||||
io_code_1: IoCode1::REQUIRED,
|
||||
io_code_2: 0,
|
||||
extended_pdu: ExtendedPdu::RDPDR_DEVICE_REMOVE_PDUS | ExtendedPdu::RDPDR_CLIENT_DISPLAY_NAME_PDU,
|
||||
extended_pdu: ExtendedPdu::RDPDR_DEVICE_REMOVE_PDUS
|
||||
| ExtendedPdu::RDPDR_CLIENT_DISPLAY_NAME_PDU
|
||||
| ExtendedPdu::RDPDR_USER_LOGGEDON_PDU,
|
||||
extra_flags_1: ExtraFlags1::empty(),
|
||||
extra_flags_2: 0,
|
||||
special_type_device_cap,
|
||||
|
|
|
@ -34,6 +34,7 @@ pub enum RdpdrPdu {
|
|||
DeviceReadResponse(DeviceReadResponse),
|
||||
DeviceWriteResponse(DeviceWriteResponse),
|
||||
ClientDriveSetInformationResponse(ClientDriveSetInformationResponse),
|
||||
UserLoggedon,
|
||||
EmptyResponse,
|
||||
}
|
||||
|
||||
|
@ -94,6 +95,10 @@ impl RdpdrPdu {
|
|||
component: Component::RdpdrCtypCore,
|
||||
packet_id: PacketId::CoreDeviceIoCompletion,
|
||||
},
|
||||
RdpdrPdu::UserLoggedon => SharedHeader {
|
||||
component: Component::RdpdrCtypCore,
|
||||
packet_id: PacketId::CoreUserLoggedon,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,6 +114,7 @@ impl Decode<'_> for RdpdrPdu {
|
|||
ServerDeviceAnnounceResponse::decode(src)?,
|
||||
)),
|
||||
PacketId::CoreDeviceIoRequest => Ok(RdpdrPdu::DeviceIoRequest(DeviceIoRequest::decode(src)?)),
|
||||
PacketId::CoreUserLoggedon => Ok(RdpdrPdu::UserLoggedon),
|
||||
_ => Err(unsupported_value_err!(
|
||||
"RdpdrPdu",
|
||||
"PacketId",
|
||||
|
@ -138,6 +144,7 @@ impl Encode for RdpdrPdu {
|
|||
RdpdrPdu::DeviceReadResponse(pdu) => pdu.encode(dst),
|
||||
RdpdrPdu::DeviceWriteResponse(pdu) => pdu.encode(dst),
|
||||
RdpdrPdu::ClientDriveSetInformationResponse(pdu) => pdu.encode(dst),
|
||||
RdpdrPdu::UserLoggedon => Ok(()),
|
||||
RdpdrPdu::EmptyResponse => {
|
||||
// https://github.com/FreeRDP/FreeRDP/blob/dfa231c0a55b005af775b833f92f6bcd30363d77/channels/drive/client/drive_main.c#L601
|
||||
dst.write_u32(0);
|
||||
|
@ -163,6 +170,7 @@ impl Encode for RdpdrPdu {
|
|||
RdpdrPdu::DeviceReadResponse(pdu) => pdu.name(),
|
||||
RdpdrPdu::DeviceWriteResponse(pdu) => pdu.name(),
|
||||
RdpdrPdu::ClientDriveSetInformationResponse(pdu) => pdu.name(),
|
||||
RdpdrPdu::UserLoggedon => "UserLoggedon",
|
||||
RdpdrPdu::EmptyResponse => "EmptyResponse",
|
||||
}
|
||||
}
|
||||
|
@ -185,6 +193,7 @@ impl Encode for RdpdrPdu {
|
|||
RdpdrPdu::DeviceReadResponse(pdu) => pdu.size(),
|
||||
RdpdrPdu::DeviceWriteResponse(pdu) => pdu.size(),
|
||||
RdpdrPdu::ClientDriveSetInformationResponse(pdu) => pdu.size(),
|
||||
RdpdrPdu::UserLoggedon => 0,
|
||||
RdpdrPdu::EmptyResponse => size_of::<u32>(),
|
||||
}
|
||||
}
|
||||
|
@ -240,6 +249,9 @@ impl fmt::Debug for RdpdrPdu {
|
|||
Self::ClientDriveSetInformationResponse(it) => {
|
||||
write!(f, "RdpdrPdu({:?})", it)
|
||||
}
|
||||
Self::UserLoggedon => {
|
||||
write!(f, "RdpdrPdu(UserLoggedon)")
|
||||
}
|
||||
Self::EmptyResponse => {
|
||||
write!(f, "RdpdrPdu(EmptyResponse)")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue