Skip to content

Commit

Permalink
Implement ipc-channel on Windows
Browse files Browse the repository at this point in the history
This implementation uses named pipes on Windows, with auto-generated uuid
names.  It takes advantage of DuplicateHandle to clone handles to target
processes when sending handles cross-process.  Shared memory is implemented
using anonymous file mappings.  select() and friends are implemented using
IO Completion Ports.
  • Loading branch information
vvuk committed Oct 5, 2016
1 parent ca63fdb commit af63d10
Show file tree
Hide file tree
Showing 4 changed files with 1,489 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ uuid = {version = "0.3", features = ["v4"]}

[dev-dependencies]
crossbeam = "0.2"

[target.'cfg(target_os = "windows")'.dependencies]
winapi = "*"
user32-sys = "*"
kernel32-sys = "*"
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@ extern crate bincode;
extern crate libc;
extern crate rand;
extern crate serde;

#[cfg(any(feature = "force-inprocess", target_os = "windows", target_os = "android"))]
extern crate uuid;

#[cfg(all(not(feature = "force-inprocess"), target_os = "windows"))]
extern crate winapi;
#[cfg(all(not(feature = "force-inprocess"), target_os = "windows"))]
extern crate kernel32;
#[cfg(all(not(feature = "force-inprocess"), target_os = "windows"))]
extern crate user32;

pub mod ipc;
pub mod platform;
mod refcell;
Expand Down
5 changes: 4 additions & 1 deletion src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ mod os {
#[cfg(all(not(feature = "force-inprocess"), target_os = "macos"))]
include!("macos/mod.rs");

#[cfg(any(feature = "force-inprocess", target_os = "windows", target_os = "android"))]
#[cfg(all(not(feature = "force-inprocess"), target_os = "windows"))]
include!("windows/mod.rs");

#[cfg(any(feature = "force-inprocess", target_os = "android"))]
include!("inprocess/mod.rs");
}

Expand Down
Loading

0 comments on commit af63d10

Please sign in to comment.