v0.7.2: Windows SPTI, 177 tests, platform file separation

This commit is contained in:
MattJackson
2026-04-11 16:15:14 +00:00
parent 425583ea09
commit 6de4ee4b5c
3 changed files with 32 additions and 1 deletions
+13
View File
@@ -87,6 +87,19 @@ pub struct SptiTransport {
handle: isize,
}
/// Normalize a device path to Windows \\.\X: format.
fn normalize_device_path(path: &str) -> String {
if path.starts_with("\\\\.\\") { return path.to_string(); }
let trimmed = path.trim_end_matches('\\');
if trimmed.len() == 2 && trimmed.as_bytes()[1] == b':' {
return format!("\\\\.\\{}", trimmed);
}
if path.to_lowercase().starts_with("cdrom") {
return format!("\\\\.\\{}", path);
}
format!("\\\\.\\{}", path)
}
impl SptiTransport {
pub fn open(device: &Path) -> Result<Self> {
let dev_str = device.to_str().ok_or_else(|| Error::DeviceNotFound {