Skip to content

Commit 2a0cb7a

Browse files
authored
Update to windows-sys 0.45. (#294)
And winx 0.35, which adds a share_mode argument to `reopen_file`.
1 parent 0ad2154 commit 2a0cb7a

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ rustix = { version = "0.36.0", features = ["fs"] }
4040
nt_version = "0.1.3"
4141

4242
[target.'cfg(windows)'.dependencies.windows-sys]
43-
version = "0.42.0"
43+
version = "0.45.0"
4444
features = [
4545
"Win32_Storage_FileSystem",
4646
"Win32_Foundation",

cap-directories/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ directories-next = "2.0.0"
2020
rustix = { version = "0.36.0" }
2121

2222
[target.'cfg(windows)'.dependencies.windows-sys]
23-
version = "0.42.0"
23+
version = "0.45.0"
2424
features = [
2525
"Win32_Foundation",
2626
]

cap-fs-ext/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ std = ["cap-std"]
3333
#async_std_arf_strings = ["cap-async-std/arf_strings", "async_std_fs_utf8", "arf-strings"]
3434

3535
[target.'cfg(windows)'.dependencies.windows-sys]
36-
version = "0.42.0"
36+
version = "0.45.0"
3737
features = [
3838
"Win32_Storage_FileSystem",
3939
]

cap-primitives/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ cap-tempfile = { path = "../cap-tempfile" }
2828
rustix = { version = "0.36.0", features = ["fs", "process", "procfs", "termios", "time"] }
2929

3030
[target.'cfg(windows)'.dependencies]
31-
winx = "0.34.0"
31+
winx = "0.35.0"
3232

3333
[target.'cfg(windows)'.dependencies.windows-sys]
34-
version = "0.42.0"
34+
version = "0.45.0"
3535
features = [
3636
"Win32_Storage_FileSystem",
3737
"Win32_Foundation",

cap-primitives/src/windows/fs/reopen_impl.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use windows_sys::Win32::Storage::FileSystem::{
88
SECURITY_DELEGATION, SECURITY_EFFECTIVE_ONLY, SECURITY_IDENTIFICATION, SECURITY_IMPERSONATION,
99
};
1010
use windows_sys::Win32::System::SystemServices::{GENERIC_READ, GENERIC_WRITE};
11-
use winx::file::{AccessMode, Flags};
11+
use winx::file::{AccessMode, Flags, ShareMode};
1212

1313
/// Implementation of `reopen`.
1414
pub(crate) fn reopen_impl(file: &fs::File, options: &OpenOptions) -> io::Result<fs::File> {
@@ -80,7 +80,9 @@ pub(crate) fn reopen_impl(file: &fs::File, options: &OpenOptions) -> io::Result<
8080
return Err(io::Error::new(io::ErrorKind::Other, "Can't reopen file"));
8181
}
8282

83-
winx::file::reopen_file(file.as_handle(), new_access_mode, flags)
83+
let new_share_mode =
84+
ShareMode::FILE_SHARE_READ | ShareMode::FILE_SHARE_WRITE | ShareMode::FILE_SHARE_DELETE;
85+
winx::file::reopen_file(file.as_handle(), new_access_mode, new_share_mode, flags)
8486
}
8587

8688
fn get_access_mode(options: &OpenOptions) -> io::Result<u32> {

cap-tempfile/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rand = "0.8.1"
2424
rustix = { version = "0.36.0", features = ["procfs"] }
2525

2626
[target.'cfg(windows)'.dev-dependencies.windows-sys]
27-
version = "0.42.0"
27+
version = "0.45.0"
2828
features = [
2929
"Win32_Foundation",
3030
]

cap-time-ext/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ rustix = { version = "0.36.0", features = ["time"] }
2121

2222
[target.'cfg(windows)'.dependencies]
2323
once_cell = "1.5.2"
24-
winx = "0.34.0"
24+
winx = "0.35.0"

0 commit comments

Comments
 (0)