Skip to content

Commit

Permalink
Merge branch 'master' into driver-ipc-api
Browse files Browse the repository at this point in the history
  • Loading branch information
MolotovCherry authored Jun 24, 2024
2 parents c7c55a3 + 9cf477c commit 2eae9d8
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 194 deletions.
198 changes: 72 additions & 126 deletions rust/Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion rust/bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.21.1"
pyo3 = "0.21.2"
driver-ipc = { path = "../../driver-ipc" }

[lints]
Expand Down
12 changes: 6 additions & 6 deletions rust/driver-ipc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ edition = "2021"

[dependencies]
log = "0.4.21"
serde = { version = "1.0.197", features = ["derive"] }
thiserror = "1.0.58"
serde = { version = "1.0.203", features = ["derive"] }
thiserror = "1.0.61"
owo-colors = "4.0.0"
serde_json = "1.0.114"
windows = { version = "0.54.0", features = ["Win32_Foundation"] }
serde_json = "1.0.117"
windows = { version = "0.57.0", features = ["Win32_Foundation"] }
lazy_format = "2.0.3"
joinery = "3.1.0"
winreg = "0.52.0"
tokio = { version = "1.37.0", features = [
tokio = { version = "1.38.0", features = [
"rt-multi-thread",
"sync",
"time",
Expand All @@ -23,7 +23,7 @@ tokio = { version = "1.37.0", features = [
tokio-stream = { version = "0.1.15", features = ["sync"] }

[dev-dependencies]
tokio = { version = "1.37.0", features = [
tokio = { version = "1.38.0", features = [
"rt-multi-thread",
"sync",
"time",
Expand Down
4 changes: 2 additions & 2 deletions rust/driver-logger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ log = { version = "0.4.21", features = ["std"] }
env_filter = { version = "0.1.0", default-features = false, optional = true }
widestring = "1.1.0"
winreg = "0.52.0"
thiserror = "1.0.58"
thiserror = "1.0.61"

[dependencies.windows]
version = "0.54.0"
version = "0.57.0"
features = ["Win32_System_Diagnostics_Debug"]

[dependencies.windows-sys]
Expand Down
8 changes: 4 additions & 4 deletions rust/vdd-user-session-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ version = "0.1.0"
edition = "2021"

[dependencies]
windows-service = "0.6.0"
windows-service = "0.7.0"
driver-ipc = { path = "../driver-ipc" }
clap = { version = "4.5.4", features = ["derive"] }
clap = { version = "4.5.7", features = ["derive"] }
winreg = "0.52.0"
serde_json = "1.0.115"
serde_json = "1.0.117"

[dependencies.windows]
version = "0.54.0"
version = "0.57.0"
features = [
"Win32_Foundation",
"Win32_System_RemoteDesktop",
Expand Down
8 changes: 3 additions & 5 deletions rust/virtual-display-driver-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ edition = "2021"
workspace = true

[dependencies]
clap = { version = "4.5.3", features = ["derive"] }
clap = { version = "4.5.7", features = ["derive"] }
color-eyre = "0.6.3"
driver-ipc = { path = "../driver-ipc" }
eyre = "0.6.12"
owo-colors = "4.0.0"
serde_json = "1.0.114"
windows = { version = "0.54.0", features = ["Win32_Foundation"] }
win-pipes = { git = "https://github.com/MolotovCherry/WinPipes-rs" }
serde_json = "1.0.117"
lazy_format = "2.0.3"
joinery = "3.1.0"
serde = "1.0.197"
serde = "1.0.203"
19 changes: 6 additions & 13 deletions rust/virtual-display-driver/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@
target = "x86_64-pc-windows-msvc"

rustflags = [
"-Z",
"pre-link-arg=/NOLOGO",
"-Z",
"pre-link-arg=/MANIFEST:NO",
"-Z",
"pre-link-arg=/SUBSYSTEM:WINDOWS",
"-Z",
"pre-link-arg=/DYNAMICBASE",
"-Z",
"pre-link-arg=/NXCOMPAT",

"-C",
"link-arg=/OPT:REF,ICF",
"-Zpre-link-arg=/NOLOGO",
"-Zpre-link-arg=/MANIFEST:NO",
"-Zpre-link-arg=/SUBSYSTEM:WINDOWS",
"-Zpre-link-arg=/DYNAMICBASE",
"-Zpre-link-arg=/NXCOMPAT",
"-Clink-arg=/OPT:REF,ICF",
]
12 changes: 6 additions & 6 deletions rust/virtual-display-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ workspace = true
crate-type = ["cdylib"]

[dependencies]
thiserror = "1.0.58"
anyhow = "1.0.81"
thiserror = "1.0.61"
anyhow = "1.0.86"
wdf-umdf-sys = { path = "../wdf-umdf-sys" }
wdf-umdf = { path = "../wdf-umdf" }
log = "0.4.21"
bytemuck = { version = "1.15.0", features = ["derive"] }
serde_json = "1.0.114"
bytemuck = { version = "1.16.1", features = ["derive"] }
serde_json = "1.0.117"
driver-ipc = { path = "../driver-ipc" }
driver-logger = { path = "../driver-logger" }
tokio = { version = "1.37.0", features = [
tokio = { version = "1.38.0", features = [
"macros",
"net",
"rt-multi-thread",
Expand All @@ -28,7 +28,7 @@ tokio = { version = "1.37.0", features = [
] }

[dependencies.windows]
version = "0.54.0"
version = "0.57.0"
features = [
"Win32_Foundation",
"Win32_Security",
Expand Down
39 changes: 14 additions & 25 deletions rust/virtual-display-driver/src/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,14 @@ pub fn startup() {
loop {
tokio::select! {
val = server.read(&mut buf) => {
let Ok(size) = val else {
// break on err
break;
};
match val {
// 0 = no more data to read
// or break on err
Ok(0) | Err(_) => break,

if size == 0 {
// no more data to read
break;
Ok(size) => msg_buf.extend(&buf[..size]),
}

msg_buf.extend(&buf[..size]);

// get all eof boundary positions
let eof_iter = msg_buf.iter().enumerate().filter_map(|(i, &byte)| {
if byte == EOF as u8 {
Expand All @@ -230,24 +226,17 @@ pub fn startup() {
},

val = rx.recv() => {
let (client_id, data) = match val {
Ok(data) => data,
Err(e) => {
if let RecvError::Lagged(_) = e {
continue;
}

// closed
break;
}
};
let command = match val {
// ignore if this value was sent for the current client (current client doesn't need notification)
Ok((client_id, _)) if client_id == id => continue,

// ignore if this value was sent for the current client (current client doesn't need notification)
if id == client_id {
continue;
}
Ok((_, data)) => EventCommand::Changed(data),

let command = EventCommand::Changed(data);
Err(RecvError::Lagged(_)) => continue,

// closed
Err(_) => break
};

let Ok(mut serialized) = serde_json::to_string(&command) else {
error!("Command::Request - failed to serialize reply");
Expand Down
8 changes: 4 additions & 4 deletions rust/wdf-umdf-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ edition = "2021"
workspace = true

[dependencies]
paste = "1.0.14"
bytemuck = "1.15.0"
thiserror = "1.0.58"
paste = "1.0.15"
bytemuck = "1.16.1"
thiserror = "1.0.61"

[build-dependencies]
bindgen = "0.69.4"
thiserror = "1.0.58"
thiserror = "1.0.61"
winreg = "0.52.0"
4 changes: 2 additions & 2 deletions rust/wdf-umdf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ workspace = true

[dependencies]
wdf-umdf-sys = { path = "../wdf-umdf-sys" }
paste = "1.0.14"
thiserror = "1.0.58"
paste = "1.0.15"
thiserror = "1.0.61"

0 comments on commit 2eae9d8

Please sign in to comment.