use crate::devices::DeviceError;
use crate::platform::traits::DevicePathOps;
use super::devices as win_devices;
use super::WindowsPlatform;
impl DevicePathOps for WindowsPlatform {
fn validate_whole_disk_path(path: &str) -> Result<(), DeviceError> {
win_devices::validate_block_device_path(path).map_err(DeviceError::invalid_path)
}
fn paths_equivalent(listed: &str, selected: &str) -> bool {
win_devices::device_path_matches(listed, selected)
}
fn hint_for_io_error(err: &std::io::Error) -> Option<String> {
let code = err.raw_os_error()?;
let hint = match code {
5 => ". Hint: run litho-tui elevated (UAC), confirm volume dismount, close File Explorer on the target disk, and ensure no other disk utility has the device open.",
19 => ". Hint: the device may be hardware write-protected.",
32 => ". Hint: another program is using the disk; close File Explorer and dismount volumes.",
21 => ". Hint: the device is not ready — reconnect the USB drive, wait a moment, and ensure it was not taken offline.",
87 => ". Hint: the disk may still have mounted volumes; dismount them and retry.",
_ => return None,
};
Some(hint.to_string())
}
}