Skip to content

Commit 67de5de

Browse files
committed
Upgrade to Dokan 2.2.0 and bump dependencies
1 parent f3c2280 commit 67de5de

File tree

13 files changed

+281
-148
lines changed

13 files changed

+281
-148
lines changed

Cargo.lock

Lines changed: 212 additions & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[workspace]
22
members = ["dokan-sys", "dokan"]
3+
resolver = "2"
34

45
[profile.release]
56
lto = true

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ init:
6060
6161
install:
6262
- ps: &download-dokany |
63-
Invoke-WebRequest https://github.com/dokan-dev/dokany/releases/download/v2.0.6.1000/DokanSetup.exe -OutFile "$Env:TEMP\DokanSetup.exe"
63+
Invoke-WebRequest https://github.com/dokan-dev/dokany/releases/download/v2.2.0.1000/DokanSetup.exe -OutFile "$Env:TEMP\DokanSetup.exe"
6464
Start-Process "$Env:TEMP\DokanSetup.exe" -ArgumentList '/quiet /norestart' -Wait
6565

6666
if ($Env:USE_INSTALLED_LIB -eq $true) {
67-
$Env:DokanLibrary2_LibraryPath_x64 = 'C:\Program Files\Dokan\Dokan Library-2.0.6\lib\'
68-
$Env:DokanLibrary2_LibraryPath_x86 = 'C:\Program Files\Dokan\Dokan Library-2.0.6\x86\lib\'
67+
$Env:DokanLibrary2_LibraryPath_x64 = 'C:\Program Files\Dokan\Dokan Library-2.2.0\lib\'
68+
$Env:DokanLibrary2_LibraryPath_x86 = 'C:\Program Files\Dokan\Dokan Library-2.2.0\x86\lib\'
6969
} else {
7070
Remove-Item 'C:\Windows\System32\dokan2.dll'
7171
Remove-Item 'C:\Windows\SysWOW64\dokan2.dll'

dokan-sys/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Upgrade to **Dokan 2.2.0**.
13+
- Bump dependencies.
14+
1015
## [0.3.1] - 2022-10-04
1116

1217
### Added

dokan-sys/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dokan-sys"
3-
version = "0.3.1+dokan206"
3+
version = "0.3.1+dokan220"
44
authors = ["DDoSolitary <[email protected]>"]
55
description = "Raw FFI bindings for Dokan (user mode file system library for Windows)"
66
homepage = "https://dokan-dev.github.io"
@@ -18,11 +18,11 @@ build = "build.rs"
1818
appveyor = { repository = "Liryna/dokan-rust" }
1919

2020
[dependencies]
21-
libc = "0.2.82"
22-
winapi = { version = "0.3.9", features = ["std", "basetsd", "fileapi", "minwinbase", "minwindef", "ntdef", "winnt"] }
21+
libc = "0.2"
22+
winapi = { version = "0.3", features = ["std", "basetsd", "fileapi", "minwinbase", "minwindef", "ntdef", "winnt"] }
2323

2424
[build-dependencies]
25-
cc = "1.0.66"
25+
cc = "1.1"
2626

2727
[package.metadata.docs.rs]
2828
default-target = "x86_64-pc-windows-msvc"

dokan-sys/src/dokany

Submodule dokany updated 117 files

dokan/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Upgrade to **Dokan 2.2.0** through `dokan-sys`.
13+
- Bump dependencies.
14+
1015
## [0.3.1] - 2022-10-04
1116

1217
### Added

dokan/Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dokan"
3-
version = "0.3.1+dokan206"
3+
version = "0.3.1+dokan220"
44
authors = ["DDoSolitary <[email protected]>"]
55
description = "Rust-friendly wrapper for Dokan (user mode file system library for Windows)"
66
homepage = "https://dokan-dev.github.io"
@@ -16,17 +16,17 @@ edition = "2021"
1616
appveyor = { repository = "Liryna/dokan-rust" }
1717

1818
[dependencies]
19-
bitflags = "1.2.1"
20-
dokan-sys = { version = "0.3.1", path = "../dokan-sys" }
21-
widestring = "0.4.3"
22-
winapi = { version = "0.3.9", features = ["std", "errhandlingapi", "handleapi", "heapapi", "ioapiset", "minwinbase", "minwindef", "ntdef", "ntstatus", "processthreadsapi", "sddl", "securitybaseapi", "synchapi", "winbase", "winerror", "winnt"] }
19+
bitflags = "2.6"
20+
dokan-sys = { path = "../dokan-sys" }
21+
widestring = "1.1"
22+
winapi = { version = "0.3", features = ["std", "errhandlingapi", "handleapi", "heapapi", "ioapiset", "minwinbase", "minwindef", "ntdef", "ntstatus", "processenv", "processthreadsapi", "sddl", "securitybaseapi", "synchapi", "winbase", "winerror", "winnt"] }
2323

2424
[dev-dependencies]
25-
clap = "2.33.3"
26-
ctrlc = "3.2.3"
27-
lazy_static = "1.4.0"
28-
parking_lot = "0.11.1"
29-
regex = "1.4.3"
25+
clap = "4.5"
26+
ctrlc = "3.4"
27+
lazy_static = "1.5"
28+
parking_lot = "0.12"
29+
regex = "1.11"
3030

3131
[package.metadata.docs.rs]
3232
default-target = "x86_64-pc-windows-msvc"

dokan/examples/memfs/main.rs

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::{
1313
time::SystemTime,
1414
};
1515

16-
use clap::{App, Arg};
16+
use clap::{Arg, ArgAction, Command};
1717
use dokan::{
1818
init, shutdown, unmount, CreateFileInfo, DiskSpaceInfo, FileInfo, FileSystemHandler,
1919
FileSystemMounter, FileTimeOperation, FillDataError, FillDataResult, FindData, FindStreamData,
@@ -1280,49 +1280,52 @@ impl<'c, 'h: 'c> FileSystemHandler<'c, 'h> for MemFsHandler {
12801280
}
12811281

12821282
fn main() -> Result<(), Box<dyn std::error::Error>> {
1283-
let matches = App::new("dokan-rust memfs example")
1283+
let matches = Command::new("dokan-rust memfs example")
12841284
.author(env!("CARGO_PKG_AUTHORS"))
12851285
.arg(
1286-
Arg::with_name("mount_point")
1287-
.short("m")
1286+
Arg::new("mount_point")
1287+
.short('m')
12881288
.long("mount-point")
1289-
.takes_value(true)
1289+
.num_args(1)
12901290
.value_name("MOUNT_POINT")
12911291
.required(true)
12921292
.help("Mount point path."),
12931293
)
12941294
.arg(
1295-
Arg::with_name("single_thread")
1296-
.short("t")
1295+
Arg::new("single_thread")
1296+
.short('t')
12971297
.long("single-thread")
1298-
.help("Force a single thread. Otherwise Dokan will allocate the number of threads regarding the workload."),
1298+
.help("Force a single thread. Otherwise Dokan will allocate the number of threads regarding the workload.")
1299+
.action(ArgAction::SetTrue),
12991300
)
13001301
.arg(
1301-
Arg::with_name("dokan_debug")
1302-
.short("d")
1302+
Arg::new("dokan_debug")
1303+
.short('d')
13031304
.long("dokan-debug")
1304-
.help("Enable Dokan's debug output."),
1305+
.help("Enable Dokan's debug output.")
1306+
.action(ArgAction::SetTrue),
13051307
)
13061308
.arg(
1307-
Arg::with_name("removable")
1308-
.short("r")
1309+
Arg::new("removable")
1310+
.short('r')
13091311
.long("removable")
1310-
.help("Mount as a removable drive."),
1312+
.help("Mount as a removable drive.")
1313+
.action(ArgAction::SetTrue),
13111314
)
13121315
.get_matches();
13131316

1314-
let mount_point = U16CString::from_str(matches.value_of("mount_point").unwrap())?;
1317+
let mount_point = U16CString::from_str(matches.get_one::<String>("mount_point").unwrap())?;
13151318

13161319
let mut flags = MountFlags::ALT_STREAM;
1317-
if matches.is_present("dokan_debug") {
1320+
if matches.get_flag("dokan_debug") {
13181321
flags |= MountFlags::DEBUG | MountFlags::STDERR;
13191322
}
1320-
if matches.is_present("removable") {
1323+
if matches.get_flag("removable") {
13211324
flags |= MountFlags::REMOVABLE;
13221325
}
13231326

13241327
let options = MountOptions {
1325-
single_thread: matches.is_present("single_thread"),
1328+
single_thread: matches.get_flag("single_thread"),
13261329
flags,
13271330
..Default::default()
13281331
};

dokan/src/data/mount_point.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ impl<'a> From<&'a DOKAN_MOUNT_POINT_INFO> for MountPointInfo<'a> {
4747
let mount_point = if info.MountPoint[0] == 0 {
4848
None
4949
} else {
50-
Some(U16CStr::from_slice_with_nul(&info.MountPoint).unwrap())
50+
Some(U16CStr::from_slice_truncate(&info.MountPoint).unwrap())
5151
};
5252

5353
let unc_name = if info.UNCName[0] == 0 {
5454
None
5555
} else {
56-
Some(U16CStr::from_slice_with_nul(&info.UNCName).unwrap())
56+
Some(U16CStr::from_slice_truncate(&info.UNCName).unwrap())
5757
};
5858

5959
MountPointInfo {
6060
device_type: info.Type.into(),
6161
mount_point,
6262
unc_name,
63-
device_name: U16CStr::from_slice_with_nul(&info.DeviceName).unwrap(),
63+
device_name: U16CStr::from_slice_truncate(&info.DeviceName).unwrap(),
6464
session_id: info.SessionId,
6565
}
6666
}

0 commit comments

Comments
 (0)