Add path specification for Windows Root (#754)

This commit is contained in:
VocalFan 2024-03-22 15:58:09 -04:00 committed by GitHub
parent 1aecdffa61
commit c969c822b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,8 @@ impl HostFile {
use windows_sys::Win32::System::Kernel::OBJ_CASE_INSENSITIVE;
// Encode path name.
let path = path.as_ref();
let path_spec = format!("\\??\\{}", path.as_ref().to_str().unwrap());
let path = std::path::PathBuf::from(path_spec);
let mut path: Vec<u16> = path.as_os_str().encode_wide().collect();
let len: u16 = (path.len() * 2).try_into().unwrap();
let mut path = UNICODE_STRING {