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

SetInformation and UnsupportedMinorFunctionRequest #312

Merged
merged 4 commits into from
Nov 29, 2023
Merged
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
557 changes: 291 additions & 266 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ sspi = "0.11"
tracing = { version = "0.1", features = ["log"] }
thiserror = "1.0"
png = "0.17"
bitflags = "2.4"

[profile.dev]
opt-level = 1
Expand Down
2 changes: 1 addition & 1 deletion crates/ironrdp-cliprdr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ ironrdp-pdu.workspace = true
ironrdp-svc.workspace = true
thiserror.workspace = true
tracing.workspace = true
bitflags = "2"
bitflags.workspace = true
2 changes: 1 addition & 1 deletion crates/ironrdp-graphics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ doctest = false

[dependencies]
bit_field = "0.10"
bitflags = "2"
bitflags.workspace = true
bitvec = "1.0"
byteorder = "1.5"
ironrdp-error.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/ironrdp-pdu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ std = ["alloc", "ironrdp-error/std"]
alloc = ["ironrdp-error/alloc"]

[dependencies]
bitflags = "2"
bitflags.workspace = true
ironrdp-error.workspace = true
tap = "1"

Expand Down
22 changes: 22 additions & 0 deletions crates/ironrdp-pdu/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,28 @@ impl<'a> ReadCursor<'a> {
Ok(i32::from_be_bytes(self.read_array::<4>()))
}

#[inline]
pub fn read_i64(&mut self) -> i64 {
i64::from_le_bytes(self.read_array::<8>())
}

#[inline]
pub fn read_i64_be(&mut self) -> i64 {
i64::from_be_bytes(self.read_array::<8>())
}

#[inline]
pub fn try_read_i64(&mut self, ctx: &'static str) -> PduResult<i64> {
ensure_size!(ctx: ctx, in: self, size: 8);
Ok(i64::from_le_bytes(self.read_array::<8>()))
}

#[inline]
pub fn try_read_i64_be(&mut self, ctx: &'static str) -> PduResult<i64> {
ensure_size!(ctx: ctx, in: self, size: 8);
Ok(i64::from_be_bytes(self.read_array::<8>()))
}

#[inline]
#[track_caller]
pub fn peek<const N: usize>(&mut self) -> [u8; N] {
Expand Down
2 changes: 1 addition & 1 deletion crates/ironrdp-rdpdr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ ironrdp-error.workspace = true
ironrdp-pdu.workspace = true
ironrdp-svc.workspace = true
tracing.workspace = true
bitflags = "2"
bitflags.workspace = true
3 changes: 2 additions & 1 deletion crates/ironrdp-rdpdr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ impl StaticVirtualChannelProcessor for Rdpdr {
| RdpdrPdu::ClientDriveQueryDirectoryResponse(_)
| RdpdrPdu::ClientDriveQueryVolumeInformationResponse(_)
| RdpdrPdu::DeviceReadResponse(_)
| RdpdrPdu::DeviceWriteResponse(_) => Err(other_err!("Rdpdr", "received unexpected packet")),
| RdpdrPdu::DeviceWriteResponse(_)
| RdpdrPdu::ClientDriveSetInformationResponse(_) => Err(other_err!("Rdpdr", "received unexpected packet")),
}
}
}
Loading