Jinoh Kang (@iamahuman) commented about tools/wine/wine.rs:
+ .ok()? + .parent()? + .to_str() + .map(|s| s.to_string()) +} + +#[cfg(target_os = "windows")] +fn get_bindir(_argv0: &str) -> Option<String> { + use std::ptr; + use winapi::um::{libloaderapi::GetModuleFileNameA, winnt::MAX_PATH}; + + let mut path = vec![0u8; MAX_PATH as usize]; + unsafe { + GetModuleFileNameA(ptr::null_mut(), path.as_mut_ptr() as *mut i8, MAX_PATH); + } + let path_str = String::from_utf8_lossy(&path); This causes regressions in non-UTF8 Unix path which would previously be handled without problem. Please use OsString instead.
The regression occurs despite a very minor fact that it has never been possible to run the loader on Windows before. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7717#note_99607