mirror of
https://github.com/ivall/xcl.git
synced 2026-11-24 05:14:57 +01:00
Merge pull request #93 from ozimchuk/wine-keep-image-base
This commit is contained in:
@@ -328,7 +328,13 @@ pub fn run_main(m: &Arc<MappedModule>) -> u32 {
|
||||
};
|
||||
unsafe {
|
||||
// PEB.ImageBaseAddress → GetModuleHandle(NULL), resources with NULL module, …
|
||||
*(peb().add(0x10) as *mut usize) = m.base;
|
||||
use windows_sys::Win32::System::LibraryLoader::{GetModuleHandleA, GetProcAddress};
|
||||
let wine = GetProcAddress(GetModuleHandleA(c"ntdll.dll".as_ptr() as *const u8), c"wine_get_version".as_ptr() as *const u8).is_some();
|
||||
if wine {
|
||||
crate::xlog_info!("Wine: PEB.ImageBaseAddress left alone (its loader needs the real main image there)");
|
||||
} else {
|
||||
*(peb().add(0x10) as *mut usize) = m.base;
|
||||
}
|
||||
run_tls_callbacks(m, 1);
|
||||
}
|
||||
READY.store(true, Ordering::Release);
|
||||
|
||||
Reference in New Issue
Block a user